How to flash and debug with JTAG - starfive-tech/edk2 GitHub Wiki
Start TeraTerm
- Download Tera Term with this link
- Setup Tera Term:


Connect JTAG According to Table 1 Below
Table 1: JTAG Pin Connection
| JTAG Pins | 40-Pin Number | VisionFive2 (JH7110) |
|---|---|---|
| JTAG TDO | 40 | GPIO44 |
| JTAG TCK | 37 | GPIO60 |
| JTAG TDI | 38 | GPIO61 |
| JTAG TMS | 35 | GPIO63 |
| JTAG TRSTN | 36 | GPIO36 |
Debugger used "Olimex Tiny-H"
Create U-Boot SPL for debugging
- Download and unzip "debug_tools.zip" from here
- Apply "0001-U-Boot_SPL_debug.patch" patch into U-Boot project
cd <uboot project folder>
git apply < 0001-U-Boot_SPL_debug.patch
- Recompile U-Boot SPL (can refer here)
- Flash U-Boot SPL into the boot device of your choice (SD Card, QSPI Flash, or eMMC)
- Select the boot device (refer to here)
- Power up the board and TeraTerm will display the following message:
Connect to VisionFive 2
- Download and unzip "debug_tools.zip" from here
- Copy JH7110.fd to the same folder as debug_tools
- Launch the terminal and run OpenOCD
./openocd.exe -f VisionFive2_JTAG.cfg
if you meet error(s) when running the above command. Please check if "ftdi serial" is set correctly
- Run "riscv64-unknown-elf-gdb.exe"
target remote: 3333
set $pc=0x40000000
c
Refer here for GDB basic commands