GigaDevice Semiconductor GD-Link V2 User manual

GigaDevice Semiconductor Inc.
GD-Link V2 Adapter
User Guide
Revision 1.0
(Nov. 2023)

GD-Link V2 Adapter User Guide
2
Table of Contents
Table of Contents...........................................................................................................2
List of Figures ................................................................................................................3
List of Tables..................................................................................................................4
1. Introduction...........................................................................................................5
2. Hardware introduction .........................................................................................6
2.1. Pin definitions and wiring methods............................................................................ 6
2.2. Button, LEDs and Buzzer............................................................................................ 8
3. Software features................................................................................................10
3.1. Firmware updates...................................................................................................... 10
3.2. Programming function .............................................................................................. 12
3.2.1. IDE programming.................................................................................................................. 12
3.2.2. GD-Link Programming.......................................................................................................... 18
3.2.3. Offline programming ............................................................................................................. 20
3.2.4. Machine singal triggered programming ................................................................................ 22
3.2.5. Virtual USB disk drag and drop programming...................................................................... 23
3.3. Debug function.......................................................................................................... 26
3.3.1. SWD /JTAG debugging......................................................................................................... 26
3.3.2. SWO single-line tracing ........................................................................................................ 27
3.4. Virtual serial port printing......................................................................................... 31
4. Revision history..................................................................................................33

GD-Link V2 Adapter User Guide
3
List of Figures
Figure 2-1. GD-Link V2 pinout diagram ............................................................................................. 6
Figure 2-2. SWD interface connection diagram................................................................................ 7
Figure 2-3. JTAG interface connection diagram............................................................................... 7
Figure 2-4. SWD + SWO interface connection diagram ................................................................... 8
Figure 2-5. Serial interface connection diagram............................................................................... 8
Figure 2-6. GD-Link adapter hardware............................................................................................... 9
Figure 3-1. GD-Link V2 firmware update step 1.............................................................................. 10
Figure 3-2. GD-Link V2 firmware update step 2...............................................................................11
Figure 3-3. GD-Link V2 firmware update step 3...............................................................................11
Figure 3-4. GD-Link V2 firmware update step 4.............................................................................. 12
Figure 3-5. KEIL Debug Configuration............................................................................................. 13
Figure 3-6. KEIL Utilities Configuration........................................................................................... 13
Figure 3-7. KEIL Download Icon....................................................................................................... 14
Figure 3-8. Build Output Window - Programming Successful ...................................................... 14
Figure 3-9. IAR Debugger Configuration ......................................................................................... 14
Figure 3-10. IAR CMSIS DAP Configuration.................................................................................... 15
Figure 3-11. IAR Download and Debug Button ............................................................................... 16
Figure 3-12. IAR download progress bar......................................................................................... 16
Figure 3-13. Access the "Debug Configurations" interface .......................................................... 17
Figure 3-14. Configure the "Eclipse Debug" tab............................................................................. 17
Figure 3-15. Enter the debugging interface in Eclipse................................................................... 18
Figure 3-16. GD-Link Programmer Programming Options Configuration ................................... 18
Figure 3-17. Connecting the Target Chip in GD-Link Programmer............................................... 19
Figure 3-18. GD-Link Programmer burns target chip..................................................................... 19
Figure 3-19. GD-Link V2 Offline Burning Parameter Configuration.............................................. 20
Figure 3-20. GD-Link V2 Offline Burning File Update Configuration............................................ 21
Figure 3-21. Offline Burning File Updated to GD-Link V2.............................................................. 21
Figure 3-22. Simultaneously Adding BOOT+APP Offline Burning File Update to GD-Link V2.. 21
Figure 3-23. Offline Burning Configuration Option Byte Feature ................................................. 22
Figure 3-24. Machine signal burning pin distribution schematic diagram .................................. 23
Figure 3-25. USB mass storage device............................................................................................ 24
Figure 3-26. Virtual USB drive .......................................................................................................... 24
Figure 3-27. KEIL debugging interface ............................................................................................ 26
Figure 3-28. IAR debugging interface.............................................................................................. 27
Figure 3-29. SWO configuration step 1 in KEIL .............................................................................. 28
Figure 3-30. SWO configuration step 2 in KEIL .............................................................................. 28
Figure 3-31. Debug (printf) viewer window in KEIL........................................................................ 30
Figure 3-32. Logical Analyzer window in KEIL................................................................................ 31
Figure 3-33. USB serial device.......................................................................................................... 32
Figure 3-34. USB virtual serial printing ........................................................................................... 32

