Nuclei-Software / nuclei-dlink

DLink: RISC-V Debugger Firmware based on rvlink
Other
5 stars 1 forks source link
nmsis nuclei-sdk riscv-debug rvlink

DLink

Nuclei System Technology made a riscv debugger called dlink based on rv-link, it provided more features than rv-link. For details, please check DLink Documentation.

Documentation below is not suitable for dlink project, please follow above documentation.

RV-Link

Travis Build Status GitLab Build Status

A JTAG emulator/debugger for RISC-V micro-controllers that runs on a RISC-V development board (Sipeed Longan Nano for example).

JTAG emulators are the "umbilical cord" between PC software tools and MCU/DSP boards during development. Typically connecting to the host PC via parallel port or USB port, the JTAG emulator provides a standard, simple way to give the development tool software a direct connection to one or more MCU/DSP devices on the target board.

Like Blackmagic, but designed for RISC-V.

This project is based on the work of Zoomdy's RV-LINK project and is originally forked from the repository at https://gitee.com/zoomdy/RV-LINK.

Description

The goal of the RV-Link project is to provide the firmware needed to turn a RISC-V development board into a RISC-V emulator, but the RV-Link project does not include any hardware. Currently the RV-Link firmware runs on the boards listed below. The firmware can be loaded into the board using the dfu or serial uploading feature of its boot-loader, or if available, a JTAG emulator (which in turn could be a RV-Link ;-) ).

Different from other emulators: the RV-Link directly interacts with GDB through the USB serial port, and does not require an intermediary such as OpenOCD.

The development boards that can be used as emulators are:

RISC-V MCU that RV-Link can debug:

Using RV-Link

Using with Nuclei SDK

  1. Clone Nuclei SDK source code
  2. export NUCLEI_SDK_ROOT=/path/to/nuclei-sdk
  3. Build just like a nuclei sdk application

This application can run on rv-star, but not functional, please check!!!

Other notes

The RV-Link firmware provides the following features when connected to a RISC-V target:

More resources

Building from source

This project currently only supports the PlatformIO build system, so you will need to install PlatformIO.

Run the following commands to build all firmware variants and upload the RV-Link firmware to e.g. the Sipeed Longan Nano RISC-V development board:

$ pio run
$ pio run -e sipeed-longan-nano -t upload

Wiring the RV-Link to a RISC-V target development board

The pins that are used for the JTAG/TAP hardware interface are configured during the build (determined by platformio.ini and link-config.h) and are as following:

Optionally, the serial interface of the RV-Link can be cross-connected to an UART of the target board.

Note

When the JTAG pins are not properly connected, it is very likely that you will see the following output:

  (gdb) target remote /dev/ttyACM0
  Remote debugging using /dev/ttyACM0
  Remote replied unexpectedly to 'vMustReplyEmpty': 
  RV-LINK ERROR: the target is not connected!
  RV-LINK v0.2: Longan Nano, configed for GD32VF103 family.

If so, check your wiring, optionally add series resistors (of e.g. 100Ohm) in each JTAG signal wire at the RV-Link.

A wiring example

Here is an example of a Sipeed Longan Nano running the RV-Link firmware (env:sipeed-longan-nano) that is debugging a Sipeed Longan Nano running the RV-Link firmware (env:rvl-probe) that is debugging a third Sipeed Longan Nano running a blink application...

Suggested improvements

This project aims to improve the original RV-LINK firmware with the following features:

Download firmware files

Notes

This repository originally based on the RV-LINK project of Zoomdy and was forked from the repository at https://gitee.com/zoomdy/RV-LINK at the v0.2.1 tag. It is mirrored to GitHub and Gitee.