cancel
Showing results for 
Search instead for 
Did you mean: 

Debugger stuck on random line

The debugger is getting stuck on a random line about 350 lines into main(). There is nothing particular about this line of source code except its location, because if I comment out that line it just stops on the next one, and if I add a line it stops earlier. When the debugger is not active, the source runs just fine without stopping in that area. I have deleted all breakpoints and watchpoints. I have set the optimizations to "off". When the debugger is stuck on that line, its status is "running."

This is my first time debugging this project after converting from TrueStudio. I may need to switch back if I can't find anything else to try.

Any suggestions?

21 REPLIES 21

I'm using the STM32Cube IDE, and stlink debuggers built into development boards. I agree that somewhere there is some hidden code/data that is causing the debugger to halt where it's not wanted.

I don't think software breakpoints are supported with my configuration, or where I would disable them if they were.

I can make a fresh project from CubeMX with the same Cube MX configuration, but when I move my source code into that fresh project and rebuild, the problem moves with it. And to reiterate, source code builds that used to run fine are now also subject to this problem. I just need to figure out where the corruption is and replace that part.

Also a key point is that a colleague can debug the same source code without problems.

Thanks for responding, but I'm only using a lower-clocked run mode when I want to save power, I'm not using sleep or WFI.

My colleague pushed a new version of source code and .ioc file , I updated the CubeMX to the latest version, and magically, I can debug again. See you all in another few months, probably.

Then it looks like the other case discussed here, where re-import of the project into eclipse workspace helped.

-- pa

The phantom breakpoints came back. I tried changing my source code, but it's still stuck. I also tried using CubeMX to update the project file. Maybe I need to delete and re-install the IDE? Does anyone know in what file breakpoints are stored?

Some of the answers in https://stackoverflow.com/questions/7178096/eclipse-stops-at-non-existent-breakpoint or https://stackoverflow.com/questions/723199/why-does-my-eclipse-project-have-phantom-debugger-breakpoints won't help?

E.g. this one:

  1. I opened breakpoint tab (you will see this if you are in debug perspective)
  2. I saw there were two breakpoints enabled for the same line of code one of them was already unchecked but another was checked

JW

Thanks for looking that up for me. I have had this problem with all breakpoints disabled. This last round started after I accidentally inserted too many breakpoints once. After trying different builds, different projects, re-generating code from CubeMX, and changing parts of my source code, I still had the problem, though the phantom breakpoint would move around to different places. It even popped up when trying to debug a different project that was working trouble-free before this. Then I gave up for the day, flew to a different state, and when I started working the next day the problem was gone. I didn't change anything that I know of.

I wish I knew where breakpoints are stored so I can delete that and re-generate. There was a stack overflow comments about a .markers file, but I haven't been able to find that.

Humm.

> Then I gave up for the day, flew to a different state, and when I started working the next day the problem was gone.

I wonder if you can just do this every time the problem pops up... :D

JW

This problem is so strange. Every time it happens I lose about a half day of productivity and then some combination of banging my head against the computer and how I part my hair that day makes the problem go away.

To be continued, I'm sure...

Hello,

I've just landed in the same boat. CubeIDE has chosen particular source code line that it will stop in, regardless of breakpoints setting.

I can run the code without stopping only with "Skip All Breakpoints" setting, but I cannot stop anywhere else... Not usable.

Are we on ST forum? Can anyone from ST elaborate on those hidden breakpoints ? I too remember that this is probably related

to setting more breakpoints at some point... I'm on Cortex m7.

I also have other problem too, that my chip is recognized as not-original and I must erase it each time before programming.

It seems that CubeIDE is not the tool to be used for development, more for showcase...

Regards.