STM32G0 SV#8

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

mck1117
Posts: 28
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 5 times

STM32G0 SV#8

Postby mck1117 » Wed Nov 11, 2020 7:16 am

I'm getting an unexpected SV#8 doing the bringup on an STM32G031. Here's the stack trace:

Screen Shot 2020-11-10 at 10.01.57 PM.png


As suggested by the file name, Vector64 is DMA1.

I've reduced the code down to the minimum project that does it (tested on a nucleo g031): https://github.com/mck1117/chibi_sv8

One thread continuously samples the adc, only one sample at a time (setting/clearing a pin while adcConvert is running). One thread toggles a GPIO every 3ms. I hooked up a logic analyzer to see some history of what's going on, and the exception occurs something like 10ms after startup. I also added a context switch hook to toggle a third pin to see what the scheduler is doing.

Screen Shot 2020-11-10 at 10.04.21 PM.png


Any idea what's going on? Looking in the debugger, the priority of that interrupt is 10, so it shouldn't be able to preempt the kernel unless something has gone wrong (besides, on v6m there is no partial disable, you can only disable interrupts fully).

mck1117
Posts: 28
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 5 times

Re: STM32G0 SV#8

Postby mck1117 » Wed Nov 11, 2020 7:39 am

The plot thickens: everything works properly at -Og but does not work at -O1 or -O2.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32G0 SV#8

Postby Giovanni » Wed Nov 11, 2020 7:58 am

Hi,

What compiler are you using? there is a known problem in GCC above 6.x, only the very latest 9.3.1 is not affected.

Giovanni

mck1117
Posts: 28
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 5 times

Re: STM32G0 SV#8

Postby mck1117 » Wed Nov 11, 2020 8:12 am

Yep - updating from 9.2.1 to 9.3.1 fixed it. Evidently I misread the discussion about when that bug had been fixed (the warning was printing itself out every compile...), and thought I was safe from the bug.

Thanks for the help!


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 61 guests