2025-03-28 5:11 AM
Is there a way to have this breakpoint only enabled at the start of the debug session?
So, when the code is first loaded, it will stop at main(); but then after subsequent resets I set my own breakpoint.
It doesn't appear in the list of breakpoints, so I can't clear/disable it from there.
2025-03-28 7:20 AM
I don't think so.
You can set "conditional" breakpoints in code which may achieve a similar result. Check if the debugger is connected, then check whatever flags you want (maybe a flag in RCC->CSR), and execute __BKPT();.
2025-03-30 5:49 PM
Uncheck "set breakpoint at main". Then in the editor set a breakpoint on main and change its type to temporary (in Breakpoint properties). Then start debugging. The program will still break once at the reset handler, resume automatically then break on main. Next resets won't break at main or reset handler.