GD-Link V2 Adapter User Guide
4
List of Tables
Table 2-1. GD-Link V2 pin function definitions ................................................................................. 6
Table 2-2. Working status of GD-Link V2........................................................................................... 9
Table 3-1. Machine signal burning pin function definition............................................................ 23
Table 3-2. Trace mode enable........................................................................................................... 29
Table 3-3. Printf retarget.................................................................................................................... 29
Table 4-1. Revision history................................................................................................................ 33

GD-Link V2 Adapter User Guide
5
1. Introduction
GD-Link V2 is a rich-featured, easy-to-use, and portable debugging and programming tool
developed by GigaDevice for GD32 series MCU, which has the following characteristics:
USB2.0 high-speed interface
Provide 5V or 3.3V power supply for the target chip
Support firmware update through the GD-Link Programmer software
Support SWD / JTAG debugging and programming interface
Support GD32 ARM / RISC-V core full series of chips
Support KEIL / IAR / Eclpise debugging and programming
Support offline programming
Support virtual USB disk drag and drop programming
Support SWO function
Support virtual serial port printing

GD-Link V2 Adapter User Guide
6
2. Hardware introduction
2.1. Pin definitions and wiring methods
To enable programming, debugging, serial communication, and printing functions, connect
the GD-Link V2 pins to the SWD (SWO), JTAG, or USART interface of the target chip using
DuPont wires or ribbon cables. The pinout of GD-Link V2 is illustrated in Figure 2-1. GD-Link
V2 pinout diagram.
Figure 2-1. GD-Link V2 pinout diagram
The functions of each GD-Link V2 pin are described as shown in Table 2-1. GD-Link V2 pin
function definitions.
Table 2-1. GD-Link V2 pin function definitions
Pin Number
Pin Name
Description
1
T_Vref
Target chip power supply, providing 3.3V / 5V
2
T_TMS/IO
JTAG TMS pin / SWD SWDIO pin
3
GND
Power ground
4
T_TCK/CLK
JTAG TCK pin / SWD CLK pin
5
USART1_TX
Serial transmission pin
6
T_TDO
JTAG TDO pin / SWO pin
7
USART1_RX
Serial reception pin
8
T_TDI
JTAG TDI pin
9
GND
Power ground
10
T_Reset
JTAG / SWD target chip reset pin
The diagram of GD-Link V2 hardware connection to the target chip is illustrated in Figure 2-2.
SWD interface connection diagram, Figure 2-3. JTAG interface connection diagram,
Figure 2-4. SWD + SWO interface connection diagram and Figure 2-5. Serial interface
connection diagram.

GD-Link V2 Adapter User Guide
7
Figure 2-2. SWD interface connection diagram
T_Vref
T_TMS/IO
GND
T_TCK/CLK
T_Reset
(optional)
1
2
4
3,9
10
VCC
SWDIO
SWCLK
GND
NRST
GD-Link V2 Target MCU
Figure 2-3. JTAG interface connection diagram
T_Vref
T_TMS/IO
GND
T_TCK/CLK
T_Reset
(optional)
1
2
4
3,9
10
VCC
TMS
TCK
GND
NRST
GD-Link V2 Target MCU
T_TDO
T_TDI
TDO
TDI
6
8

GD-Link V2 Adapter User Guide
8
Figure 2-4. SWD + SWO interface connection diagram
T_Vref
T_TMS/IO
GND
T_TCK/CLK
T_Reset
(optional)
1
2
4
3,9
10
VCC
SWDIO
SWCLK
GND
NRST
GD-Link V2 Target MCU
T_TDO SWO
6
Figure 2-5. Serial interface connection diagram
T_Vref
USART_TX
GND
USART_RX
1
5
7
3,9
VCC
RX
TX
GND
GD-Link V2 Target MCU
2.2. Button, LEDs and Buzzer
GD-Link V2 features a single button (K1), a buzzer (BZ1) and four LEDs (LED1/2/3/4) as
indicators. The physical representation of GD-Link V2 is shown in Figure 2-6. GD-Link
adapter hardware. The button K1 is used for firmware updates and offline programming. For
specific usage instructions, please refer to the firmware update and offline programming
section.

