`longan-nano` logo

`longan-nano`

Free

Board support package for the [Longan Nano board](https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V-GD32VF103CBT6-Development-Board-p-4205.html)

FreeFree tier
Type
Open Source

About `longan-nano`

The longan-nano crate is a board support package (BSP) for the Sipeed Longan Nano development board, which features the RISC‑V GD32VF103CBT6 microcontroller. Written in Rust, it provides a hardware abstraction layer, examples (e.g., blinky and LCD demos), and support for multiple flashing and debugging methods including DFU (via dfu‑util), OpenOCD, and RV‑Link. The project includes setup instructions for the RISC‑V Rust target and toolchain, making it a starting point for embedded Rust development on RISC‑V.

Key Features

Supports the GD32VF103CBT6 RISC‑V microcontroller
Rust‑based embedded development on a RISC‑V target
Multiple flashing methods: DFU (dfu‑util), OpenOCD, RV‑Link
Includes example projects such as blinky and LCD display
Works with the `riscv32imac-unknown-none-elf` Rust target
Documented setup for both manual and prebuilt RISC‑V toolchains

Pros & Cons

Pros
  • Fully open source and community‑maintained under the riscv‑rust organization
  • Multiple flashing/debugging options without requiring a JTAG adapter (DFU via USB‑C)
  • Well‑structured with clear getting‑started instructions and example code
  • Leverages Rust’s safety and ecosystem for embedded development
Cons
  • Only supports the Longan Nano (GD32VF103CBT6) board
  • Requires manual setup of the RISC‑V Rust target and toolchain
  • Some GD32VF103 chips have a bootloader bug that requires an updated dfu‑util
  • Limited to the features provided by the specific microcontroller

Best For

Embedded Rust development on RISC‑V hardwarePrototyping IoT or peripheral‑driven applications with the Longan NanoLearning RISC‑V and embedded systems programming in Rust

FAQ

What is the page size issue when flashing with dfu‑util?
Some versions of the GD32VF103 chip ship with a buggy bootloader that reports incorrect parameters. As of May 2020, using an up‑to‑date version of dfu‑util (from the git repository) contains a workaround that fixes the page size to 1024 bytes.