A CH32 RISC-V programmer using the RP2040 PIO to implement the Single-Wire I/O (SWIO) protocol. Works with minichlink from the ch32fun toolchain.
- Uses RP2040 PIO state machines for accurate SWIO timing
- Works with minichlink over serial (Ardulink protocol)
- Configurable SWIO GPIO pin
- Tested with CH32V003
Connect the SWIO pin to your CH32 target through a 1KΩ pull-up resistor to 3.3V:
VCC (3.3V)
│
┌┤
1KΩ
└┤
│
RP2040 ──────┼────── SWIO (CH32)
GPIO │
GND
The SWIO pin is configurable in src/main.cpp:
#define SWIO_PIN 29Any GPIO can be used — just change the define and rebuild.
Connect the programmer via USB, then:
minichlink -c /dev/ttyACM0 -bExpected output on a CH32V003:
VID:0x1209, PID:0xb003
Opening serial port /dev/ttyACM0 at 115200 baud.
Ardulink: synced.
Found Ardulink Programmer
Ardulink: target power 1
Interface Setup
Detected CH32V003
Flash Storage: 16 kB
Part UUID: 3d-a4-ab-cd-a5-b2-bc-41
Part Type: 00-30-05-00
Read protection: disabled
This test firmware is blinking in PIN D4.
minichlink -c /dev/ttyACM0 -w Test/blink.bin 0x08000000 -bOutput :
WARNING: You are not in the plugdev/dialout group, the canned udev rules will not work on your system.
VID:0x1209, PID:0xb003
Opening serial port /dev/ttyACM0 at 115200 baud.
Ardulink: synced.
Found Ardulink Programmer
Ardulink: target power 1
Interface Setup
Detected CH32V003
Flash Storage: 16 kB
Part UUID: 3d-a4-ab-cd-a5-b2-bc-41
Part Type: 00-30-05-00
Read protection: disabled
Detecting Memory Area
Writing image
Image written.