Author Topic: Ways to automate programing and read protecting CH32V203  (Read 1228 times)

0 Members and 1 Guest are viewing this topic.

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
Ways to automate programing and read protecting CH32V203
« on: February 08, 2026, 04:02:32 pm »
My product is ready and I’m preparing for production programming.

The design is based on the CH32V203. I’m looking to automate the following steps on assembled PCBs using bash on Windows (e.g. Git Bash / WSL / scripts):

  • Disable read protection
  • Mass erase
  • Program firmware
  • Verify
  • Re-enable read protection
  • Reset and run the code

I'm using WCH-Link as debug adaptor
Any pointers to documentation, example scripts, or real-world experiences would be greatly appreciated.

Thanks!
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1928
  • Country: gb
Re: Ways to automate programing and read protecting CH32V203
« Reply #1 on: February 08, 2026, 04:50:17 pm »
https://github.com/ch32-rs/wlink/

Oh, also, one caveat though: you will need to change the driver of the WCH-Link from the WCH driver to WinUSB (using tool like Zadig), so this means you cannot switch back-and-forth between wlink and WCH tools at will.
« Last Edit: February 08, 2026, 04:53:44 pm by HwAoRrDk »
 

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
Re: Ways to automate programing and read protecting CH32V203
« Reply #2 on: February 09, 2026, 11:59:44 am »
Quote
Oh, also, one caveat though: you will need to change the driver of the WCH-Link from the WCH driver to WinUSB (using tool like Zadig), so this means you cannot switch back-and-forth between wlink and WCH tools at will.
Thanks for the feedback, do we yhave the option to not change to WinUSB?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1928
  • Country: gb
Re: Ways to automate programing and read protecting CH32V203
« Reply #3 on: February 09, 2026, 12:15:06 pm »
Looking at it again, I see (and remember) now that they say in the Readme that if you use the Windows 32-bit x86 build (as opposed to x64) wlink supposedly can utilise the "native" driver:

Quote
Windows native driver support, no need to install libusb manually (requires x86 build)

I've never tried it myself, however, so YMMV.

By the way, I would suggest using the latest Nightly build, not the last-released build, because that is quite old now.

And see also https://github.com/ch32-rs/wchisp for an ISP-mode tool by the same authors.
 

Offline az1

  • Regular Contributor
  • *
  • Posts: 61
  • Country: us
Re: Ways to automate programing and read protecting CH32V203
« Reply #4 on: February 09, 2026, 11:44:41 pm »
probe-rs should have some WCH-link support, but doesn't list the CH32v2.  For Cortex-M target probe-rs brings along a lot of nice to haves like RTT and DAP.  Dunno how mature the RISC-V support is but if you're willing to hack on it a bit it's worth a look.

https://probe.rs/targets/?q=CH32%2C&p=0
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->