I'm using STM32H745ZI Nucleo board with STLinkV3. I have successfully compiled and run simple program that flashes LEDs on Cortex M7 core. When program runs without debugger, everything's fine.
The problem appears while degugging. When I set breakpoint on line that turns the LED on, debugger stops in this place. The problem is that once stopped, continue and step over aren't working until the breakpoint is unset.
Code isn't much complicated:
while (1) {
LD1_SET(1);
HAL_Delay(100);
LD2_SET(1);
HAL_Delay(100);
LD3_SET(1);
HAL_Delay(100);
LD1_SET(0);
HAL_Delay(100);
LD2_SET(0);
HAL_Delay(100);
LD3_SET(0);
HAL_Delay(100);
}
This is how it looks like in gdb console:
# Setting breakpoint on LED ON
(gdb) b main.c:166
Breakpoint 1 at 0x8001788: file Src/main.c, line 166.
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
# Hit! Debugger seems working, LED is still OFF
Breakpoint 1, main () at Src/main.c:166
166 LD1_SET(1);
(gdb) c
Continuing.
# Hit the same breakpoint with no blinking between
Breakpoint 1, main () at Src/main.c:166
166 LD1_SET(1);
# Setting breakpoint on LED OFF
(gdb) b main.c:174
Breakpoint 2 at 0x80017c6: file Src/main.c, line 174.
(gdb) c
Continuing.
# Still hits LED ON, LED is still OFF
Breakpoint 1, main () at Src/main.c:166
166 LD1_SET(1);
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x08001788 in main at Src/main.c:166
breakpoint already hit 3 times
2 breakpoint keep y 0x080017c6 in main at Src/main.c:174
# Removing breakpoint on LED ON
(gdb) del 1
(gdb) c
Continuing.
# LED is ON, prorgram finally hit next breakpoint
Breakpoint 2, main () at Src/main.c:174
174 LD1_SET(0);
How to make it work? Have you experienced similar problem before?