AT32WB415
Series Reference Manual
2022.04.13
Page 370
Ver 2.00
22
Debug (DEBUG)
22.1 Debug introduction
Cortex
™
-M4 core provides poweful debugging features including halt and single step support, as well as
trace function that is used for checking the details of the program execution. The debug features are
implemented with a serial wire debug interface. The track information can be collected via a serial wire
viewing interface, or TRACE interface (for a large track bandwidth). The track and debug interfaces can
be combined into a single interface.
ARM Cortex
™
-M4 reference documentation:
Cortex™-M4 Technical Reference Manual (TRM)
ARM Debug Interface V5
ARM CoreSight Design Kit revision r1p0 Technical Reference Manual
22.2 Debug and Trace
It is possible to support debugging for different peripherals, and configure the status of peripherals during
debugging. For timers and watchdogs, the user can select whether or not to stop or continue counting
during debugging; For CAN, the user can select whether or not to stop or continue updating receive
registers during debugging; For I2C, the user can select whether or not to stop or continue SMBUS
timeout counting.
In addition, code debugging is supported in Low-power mode. In Sleep mode, the clock programmed by
code remains active for HCLK and FCLK to continue to work. In DeepSleep mode, HICK oscillator is
enabled to feed FCLK and HCLK.
There are several ID codes inside the MCU, which is accessible by the debugger using the
DEBUG_IDCODE at address 0xE0042000. It is part of the DEBUG and is mapped on the external PPB
bus. These codes are accessible using the JTAG debug port or the SWD debug port or by the user
software. They are even accessible while the MCU is under system reset.
Two trace interface modes supported: single-pin mode for serial wire view and multi-pin trace interface.
22.3 I/O pin control
SWJ-DP is supported in different packages of AT32WB415. It uses 5 general-purpose I/O ports. After
reset, the SWJ-DP can be immediately used by the debugger as a default function.
When the user wants to switch to a different debug port or disable debug feature, either IOMUX_MAPR
or IOMUX_MAPR7 register can be configured to release these dedicated I/O pins. Once a corresponding
debug I/O is released by the user, the GPIO controller takes control, and then these I/Os can be used
as general-purpose I/Os.
For trace feature, it is possible to set the TRACE_IOEN and TRACE_MODE bits in the DEBUG_CTRL
register to enable trace function and slect trace modes.
Table 22-1 Trace function enable
TRACE_IOEN
Description
0
No Trace (default state)
1
Trace enabled