Skip to main content

Programming Tool for WCH-LinkE and CH32Vxxx and CH32Xxxx

Project description

rvprog - Programming Tool for WCH-LinkE and CH32Vxxx and CH32Xxxx

Description

With this tool, the WCH RISC-V microcontrollers CH32Vxxx and CH32Xxxx can be programmed with the WCH-LinkE (pay attention to the "E" in the name) via its serial debug interface.

Preparations

To use the WCH-Link on Linux, you need to grant access permissions beforehand by executing the following commands:

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="1a86", ATTR{idProduct}=="8010", MODE="666"' | sudo tee /etc/udev/rules.d/99-WCH-LinkE.rules
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="1a86", ATTR{idProduct}=="8012", MODE="666"' | sudo tee -a /etc/udev/rules.d/99-WCH-LinkE.rules
sudo udevadm control --reload-rules

On Windows, if you need to you can install the WinUSB driver over the WCH interface 1 using the Zadig Tool.

Installation

pip install rvprog

Usage

To upload firmware, you should make the following connections to the WCH-LinkE (SWCLK is not present on the CH32V003 and therefore does not need to be connected):

WCH-LinkE       CH32V/X
+-------+      +-------+
|  SWCLK| ---> |SWCLK  |
|  SWDIO| <--> |SWDIO  |
|    GND| ---> |GND    |
|    3V3| ---> |VDD    |
+-------+      +-------+

If the blue LED on the WCH-LinkE remains illuminated once it is connected to the USB port, it means that the device is currently in ARM mode and must be switched to RISC-V mode initially. There are a few ways to accomplish this:

  • You can utilize the rvprog tool with the -v option (see below).
  • Alternatively, you can select "WCH-LinkRV" in the software provided by WCH, such as MounRiver Studio or WCH-LinkUtility.
  • Another option is to hold down the ModeS button on the device while plugging it into the USB port.

More information can be found in the WCH-Link User Manual.

Usage: rvprog [-h] [-a] [-v] [-b] [-u] [-l] [-e] [-G] [-R] [-f FLASH]

Optional arguments:
  -h, --help                show help message and exit
  -a, --armmode             switch WCH-Link to ARM mode
  -v, --rvmode              switch WCH-Link to RISC-V mode
  -b, --unbrick             unbrick chip
  -u, --unlock              unlock chip (remove read protection)
  -l, --lock                lock chip (set read protection)
  -e, --erase               perform a whole chip erase
  -G, --pingpio             make nRST pin a GPIO pin (CH32V003 only)
  -R, --pinreset            make nRST pin a reset pin (CH32V003 only)
  -f FLASH, --flash FLASH   write BIN file to flash

Example:
rvprog -f firmware.bin

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rvprog-1.5.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

rvprog-1.5.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file rvprog-1.5.0.tar.gz.

File metadata

  • Download URL: rvprog-1.5.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for rvprog-1.5.0.tar.gz
Algorithm Hash digest
SHA256 8c0927d3b849b03fd5219024dfa3d7e9f9b8cc17349bc4e2df02c08192ae5881
MD5 92bad77545638678fb68215d51e88fc9
BLAKE2b-256 65d1243e5bfa320c37938df066b6bab43e6284d72109d815d01071acabac4d13

See more details on using hashes here.

File details

Details for the file rvprog-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: rvprog-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for rvprog-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0c6fe71a1bb960718032298533c1269ce4227aa6a2a2d06b4cdac2c45113bc
MD5 cfbf76676ff41fdcac4a4aa0dcf5e068
BLAKE2b-256 09f41d786b4161eedbc627ea5f4f08b368db55034dd079eabc85fe0b816eaf8f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page