SWIO program/debug for CH32V003

Good timing!

Binary mode is progressing quickly. There is a system for implementing multiple binary mode interfaces now. This would be a good way to test it out!

I ported this arduino programmer (debugger?) from CH32 fun project. It is super simple, so a good starting point. Select this interface from the new configuration menu → select binary mode option.

This is currently on the binmode branch. A few notes for debugging:

This is a simple interface with bit-banged IO. You’ll need an in-line 1K resistor I guess because there is bus contention as part of the protocol.

I don’t have a working toolchain for CH32 fun, so I can’t immediately work out the bugs. If anyone wants to take a stab at tweaking the timings, please do.

Once there is a proof of concept (test bed), I will update it to use the PIO program from this project, instead of bit banging.

Edit:

  • The power supply enables at 5volts because that is what the arduino program supplies.
  • Not 100% sure I’m acting on the right direction of RTS for reset here.