2021-01-15 04:15 AM
Hi,
I flash a project for debugging and set some breakpoints. Then I compile for release and run the code using the green arrow symbol. The code is flashed, but does not run, as it is stuck in a breakpoint from earlier debug sessions.
Is there a way to automatically remove all breakpoints in the device when starting a "Run" configuration?
thanks,
Michael
2021-01-15 05:07 AM
Your program should provide a way to clear breakpoint. As a last ressort, power cycle the device to clear breakpoints left in the debug unit.
2021-01-15 05:13 AM
power cycling is what I always need to do now. there should be an easier way, in my hardware this is quite complicated.
2021-01-15 05:32 AM
? is "Run > Skip All Breakpoints" or "Run > Remove All Breakpoints" menu you are looking for ?
2021-01-15 08:43 AM
thanks, but no, this removes the breakpoints in the IDE. I want to keep the breakpoints in the IDE for debugging, just clear them from the device memory when running a release version. I guess there should be some initialization commands in the run config, but I don't know which commands are available there.
2021-01-15 08:58 AM
If no IDE breakpoint we are discussing so about software breakpoints you've added to your applicative code ?
If yes you're looking for a way to ignore them at compile time ?
If hardware breakpoint (IDE ones) using "Run > Skip All Breakpoints" is allowing to ignore them running on target without removing them so possible to activate them later on relying on same menu (toggle mode)
2021-01-15 09:03 AM
no no. I assume the breakpoints are somehow still in the memory of my stm32. during "run", I don't want them there, only during "debug'. So if I click on run, the breakpoints can still be in the IDE ( I might need them again in next debug session), but they should be removed in the stm32 during run.
I hope that makes it a bit more clear ;)
2021-01-15 09:10 AM
According to me only 2 kind of breakpoints.
1) Hard breakpoint = added thru GDB (relying on console based gdb command usage or Thanks IDE dedicated UI). Such is not part of binary you're flashing to device.
2) Software breakpoint = added within applicative code by code developper
See https://mcuoneclipse.com/2012/07/29/software-and-hardware-breakpoints/
If a breakpoint is part of your device memory means it is part of your application code ... Removing it then new compile & device flash should solve trouble.
2021-01-15 09:14 AM
I never inserted software breakpoints, so how can I make gdb delete all breakpoints when I want to run release?
2021-01-15 09:28 AM
Have a try to toogle off all your breakpoints relying on "Run > Skip All Breakpoints".
Then launch a debug session on target. Once running stop it.
Have new try in run mode then.
If debug session and no breakpoint active GDB should do proper cleanup.