
RM0453 Rev 2
RM0453
Debug support (DBG)
1441
38.3.4
DBG reset and clocks
The debug port (SWJ-DP) is reset by a power-on reset or an OBL (option byte loading)
reset, and when waking up from Standby mode.
The debugger supplies the clock for the debug port via the debug interface pin
JTCK/SWCLK. This clock is used to register the serial input data in both Serial-wire and
JTAG modes, as well as to operate the state machines and internal logic of the debug port.
It must therefore continue to toggle for several cycles after the end of an access, to ensure
that the debug port returns to the idle state.
The SWJ-DP contains an asynchronous interface to the DAPCLK domain, which covers the
rest of the SWJ-DP and the CPU2 access port.
The DAPCLK is a gated version of the system HCLK3.
The DAPCLK domain is enabled by the debugger using the CDBGPWRUPREQ bit in the
DP_CTRLSTATR register. The clock must be enabled before the debugger can access any
of the debug features on the device. The availability of the clock is reflected in the
CDBGPWRUPACK bit in the DP_CTRLSTATR register. DAPCLK is disabled at power up,
after OBL, and after a wakeup from Standby. DAPCLK must be disabled when the debugger
is disconnected to avoid wasting energy.
The debug components included in the processors (such as ITM, DWG, FPB) are clocked
with the corresponding core clock.
38.3.5
DBG power domains
The debug components are located in the core power domain. This means that debugger
connection is not possible in Shutdown or Standby low-power modes. To avoid losing the
connection when the device enters Standby mode, it is possible to maintain the power to the
core by setting a bit in the microcontroller debug unit (DBGMCU). This also keeps the
processor clocks active and hold off the reset, so that the debug session is maintained.
38.3.6
DBG low-power modes
The STM32WL5x devices include power saving features that allow the core power domain
to be switched off or stopped when not required. If the power is switched off, or the core is
not clocked, all debug components are inaccessible to the debugger. To avoid this, power
saving mode emulation has been implemented. If emulation is enabled for a domain, the
domain still enters power saving mode, but its clock and power are maintained. In other
words, the domain behaves as if it is in power saving mode, but the debugger does not lose
the connection.
Emulation mode is programmed in the DBGMCU. For more information refer to
Section 38.12: Microcontroller debug unit (DBGMCU)
.
38.3.7
Serial-wire and JTAG debug port
The Serial-wire and JTAG debug port (SWJ-DP) is a CoreSight component that implements
an external access port for connecting debugging equipment.
The two following types of interface can be configured:
•
a 5-pin standard JTAG interface (JTAG-DP)
•
a 2-pin (clock + data) Serial-wire debug port (SW-DP)