GD32VF103 User Manual
148
10.
Debug (DBG)
10.1.
Overview
The GD32VF103 series provide a large variety of debug and test features. They are
implemented with a standard configuration of the RISC-V module together with a daisy
chained standard TAP controller. Debug functions are integrated into the RISC-V. The debug
system supports standard JTAG debug. The debug refer to the following documents:
RISC-V External Debug Support Version 0.13
The DBG hold unit helps debugger to debug power saving mode, TIMER, I2C, WWDGT,
FWDGT and CAN. When corresponding bit is set, provide clock when in power saving mode
or hold the state for TIMER, WWDGT, FWDGT, I2C or CAN.
10.2.
JTAG function overview
Debug capabilities can be accessed by a debug tool via JTAG interface (JTAG - Debug Port).
10.2.1.
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 pin assignment are:
PA15: JTDI
PA14: JTCK
PA13: JTMS
PB4: NJTRST
PB3: JTDO
By default, 5-pin standard JTAG debug mode is chosen after reset. Users can also use JTAG
function without NJTRST pin, then the PB4 can be used to other GPIO functions. (NJTRST
tied to 1 by hardware). If JTAG not used, all 5-pin can be released to other GPIO functions.
Please refer to
10.2.2.
JTAG daisy chained structure
The RISC-V JTAG TAP is connected to a Boundary-Scan (BSD) JTAG TAP. The BSD JTAG
IR is 5-bit width, while the RISC-V JTAG IR is 4-bit width. So when JTAG in IR shift step, it