Skip to main content
Visitor II
May 12, 2017
Solved

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

  • May 12, 2017
  • 1 reply
  • 1242 views
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
    This topic has been closed for replies.
    Best answer by Andrew Watson
    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);

    1 reply

    Visitor II
    May 12, 2017
    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.

    Andrew WatsonAuthorAnswer
    Visitor II
    May 12, 2017
    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);