cnlohr/ch32fun
FreeOpen source minimal stack for the ch32 and ch5xx WCH RISC-V Microcontrollers
About cnlohr/ch32fun
ch32fun is an open-source, minimal development environment for the CH32V003 and many other RISC-V microcontrollers from WCH (including CH32 and CH5xx series). It provides a lightweight alternative to WCH's official HAL and EVT, enabling direct use of the Technical Reference Manual (TRM) for efficient, compact code. The project includes tooling (GCC-RISC-V toolchain), headers, examples, a cross-platform programmer called minichlink (using libusb), gdbserver debugging support, and fast printf-over-single-wire debug output. It supports Windows, Linux, and WSL, and aims to avoid complex HALs, making it ideal for resource-constrained embedded development. Blinky can be as small as 500 bytes. The repository also offers support for various programmer interfaces and a wiki for setup instructions.
Key Features
Pros & Cons
- Extremely lightweight – blinky example only 500 bytes
- Avoids heavy HAL, giving direct hardware control
- Cross-platform support (Windows, Linux, WSL)
- Fast debug printf (36 kB/s) over single-wire interface
- Supports a wide range of WCH RISC-V chips
- Open source and community-driven
- Includes multiple programmer options and gdbserver debugging
- Limited number of examples compared to official HAL
- GDB debugging fully tested primarily on CH32V003; limited on other processors
- Support for obscure chips (e.g., CH32M030, CH641) reported but not thoroughly tested
- Requires familiarity with TRM and register-level programming