2
votes

I'm running a STM32L151 microcontroller with Atollic Truestudio 7.0.1 (Eclipse-based). Connecting to the MCU with the ST-Link/V2 debugger through GDB.

Recently, I've noticed a problem with the debugger although I haven't changed anything in the project configuration. When execution pauses at a breakpoint, I can inspect variables, but the target is clearly still running even though the IDE indicates the debugger is "Suspended". This makes step debugging impossible since the program counter just jumps to wherever it is at the moment instead of the next line of code.

It looks like the target might actually be resetting a few seconds after the breakpoint is hit.

Any ideas as to what can cause this and how I might go about fixing it?

1
Another time, you may get a more comprehensive response on Electrical Engineering. However, be sure to read their on topic page and verify that any question you post there is appropriate for that site. Obviously, you got a response more than a year ago which was useful to you. That's great. However, there are many other possible reasons that this you might experience what you've described. Many of them hardware/test setup related.Makyen♦

1 Answers

8
votes

It looks like the target might actually be resetting a few seconds after the breakpoint is hit.

Then it's probably one of the watchdogs still running when the core is stopped. You can make them stop whenever the core is halted by the debugger with

DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_WWDG_STOP

or

DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_IWDG_STOP

whichever is appropriate.