This guide works for the VisionFive2 board (rev. 1.3B) and Oilmex ARM USB Tiny H JTAG-debugger.
- Download the FTDI drivers and USB drivers for the Olimex debugger from the official site:
- Install these drivers via the Device Manager.
- Create a debug version of U-Boot SPL.
- Flash this debug version on the board boot device (for further instructions on how to do that refer to the official documentation).
- Ensure that the Olimex OpenOCD JTAG ARM-USB-TINY-H debugger appears in your OS.
- Ideally, it should have a serial number of
OL9DF5D8, although this might not always be the case.
Here's a useful table for the pin layout between the debugger and the VisionFive 2 board:
| Pin | Board Pin | Debugger Pin |
|---|---|---|
| TCK | 37 | 9 |
| TMS | 35 | 7 |
| TDI | 38 | 5 |
| TDO | 40 | 13 |
| RST_N | 36 | 3 |
| GND | 39 | 20 |
| VREF | 1/17 | 1 |
Note: First pin on the debugger corresponds to a red stripe on the extender.
- Download OpenOCD with a JH7110 configuration:
- You can find it here.
- Alternatively, install the full Freedom Studio suite, which includes OpenOCD.
- In the
.cfgfile, comment out the line#ftdi serial "OL9DF5D8"if the serial doesn't show up in the USB list.
-
Run the following command in PowerShell to check the USB devices:
Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | ForEach-Object { $device = $_ $vidMatch = $device.InstanceId -match 'VID_([0-9A-F]{4})' | Out-Null $vidValue = $matches[1] $pidMatch = $device.InstanceId -match 'PID_([0-9A-F]{4})' | Out-Null $pidValue = $matches[1] $serialNumber = (Get-WmiObject Win32_PnPEntity | Where-Object { $_.DeviceID -eq $device.InstanceId }).SerialNumber [PSCustomObject]@{ DeviceDescription = $device.FriendlyName VID = $vidValue PID = $pidValue SerialNumber = $serialNumber } }
-
If everything is set up correctly, run OpenOCD with the .cfg file as an argument:
.\openocd.exe -f openocd.cfg
Note: connecting the debugger in this way will halt the execution of the program.
-
A successful output should resemble the following:
Open On-Chip Debugger 0.10.0+dev (SiFive OpenOCD 0.10.0-2020.04.6) ... Info : Listening on port 3333 for gdb connections Ready for Remote Connections Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections
-
Now you can run gdb and connect to the board via
target extended-remote :3333.