STM32G0 SV#8

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

Moderator: RoccoMarco

Post Reply
mck1117
Posts: 37
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 9 times

STM32G0 SV#8

Post by mck1117 »

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: 37
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 9 times

Re: STM32G0 SV#8

Post by mck1117 »

The plot thickens: everything works properly at -Og but does not work at -O1 or -O2.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32G0 SV#8

Post by Giovanni »

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: 37
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 9 times

Re: STM32G0 SV#8

Post by mck1117 »

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!
Post Reply