My alpha Pico-based CH32V003 debug tool is ready for a few testers
github.com
github.com
My tool replaces the dongle and OpenOCD with a Pico-based GDB remote host. You can debug and flash a CH32V003 with just a Pico, one pull-up resistor, and gdb-multiarch.
Basic testing on the included example app seems to work, and the code should be stable enough to handle a few testers. If you're interested in the CH32V003 and have a Pico on hand, give it a try.
-Austin
Edit: any recommendations of a CH32V003 dev board?
For the benefits of others, these are the product pages on Aliexpress and Tindie:
https://www.aliexpress.us/item/3256804778040328.html
https://www.aliexpress.us/item/3256804801806865.html
https://www.tindie.com/products/adz1122/ch32v003-risc-v-mcu-...
I like that you've included a GDB server directly in the project, I've had way too much trouble getting a version of openocd that works properly for my pico projects, and now that's just cut out of the picture :)
AUD$20 https://www.ebay.com.au/itm/304645792686
https://github.com/openwch/ch32v307
RISC-V4F processor, max 144MHz system clock frequency;
Single-cycle multiplication and hardware division, hardware float point unit (FPU) ;
64KB SRAM,256KB Flash;
Supply voltage: 2.5V/3.3V, GPIO unit is supplied independently;
Multiple low-power modes: sleep/stop/standby;
Power-on/power-down reset (POR/PDR), programmable voltage detector (PVD);
2 general DMA controllers, 18 channels in total;
4 amplifiers;
Single true random number generator (TRNG)
2 x 12-bit DAC;
2-unit 16-channel 12-bit ADC, 16-channel TouchKey;
10 timers;
USB2.0 full-speed OTG interface;
USB2.0 high-speed host/device interface (built-in 480Mbps PHY)
3 USARTs, 5 UARTs;
2 CAN interfaces (2.0B active);
SDIO interface, FSMC interface, DVP;
2 x I2C, 3 x SPI, 2 x IIS;
80 I/O ports, can be mapped to 16 external interrupts;
CRC calculation unit, 96-bit unique chip ID;
Serial 2-wire debug interface;
Packages: LQFP64M, LQFP100.The AUD$20 is for the full dev board, the bare chip seems to be around US$3 [1]. I've never hand-soldered anything in LQFP-100, sounds exciting!
[1]: https://www.lcsc.com/products/Microcontroller-Units-MCUs-MPU...
But is there anything (besides time) stopping you from implementing this on top of e.g. linux gpio?
You don't usually ever need to bitbang with RP2040.
Jesus christ. Nevermind what I said, then.
Hardware (HDL for cheap FPGA like iCE40) might be helpful.
A port to other microcontrollers should also be possible. Ideally you'd use a CH32V003 to assist in debugging/programming a second one.
But Linux is out of the question. That's way too tight even for linux-rt. Keeping scheduling latency in the two digit microseconds is hard enough, and about as good as it gets.
... it might still be possible with Linux, but only by dedicating a core to the purpose, and making it otherwise unavailable to Linux. I believe that's how PiStorm works.
In any event, how much effort any of these would involve is worth considering for determining whether or not it is worth doing, vs spending the time improving the rest of the project.
I'm a bit confused, isn't the pi pico the "hardware" in this instance? An FPGA seems like extreme overkill for this when the Pico's PIO peripheral exists (which is what the OP is using).
Extreme overkill is good, particularly if it doesn't cost more money or use more power.
That specific family of FPGAs is optimized for low cost and low power.
RP2040 - 1x unit price = $0.70 iCE40 - 1x unit price = $2.50
I'm not sure if low power is necessarily a priority for a debug probe that's always hooked up to a computer, but the RP2040 seems competitive with power consumption. From what I can see in the datasheets, they're both on a 40nm process node.
I've never used the iCE40, is it easy to get a toolchain up and running for it? I haven't done any FPGA programming before but setting up the tooling always seemed more intimidating than using a standard C or Rust toolchain for a microcontroller.
I'd still opt for the RP2040 in this case.
RP2040 Datasheet - https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.p...
iCE40 Datasheet - https://www.latticesemi.com/~/media/LatticeSemi/Documents/Da...
I own a bunch of microcontroller devboards including the pico, and a bunch of fpga devboards including many iCE40 variants.