cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Cube ide Code tends to stop at break points when its not on debug mode.

Soundhar
Associate II

Good day! Im facing a issue on our board's L452 in specific when i program via stm32 cube ide my code tends to stop at my debug break points when its not in debug mode. i tried to remove all break points and make sure skip all break points enabled this is issue appears again. kindly guide me through how to solve this issue

Thank you

7 REPLIES 7
Markus GIRDLAND
ST Employee

Hello there!

Do you mean that you run your application without debugging it or do you mean that you built the application with Release instead of Debug?

It's possible that there some sort of sync issue between the GDB server and STM32CubeIDE.

In order to make sure there's no issue with breakpoints you could try the following:

  1. Power cycle the target (remove connection to the workstation)
  2. Go to the breakpoint view and remove all breakpoints
  3. Go to the debug console and write info b to make sure there are no breakpoints set

Let me know what you find out!

Soundhar
Associate II

good day sir,

i have tried info b on my debugger console at first i got break points on my all other projects got mentioned so i closed the other project except the project i was working on.

for 'info b' i got

info b

Num   Type      Disp Enb Address  What

1    breakpoint   keep y  0x08002010 in gpst_set at ../Core/Src/main.c:853

2    breakpoint   keep y  0x08003838 in vbat at ../Core/Src/main.c:1247

but i havnt did anything after this but my code works fine after upload with out stopping on debug break points.

initially what i faced was once i upload my code to my L452 after a debug session my code tends stop at line c:853 for no reason. how i found was i have a oled connected my L452 which tends freeze at the point and became non responsive. after i connected my L452 in debug mode and removed the break point at line c:853 but for no reason it stopped there without break point. so that i raised the above question towards the issue i faced.

i tried some other method like erased the flash on L452 with stm32 programmer, uploaded a different code but it didn't help and changed to a different st-link but I'm unable to solve the issue.

as a unorthodox solution i came to debug mode by skipping all break points and came out of the debug mode. after the code which retained the micro controller worked fine without stopping.

i don't know what's the cause of the issue but it got solved on its own or anything i did as above mentioned may have solved the issue.

@Markus GIRDLAND​ kindly reply me what may have caused the issue for me if i face the situation again how i have to solve this

mattias norlander
ST Employee

Hi @Soundhar​,

Just to be clear. You are using an ST-LINK with ST-LINK firmware? Not SEGGER firmware? SEGGER may support flash patch breakpoints.

If for some reason flash patch breakpoints are inserted, then they could be persistent if the debug session ends in an unexpected way. Disconnect/reconnect MCU+debugger (full power cycle) would probably not help. But that does not sound like your use case.

We also know that we have a bug in CubeIDE 1.7.0 where if you are debugging --> Hit Run --> Hit terminate. Without first clicking Suspend. Then we do not clean up the HW breakpoint registers. That also does not sound like your use case. To be fixed in next version.

If your issue arises again. Then do as Markus suggested. Clean breakpoints in Eclipse Breakpoints view. Type info b, if you still get breakpoints clean them out by clear linenumber. Disconnect/re-connect the ST-LINK+board.

Soundhar
Associate II

I'm using ST-Link Firmware. so i hope that's not the issue.

as you mentioned the bug on Cube IDE 1.7.0. I tend to terminate my debug session with out suspending the debug session first. it may be the cause of the issue in my case. in future days i will follow the procedure as you mentioned by doing suspend first and terminate the debug session

Thanks for the reply @mattias norlander​ 

> To be fixed in next version.

Cool! thank you!

mattias norlander
ST Employee

Good - let us know if you still keep running into this issue even after applying the "halt-terminate" work around. :)

Internal ticket reference 111279.

I am suspecting i have the same issue using STMCubeIDE

Version: 1.8.0

Build: 11526_20211125_0815 (UTC)

I am building in Release mode (stm32f072) , after using that binary to flash different production MCUs the code just stops and can be only recovered with stm32cubeIDE >>Run after i do some raindance with debugg/release click jump click everything works again

Ill update after i follow your previous comments (console command) and try to fix it

we dont need to firmware by ourselves, lets talk