cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F091 crashes during debug but runs normal without debugging

Curtis B.
Senior

Hi everyone,

I observed a strange behaviour while creating software for a STM32F091. I am using CubeIDE and HAL. FreeRTOS is used as well. The application is running as expected so far, but when I try to run it in debug mode it does not work. It crashes at different locations within the HAL_Init() function. Did someone experienced a similar behavior and probably has a solution?

Best regards

13 REPLIES 13

Check BOOT0 is pulled low. Check Vector Table mapping / memory mapped at zero.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

One of those infamous "system memory mapped" cases, in this case probably due to PEMPTY. Debugger (I mean particular steps the debugging software takes) may or may not be involved; but maybe it's just the particular method how you approach debugging.

Try first just program the chip and power-cycle, and then proceed with debugging (i.e. the last power cycle before debugging must be with nonempty FLASH).

If this won't help, it's the debugger. As it might be tricky to fight, as the first step in your program, before enabling any interrupts, explicitly map user FLASH at 0.

JW

@jan and @Clive: That are good hints. I suspect a slack joint at the BOOT0 pin. I have to check this when I am done with the grind today...

Best regards

Ok,it seems it was an Boot issue. The Boot0 pin was not connected properly. I made a ghetto-fix on the pcb, however that was not sufficient. Need to check if the fix has been done correctly. So I changed the Option Byte to force booting from flash and now it works. The code is running properly and I can debug it. Thanks for your support!