GD32W51x User Manual
351
13.
Debug (DBG)
13.1.
Overview
The GD32W51x series provide a large variety of debug, trace and test features. They are
implemented with a standard configuration of the ARM CoreSightTM module together with a
daisy chained standard TAP controller. Debug and trace functions are integrated into the ARM
Cortex-M33. The debug system supports serial wire debug (SWD) and trace functions in
addition to standard JTAG debug. The debug and trace functions refer to the following
documents:
Cortex-M33 Technical Reference Manual
ARM Debug Interface v5 Architecture Specification
The DBG hold unit helps debugger to debug power saving mode, TIMER, I2C, WWDGT,
FWDGT and RTC. When corresponding bit is set, provide clock when in power saving mode
or hold the state for TIMER, WWDGT, FWDGT, I2C or RTC.
13.2.
JTAG/SW function description
Debug capabilities can be accessed by a debug tool via Serial Wire (SW - Debug Port) or
JTAG interface (JTAG - Debug Port).
13.2.1.
Switch JTAG or SW interface
By default, the JTAG interface is active. The sequence for switching from JTAG to SWD is:
Send 50 or more TCK cycles with TMS = 1.
Send the 16-bit sequence on TMS = 1110011110011110 (0xE79E LSB first).
Send 50 or more TCK cycles with TMS = 1.
The sequence for switching from SWD to JTAG is:
Send 50 or more TCK cycles with TMS = 1.
Send the 16-bit sequence on TMS = 1110011100111100 (0xE73C LSB first).
Send 50 or more TCK cycles with TMS = 1.
13.2.2.
Pin assignment
The JTAG interface provides 5-pin standard JTAG, known as JTAG clock (JTCK), JTAG mode
selection (JTMS), JTAG data input (JTDI), JTAG data output (JTDO) and JTAG reset
(NJTRST, active low). The serial wire debug (SWD) provide 2-pin SW interface, known as
SW data input/output (SWDIO) and SW clock (SWCLK). The two SW pin are multiplexed with
two of five JTAG pin, which is SWDIO multiplexed with JTMS, SWCLK multiplexed with JTCK.
The JTDO is also used as Trace async data output (TRACESWO) when async trace enabled.
The pin assignment are: