tanakamasayuki’s feed points to ch32fun, an open source development environment published on GitHub by the CH32 RISC-V User Group. It’s tooling, headers and examples for the CH32V003 and many other WCH RISC-V chips, built with gcc-riscv64 on Windows, Linux or WSL. The CH32V003 is a 10 cent part with a RISC-V core at 48MHz, 16kB of flash and 2kB of RAM, in SOP-8, QFN-20 and SOIC packages.
The idea is to skip the hardware abstraction layer and write to the registers in the reference manual. A blink example compiles to about 500 bytes and boots quickly. Support covers the ch32x035, several ch32v00x and ch32v2xx/3xx parts, and recently the ch570 through ch592 ch5xx chips.
Flashing and debugging go through minichlink, which writes at around 36kBytes/sec and includes a gdbserver that works with gdb-multiarch and Visual Studio Code. There’s a debugprintf example, and calling SetupDebugPrintf() enables printf.…