cnlohr/ch32v003fun logo

cnlohr/ch32v003fun

Free

Open source minimal stack for the ch32 line of WCH processors, including the ch32v003, a 10¢ 48 MHz RISC-V Microcontroller - as well as many other chips within the ch32v/x line.

FreeFree tier
Type
Open Source

About cnlohr/ch32v003fun

An open source development environment providing tooling, headers, and examples for the CH32V003 and many other WCH RISC-V microcontrollers. It offers a minimal, HAL-free approach that works on Windows (Native), Linux, and WSL. The CH32V003 is a 10-cent RISC-V EC core running at 48MHz with 16kB flash and 2kB RAM. The project includes a lightweight blinky example of only 500 bytes, fast printf debugging over the programming interface at ~36kBytes/s, support for multiple programmers (minichlink, STM32F042, ESP32S2, etc.), gdbserver debugging, and a bootloader. It also supports a wide range of WCH chips including the ch32x035, ch32v002–ch32v307, and ch5xx series.

Key Features

Cross-platform support: Windows (Native), Linux, and WSL
Minimal, HAL-free development using only the TRM
Fast printf debugging over the programming interface (~36kBytes/s)
Multiple programmer support: minichlink, STM32F042 NHC-Link042, ESP32S2 funprog, WCH Link-E, Arduino-based Ardulink, and rv003usb SWDIO
GDB server-style debugging for use with Visual Studio
printf-over-single-wire at approximately 400kBaud
Built-in USB ISP bootloader for all WCH chips with USB peripheral
Support for a wide range of WCH chips: CH32V003, CH32X035, CH32V002–CH32V307, CH32V203, CH32V208, CH32V303, CH32V305, CH32V307, CH570–CH592, and others
Small code size – blinky example only 500 bytes

Pros & Cons

Pros
  • Free and open source with no licensing costs
  • Very small code footprint compared to official HAL
  • Fast and efficient printf debugging over the programming interface
  • Works across major operating systems without vendor lock-in
  • Supports a large number of WCH microcontroller families
Cons
  • Fewer example projects compared to the official WCH EVT/HAL
  • Requires knowledge of RISC-V architecture and direct register programming
  • Limited community support compared to more mainstream platforms like Arduino

Best For

Embedded systems development with WCH RISC-V microcontrollersHobbyist and educational projects using cheap microcontrollersReplacing heavy HAL-based development with lightweight, direct register accessRapid prototyping and debugging of microcontroller firmware

FAQ

Which microcontrollers are supported?
Currently supports CH32V003, CH32X035, CH32V002–CH32V007, CH32V103, CH32V203, CH32V208, CH32V303, CH32V305, CH32V307, and CH570–CH592 series. Some obscure chips like CH32M030, CH641, CH643, and CH645 may also work.
How do I get started?
For installation and setup instructions, see the project's wiki page linked in the repository.
What is the advantage over the official WCH EVT?
The official EVT is large and uses a heavy HAL. ch32fun avoids the HAL, making code smaller (blinky is only 500 bytes), boots faster, and allows direct use of the TRM for more efficient development.