cancel
Showing results for 
Search instead for 
Did you mean: 

When debugging, target MCU continues to run after breakpoint is hit

Andrew Watson
Associate II
Posted on May 12, 2017 at 11:02

I've noticed this behaviour in Atollic TrueStudio 7.0.1 and 7.1.2, using the ST-Link V2 debugger (several variants, including the regular ST-Link V2 and the ISOL version). When I place a breakpoint in the code, the execution stops at the breakpoint, I can inspect variables and otherwise interact with the device under test, but the device continues to run.

The debugger is clearly in 'Suspended' mode, but the target is running : status LEDs are still blinking and it's responding to its environment. When I try to step through the code, it jumps to a seemingly random location instead of going to the next line. This is a recent bug, doesn't happen all the time, and a colleague of mine has also experienced it recently.

Running our own code on a STM32L151RB. Any ideas?

Thanks in advance.

#stm32l1 #st-link/v2 #debugging #atollic #truestudio
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on May 12, 2017 at 12:13

Thanks,

It turns out it was the watchdog timer that wasn't properly frozen. I added the following line to my watchdog init function and it seems it has fixed the issue:

DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP, ENABLE);

View solution in original post

2 REPLIES 2
AvaTar
Lead
Posted on May 12, 2017 at 11:51

Perhaps you have disabled the flash download before debugging ?  (Options->Debugger->Download)

I suggest to enable 'Verify Download' within the same menu as well.

Sounds like your target application does not match the source code.

Posted on May 12, 2017 at 12:13

Thanks,

It turns out it was the watchdog timer that wasn't properly frozen. I added the following line to my watchdog init function and it seems it has fixed the issue:

DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP, ENABLE);