STM32F091 crashes during debug but runs normal without debugging
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-03 3:44 AM
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
Solved! Go to Solution.
- Labels:
-
STM32F0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-03 11:54 AM
Check BOOT0 is pulled low. Check Vector Table mapping / memory mapped at zero.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-04 12:26 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-04 3:41 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-04 12:28 PM
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!

- « Previous
-
- 1
- 2
- Next »