Skip to main content
Sisto Zànier
Senior
October 21, 2017
Question

ST-Link/V2 vs HALT mode

  • October 21, 2017
  • 2 replies
  • 2340 views
Posted on October 21, 2017 at 19:08

Hi to all,

the ST-Link / V2 tool (so SWIM interface) is not compatible with the HALT instruction.

Therefore, for debugging and / or using STMStudio, I'm forced not to use this functional mode.

Is there any solution to elegantly circumvent the problem?

#st-link/v2
This topic has been closed for replies.

2 replies

Philipp Krause
Senior II
October 21, 2017
Posted on October 21, 2017 at 21:13

According to documentation, SWIM still works during halt (however, an active SWIM connection will result in higher power consumption than there would be otherwise). But the debug module doesn't.

What would you want to do during halt, that you can't? Set or clear a breakpoint?

Philipp

Pavel A.
October 23, 2017
Posted on October 23, 2017 at 20:54

Correct, the debugger cannot break into running program and read memory while it is in low power state - also during WFI and WFE states. If you want this ability, you cannot use low power states.

The only thing that the debugger can do is reset the chip. This exits the low power state.

-- p

Sisto Zànier
Senior
October 24, 2017
Posted on October 24, 2017 at 09:14

Hi Pavel,

Thanks for the confirm of the problem I actually encountered, that is, that in the Active-HALT mode during the DEBUG, can not possible to use the breakpoints.

However, it is a matter of little importance since during debug is not important how the device consumes and therefore simply I disable the HALT function by enabling it only in the final compilation or intermediate compilations, only to check the consumption.
Pavel A.
October 24, 2017
Posted on October 24, 2017 at 15:21

Hi Sisto,

If it were possible to detect from the program whether debugger is connected, then you don't have to compile two variants. Bit 3 in RST_SR register indicates that last reset was caused by SWIM. 

-- p