GD-Link V2 Adapter User Guide
9
Figure 2-6. GD-Link adapter hardware
During offline programming and drag-and-drop programming from a virtual USB disk, when
the target chip has been successfully programmed with the desired file, the buzzer will beep,
indicating a successful programming status. The on-off and blinking of the LED indicate
different working states of GD-Link V2. Table 2-2. Working status of GD-Link V2 provides
a description of the different status of these LEDs which indicate the status of programming
and debugging tool.
Table 2-2. Working status of GD-Link V2
LED
LED status
GD-Link V2 working status
LED1
always bright
Offline programming or drag-and-drop
programming successful
flashing
performing offline programming or drag-and-
drop programming
LED2
flashing fast
USB connection successful
flashing slow
USB not connected
LED3
always bright
Firmware update status
LED4
always bright
Power supply is normal

GD-Link V2 Adapter User Guide
10
3. Software features
3.1. Firmware updates
GD-Link V2 provides firmware update functionality. Firmware updates are used to:
Support the latest MCUs released by GD32.
Fix issues present in the firmware.
GD-Link V2 can be updated using the GD-Link Programmer software. Users can visit the
GD32MCU official website to obtain the latest version of the GD-Link Programmer software,
unzip it after downloading, and follow these firmware update steps:
1. Disconnect GD-Link V2 from the computer's USB port.
2. While holding down button K1, plug GD-Link V2 back into the computer's USB port. At
this time, LED3 is always on, indicating that the programmer is in firmware upgrade mode.
3. Release button K1 and click the "GD-Link" menu in the GD-Link Programmer software.
Choose "Update Firmware" to start the firmware update process.
4. A progress bar will pop up in the GD-Link Programmer software, indicating the progress
of the update. Wait for it to reach 100% and show a successful update message.
Refer to Figure 3-1. GD-Link V2 firmware update step 1, Figure 3-2. GD-Link V2 firmware
update step 2 and Figure 3-3. GD-Link V2 firmware update step 3 for visual guidance on
the firmware update process.
Figure 3-1. GD-Link V2 firmware update step 1

GD-Link V2 Adapter User Guide
12
Figure 3-4. GD-Link V2 firmware update step 4
Note: During the firmware update process, do not unplug GD-Link V2 from the computer's
USB port.
3.2. Programming function
3.2.1. IDE programming
Programming with KEIL (version 5.27 and above):
Connect GD-Link V2 to the target chip according to the hardware connection described in Pin
definitions and wiring methods section. Connect the USB interface of GD-Link V2 to the
PC, and wait for LED2 to enter rapid blinking mode. Open KEIL software, in the KEIL Debug
tab, select "CMSIS-DAP Debugger" or "CMSIS-DAP ARMv8-M Debugger" in the "Debug"
option, as shown in Figure 3-5. KEIL debug configuration.

GD-Link V2 Adapter User Guide
13
Figure 3-5. KEIL debug configuration
In the "Utilities" tab, select "Use Debug Driver" and click the "Setting" button to choose the
MCU download algorithm and configure the erase mode and other settings, as shown in
Figure 3-6. KEIL utilities configuration.
Figure 3-6. KEIL utilities configuration
Click the "Download" icon in the KEIL menu bar. In the "Build Output" window, the
programming progress can be monitored, as shown in Figure 3-7. KEIL Download Icon and

GD-Link V2 Adapter User Guide
14
Figure 3-8. Build output window - programming successful.
Figure 3-7. KEIL Download Icon
Figure 3-8. Build output window - programming successful
Programming with IAR (version 8.50 and above):
Connect GD-Link V2 to the target chip according to the the hardware connection described
in Pin definitions and wiring methods section. Connect the USB interface of GD-Link V2
to the PC, and wait for LED2 to enter rapid blinking mode. Open IAR software. In the IAR
"Project" menu, choose "Options." In the "Debugger" tab, choose "CMSIS-DAP" as the
debugger driver, as shown in Figure 3-9. IAR debugger configuration. In the "Setup" tab,
choose the MCU type, download algorithm, and other configurations according to the target
chip's requirements, as shown in Figure 3-10. IAR CMSIS DAP configuration.
Figure 3-9. IAR debugger configuration

GD-Link V2 Adapter User Guide
15
Figure 3-10. IAR CMSIS DAP configuration
In the menu bar "Project" drop-down option "Download", click "Download active application"
and wait for the progress bar to complete the burning, as shown in Figure 3-11. IAR
download button and Figure 3-12. IAR download progress bar.

