Turn your RP2040 into ch32v003 flasher/debugger. Based on project aappleby/picorvd (see links below).
- pico-sdk
PICO_SDK_PATH
environment variable- FreeRTOS Kernel
git clone https://github.com/FreeRTOS/FreeRTOS-Kernel --recurse-submodules
FREERTOS_KERNEL_PATH
environment variable (optional)
- Connect pin PD1 on your CH32V device to the Pico's SWIO pin (defaults to pin GP5), connect CH32V ground to Pico ground, and add a 1Kohm pull-up resistor from SWIO to +3.3v.
- Build debugger.
mkdir build
(cd build && cmake .. && make pico_rvd)
- Flash it to pico.
Copy build/pico_rvd.uf2
to RPI-RP2
or run command
(cd build && make pico_rvd---deploy)
Steps 1 and 2 required only once.
- Build ch32v003 blink example and flash it.
(cd examples/blink && make)
Pico detects as two ttyACMx devices. First one is debugger console. Connect via
minicom -D /dev/ttyACM0
or
tio /dev/ttyACM0
and type "help" to get list of commands.