Skip to main content

USB Programming Tool for WCH Microcontrollers

Description

With this tool, almost all WCH microcontrollers (CH5xx, CH6xx, CH32Fxxx, CH32Vxxx, CH32Xxxx, and CH32Lxxx) which have a factory-builtin bootloader (v2.x.x) can be flashed via USB.

Preparations

On Linux you do not need to install a driver for the USB bootloader. However, by default Linux will not expose enough permission to upload your code. In order to fix this, open a terminal and run the following commands:

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="4348", ATTR{idProduct}=="55e0", MODE="666"' | sudo tee /etc/udev/rules.d/99-ch55x.rules
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="1a86", ATTR{idProduct}=="55e0", MODE="666"' | sudo tee -a /etc/udev/rules.d/99-ch55x.rules
sudo udevadm control --reload-rules

For Windows, you need the CH372 driver. Alternatively, you can also use the Zadig tool to install the correct driver. Here, click "Options" -> "List All Devices" and select the USB module. Then install the libusb-win32 driver. To do this, the board must be connected and the microcontroller must be in bootloader mode.

Installation

Ensure that the prerequisites for installing Python packages are met. Then execute the following command in the command line:

pip install chprog

Usage

The bootloader must be started manually for new uploads. To do this, the board must first be disconnected from the USB port and all voltage sources. Now press the BOOT button and keep it pressed while reconnecting the board to the USB port of your PC. The chip now starts in bootloader mode, the BOOT button can be released and new firmware can be uploaded via USB. Alternatively, you can leave the board connected to the USB port, press and hold the BOOT button, press and release the RESET button and then release the BOOT button to enter the bootloader mode. If there is no BOOT button on the board, look at the datasheet to find out which pin needs to be pulled to which voltage level for the microcontroller to go into boot mode.

Now run the following command (example):

chprog firmware.bin

Links

Metadata

Release files for chprog 2.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chprog 2.5.3
File Size Uploaded
chprog-2.5.3.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chprog 2.5.3
File Interpreter ABI Platform
chprog-2.5.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / chprog-2.5.3.tar.gz

Download URL chprog-2.5.3.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37291e06f79cc139148cf5a85508686bb5223e8dda91c8ba86e9f097f3173c22
BLAKE2b-256 checksum
How to use checksums
30b89d2121442bd4a1c20d7cfd05284b3fa352f41b5b6e76cd5a45b4a7048cb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / chprog-2.5.3-py3-none-any.whl

Download URL chprog-2.5.3-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4d6663d0fc1ab570aa8b8e991bcae442dfc13cb130d85053d1cc610b8935fc1
BLAKE2b-256 checksum
How to use checksums
42f864b74724aa6a0353b11a23e2586e9e7b5c3d9824342d8e19707807729189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

2.5.3 This release

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page