GD-Link V2 Adapter User Guide
16
Figure 3-11. IAR download button
Figure 3-12. IAR download progress bar
Programming with Eclipse
Connect GD-Link V2 to the target chip according to the hardware connection described in the
Pin definitions and wiring methods section. Connect the USB interface of GD-Link V2 to
the PC, and wait for LED2 to enter rapid blinking mode. Open the Eclipse software and click
"RUN" menu and select the dropdown option "Debug Configurations..." to enter the
"Debugger" tab, as shown in Figure 3-13. Access the "Debug Configurations" interface.
Configure the OpenOCD path correctly and fill in the cfg file to be used in the "Config options"
section, as demonstrated in Figure 3-14. Configure the "Eclipse Debug" tab in the Eclipse
Debug Configuration interface.
After completing the configuration, click the "Apply" button to save the settings. Then, select

GD-Link V2 Adapter User Guide
17
the "Debug" button, and when the "Confirm Perspective Switch" window appears, click "YES"
to confirm. This will initiate the code download and take to the debugging interface, as
illustrated in Figure 3-15. Enter the debugging interface in Eclipse.
Figure 3-13. Access the "Debug Configurations" interface
Figure 3-14. Configure the "Eclipse Debug" tab

GD-Link V2 Adapter User Guide
18
Figure 3-15. Enter the debugging interface in Eclipse
3.2.2. GD-Link Programming
Connect GD-Link V2 to the target chip according to the hardware connection described in Pin
definitions and wiring methods section. Connect the USB interface of GD-Link V2 to the
PC, and wait for LED2 to enter rapid blinking mode. Open the GD-Link Programmer software
and select the JTAG / SWD programming interface and configure the communication speed
in the "Properties" window. Refer to Figure 3-16. GD-Link programmer programming
options configuration for an illustration of GD-Link Programmer programming options.
Figure 3-16. GD-Link programmer programming options configuration
Click the "Target" dropdown menu and choose the "Connect" option. Check the "Output"
window for a message indicating "Connection successful." At the same time, the detailes

GD-Link V2 Adapter User Guide
19
information about the connected target chip, including its specific type are listed in the
"Properties" window. Refer to Figure 3-17. Connecting the target chip in GD-Link
Programmer for an illustration of GD-Link Programmer successfully connecting to the target
chip.
Figure 3-17. Connecting the target chip in GD-Link Programmer
Drag and drop the binary file, "xxx.bin" or the executable file "xxx.hex" into the GD-Link
Programmer software. When using the "xxx.bin" file for programming, a dialog will appear on
the host computer's software, prompting to enter the starting address for the download. After
entering the correct download address, click the "OK" button. Then, select the "Target"
dropdown menu and choose the "Program" option. The software will start downloading the
program to the target chip. Wait for the progress bar to reach 100%, and a message will
confirm the successful download, as shown in Figure 3-18. GD-Link Programmer burns
target chip.
Figure 3-18. GD-Link Programmer burns target chip

GD-Link V2 Adapter User Guide
20
3.2.3. Offline programming
Connect the USB interface of GD-Link V2 to the PC, and wait for LED2 to enter rapid blinking
mode. Open the GD-Link Programmer software. Click "GD-Link" menu bar and then choose
"Configuration" to configure the parameters of offline programming, referring to Figure 3-19.
GD-Link V2 offline download parameter configuration. The following configurations can
be performed using this interface:
Whether to enable read protection after offline programming completion.
Erase method selection: full chip erase or page erase.
Limit the number of offline programming downloads.
Click the "OK" button in the offline programming parameter configuration interface to save the
settings. After configuration, in the menu bar, click "GD-Link" and then "Update File" to enter
the file update interface. Referring to Figure 3-20. GD-Link V2 offline download file update
configuration. Select the specific part number of the target MCU, add the xxx.bin file, specify
the download address to the target chip, and click the "Update" button. Wait for the progress
bar to reach 100% to complete the file update, as shown in Figure 3-21. Offline download
file updated to GD-Link V2.
File updating supports one-time burning for BOOT+APP functionality. The user can continue
to click the "Add" button to add a second bin file, specify the burning address. The file update
allows to add a maximum of 8 bin files. The addition process is illustrated in Figure 3-22.
Simultaneously adding BOOT+APP offline download file update to GD-Link V2.
For GD32W515 series MCU, offline programming also supports option byte configuration.
When selecting the MCU part number as GD32W515 series MCU in the "GD-Link Update
File Configuration" window, click the "Configure OptionBytes" button. In the pop-up window,
perform the option byte configuration. After configuration, click the "OK" button to save the
relevant settings, as shown in Figure 3-23. Offline download configuration option byte
feature.
Figure 3-19. GD-Link V2 offline download parameter configuration
Table of contents