An open-source command line flasher program and SDK library for WCH(Nanjing QinHeng Corp.)'s CH55x family. Our Wiki contains a lot of useful tips, it's worth to check out!
The CH55x is a series of 8051 microcontroller with dedicated USB peripheral. CH553/CH554 can be programmed as a USB host. The cheapest one, CH551 only costs 1.5 CNY in retail. It is the ultimate and ideal solution for many low-end USB applications.
Up to now, we have tested out CH551 and CH554, all functions work fine except option byte.
If someone want to help me, please start, fork and support more chips, Thanks!
Implement chip programming via UART for devices workign on USB Host mode. (It is very simple to realize: just add serial port interface to the program and 0x619e, accumulate checksum in packet tail).
Implement new CH55x ISP protocol (for bootloader version > 2.30), for now we don't have any chip shipped with the new bootloader: WCH's FAE said that they will release chips with new bootloader after Apr.2018.
Contributions are always welcome
Command Line Parameters
- -f <filename> Erase the code flash and download binary codes to CH55x, note that this tool only accepts
.hexfiles will not be accepted. The Eclipse SDCC environment with the setup described in our wiki automatically generates
.binfile. To convert a hex file to bin file, on Linux, use
objdump, on Windows, use
- -g Execute the user program after downloading
- -e Erase chip only
- -D <filename> Read data flash to a file
- -d <filename> Write the content of a file to data flash
- -h Display help message
For Linux Users
- Build: Type
usbispdirectory, you can also pass DESTDIR to the script to set installation path.
- Linux does not require a specific driver for this program.
For Windows Users
- The Tool pack for Windows is available here.
- The wiki page "Setup SDCC developing environment with Eclipse" demonstrates how to setup an IDE for better code editing.
- On Windows, CH554 ISP mode requires a libusb driver implementation to enable direct device access for librech551.
- Connect your CH55x to one of USB ports on your PC, make sure the MCU enters ISP mode.
- Launch zadig (included in
Optionsmenu and click
List All Devices, you should be able to find your CH55x (Usually names
USB Module), optionally you can change its name by check the
- Double check that the USB ID is correct, USB ID is VID plus PID, for CH554, the USB ID is
Install Driver, quit Zadig after driver installation.
- Note: due to unknown reason, sometimes the
libusbKdriver won't work on some machine with very new USB 3.1 controller. If your PC can not recognize the USB ISP device, try
- Generate EXE file for Microsoft Windows requires Microsoft Visual Studio 2017 and Windows Kits 10.0.15063.0 or above. If your system does not meet the stated requirement, go to Microsoft's website and download the installer for Microsoft Visual Studio 2017 Community Version.
- It is possible to compile the source with legacy Visual Studio although it is not officially supported.
- Download the entire repository and unzip to anywhere you like
- Navigate to
msvcfolder and create a folder called
- Go to https://github.com/libusb/libusb/releases to get the latest stable binary snapshots of libusb(e.g. libusb v1.0.21), download the file with extension
tar.bz, then unzip it to
msvc\libusb. Now your
msvc\libusbshould contain at least these folders :
msvc\librech551.slnand choose your targeting platform (e.g. Release x64), then start compiling.
- (Windows version only) To remove VC runtime dependency, releases on Github release page is built on Visual C++ together with