Connecting to the board
AN4989
50/118
AN4989 Rev 3
•
With ‘Normal’ connection mode, the target is reset then halted. The type of reset is
selected using the ‘Reset Mode’ option.
•
The ‘Connect Under Reset’ mode enables connection to the target using a reset vector
catch before executing any instructions. This is useful in many cases, for example
when the target contains a code that disables the JTAG/SWD pins.
•
The ‘Hot Plug’ mode enables connection to the target without a halt or reset. This is
useful for updating the RAM addresses or the IP registers while the application is
running.
In Keil
®
MDK-Arm µVISION, IAR™ EWARM and STM32CubeProgrammer, in case NRST is
not connected on the board or PCB a silent fallback operates with a System Reset. In case
of failure to take control of a board despite the use of Connection UnderReset / Hardware,
check the NRST connection on the board.
4.3 Low-power
case
By default, the debug connection is lost if the application puts the MCU in Sleep, Stop, or
Standby mode while the debug features are used. This is due to the fact that the Cortex
®
-M
core is not clocked in any of these modes.
However, the setting of dedicated configuration bits in the DBGMCU_CR register allows
software debug even when the low-power modes are used extensively.
Refer to the PWR and DBG sections of the reference manual for details.
Appendix A: Managing DBGMCU registers on page 95
guides the user through the various
means to manage DBGMCU depending on IDE and needs.
Caution:
In order to reduce power consumption, some applications turn all GPIOs to analog input
mode, including SWD GPIOs. This is the case for all PWR examples provided in
STM32Cube (debug connection is lost after
SystemPower_Config()
which sets all
GPIOs in Analog Input State).
Enabling low-power debug degrades power consumption performance by keeping some
clocks enabled and by preventing to optimize GPIO state. Even if this is useful for functional
debugging, it has anyhow to be banned as soon as the target is to measure/enhance power
consumption.
All DBGMCU registers values are kept while reset. Users must pay attention not to let
debug or unwanted states when returning to normal execution (refer to
Содержание STM32 Series
Страница 46: ...Connecting to the board AN4989 46 118 AN4989 Rev 3 Figure 30 Keil hotplug step2 ...
Страница 91: ...AN4989 Rev 3 91 118 AN4989 Debug through hardware exploration 117 Figure 69 STM32F4 F7 dual MCO capabilities ...
Страница 103: ...AN4989 Rev 3 103 118 AN4989 Managing DBGMCU registers 117 Figure 78 Generator Options debug MCU in STM32CubeIDE ...