2023-05-07

Note: this entry was first published as a gist

CH32V Notes

The board "CH32V203C8T6-EVT-R0" is a bare minimum dev board with a ch32v203c8t6 MCU and a USB-C connector. It is useful to check out the ch32v platform in general.

First impression

I plugged it in via USB-C and nothing happened. No LEDs, no blinky. Thank you.

USB-C power

If you want to use a USB-C-to-USB-C cable (it has a USB-C connector, so this is probably the default), you need to manually assemble R22 and R23. They are the 5.1k pull-downs for the USB-PD CC lines. Thank you.

I have no idea why they would ever be marked as "NC" in the schematics. It makes absolutely no sense to me, because - in host mode they would not interfere with anything - in device mode they are REQUIRED by USB-C to have VBUS powered with 5V.

Problem solved, the board powers up and a red LED is on.

BOOT0 Pull-Up

The BOOT0-pin of the MCU is used to select whether to boot from flash or from system-memory, which is the bootloader. The "WCHISPTool_CMD Command Line Programming Tool Instruction" say that I can use USB to program the board. But somehow when I unplug the BOOT0-jumper and reset via S1, still no USB device is showing up. Thank you.

The problem is, that the BOOT0-pin doesn't have a pull-up resistor. You have to use a jumper cable to connect it to 3v3 (better use a 1k or something resistor). With the BOOT0-pin pulled-up, the board now shows up as ID 4348:55e0 WinChipHead. yay!

They should have used pull-down resistors to the board and buttons. Or jumpers in user-selected pull-up or pull-down configuration.

Actually programming

It's also possible to program a PlatformIO-blinky, by cloning, compiling and uploading:

# Only if you don't have platformio yet:
pip install platformio
# clone examples
git clone https://github.com/Community-PIO-CH32V/ch32-pio-projects.git
cd ch32-pio-projects/blinky-none-os
# add config for CH32Vx03_R0_1v0 board
cat - >> platformio.ini << EOF
[env:ch32v203c8t6_evt_r0]
board = ch32v203c8t6_evt_r0
upload_protocol = isp
EOF
# Upload the blinky app
pio run -t upload -e ch32v203c8t6_evt_r0

The LED should now... blink? But it doesn't.

LED connection

There are two user LEDs on the board, but none of them is connected to a GPIO. Thank you. You have to use another jumper from PA1 (used in the blinky example) to one of the LED pins (LED1 or LED2).

Now you should have a slowly blinking LED. yay!

Thoughts on the board

The board is cursed.

Another quirk that I found was the USB-A female connector on the second USB-port. It is weird, because the second USB-module in the IC only supports USB-device-mode. Have you ever seen a USB-Gadget with a USB-A female port? Now you have. Thank you.

Conclusion

It is functional, I'm going to use it for development, but the board is just poorly designed and
But to get there, you need jumpers and a soldering iron. That's not user friendly.

To be fair, the rest of the eco system is already very good for such a new mcu-family. I recommend using the platform so far and I am looking forward for lots of community effort to overcome these initial problems :)

Edits:

  • Changed the board name from "ch32vx03c-r0-1v0" to "CH32V203C8T6-EVT-R0", which seems to be the correct product name
  • Improved my conclusion to also point out the usefulness of the platform