Skip to content

Repository files navigation

YBLINK HPM5301 Firmware

Chinese: README.zh.md.

Yet Better Link(YBLINK) is a pure-Rust CMSIS-DAP v2 probe firmware for HPM5301. The stable build uses USB high speed, FGPIO bit-banged SWD/JTAG, and a CDC ACM USB-to-UART bridge.

Current stable USB identity:

Field Value
VID:PID 1209:5301
Product YBLINK CMSIS-DAP
Serial YBLINK
Firmware version 0.1.0

Pin Map

The firmware drives the HPM5301EVKLite J3 GPIO header. The target board must be powered normally and must share ground with YBLINK.

SWD

YBLINK signal HPM5301 pin J3 pin Target signal
SWCLK PA27 23 SWCLK
SWDIO PA28 21 SWDIO
nRESET PB10 26 NRST
GND GND 25/30/34/39 GND

Leave PA26 and PA29 disconnected for normal SWD.

JTAG

YBLINK signal HPM5301 pin J3 pin Target signal
TCK PA27 23 TCK
TMS PA28 21 TMS
TDI PA29 19 TDI
TDO PA26 24 TDO
nRESET PB10 26 NRST
GND GND 25/30/34/39 GND

Serial Bridge

YBLINK signal HPM5301 pin J3 pin External signal
UART0 TXD PA00 36 Target RXD
UART0 RXD PA01 38 Target TXD
GND GND 25/30/34/39 GND

For a loopback smoke test, connect PA00/J3-36 directly to PA01/J3-38.

Build

cargo build -p yblink --release

Customized Board

A customized board is also hand-soldered and tested ok, and you can find the sch, pcb and gerber file in hardware_altium_project directory. The five vias are for flashing the firmware(left to the right order: TMS, TCK, TDI, TDO, TRST).

Fresh Clone Build Steps

Install the Rust RISC-V target once:

rustup target add riscv32imafc-unknown-none-elf

Build the release firmware:

cargo build -p yblink --release

The output ELF is:

target/riscv32imafc-unknown-none-elf/release/yblink

Flash it with an external probe:

probe-rs download --chip HPM5301 --protocol jtag target/riscv32imafc-unknown-none-elf/release/yblink

Just Flash

A prebuilt firmware is firmware/yblink, you can use probe-rs to download it.

About

YBLINK is a pure Rust DAPLink-compatible firmware running on the HPM5301IEG1 RISC-V microcontroller. It provides support for both SWD and JTAG debugging and programming interfaces. Feel free to issue, and PR is welcomed. 基于HPM5301IEG1制作的DAP-Link,支持SWD和JTAG,附带SWD指示灯,纯Rust固件。

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages