I'm debugging a Cortex-M4 embedded device using GDB and OpenOCD.
Here's what I do:
- Connect GDB to OpenOCD:
target remote :3333 - Set a breakpoint at main:
break main - Then reset and start the program:
monitor reset run
However, the breakpoint at main is never hit, and the program just runs.
I expected execution to stop at main, but it doesn't. Is reset run skipping the breakpoint or starting execution before the breakpoint is active? (I'm debugging from Flash, and use hardware breakpoints if this makes any sense)
In parallel, if I execute reset init, which halts the CPU at the beginning, and then execute continue command, then it hits the breakpoint.