MarsTechHAN / ch552tool

An open sourced python tool for flashing WCH CH55x series USB microcontroller with bootloader v2.30, v2.31 & v2.40.
GNU General Public License v3.0
159 stars 24 forks source link
ch551 ch552 ch553 ch554 ch559 flashtool microcontroller usb wch winchiphead

ch55xtool

Now available on pypi

An open sourced python command line flash tool for flashing WinChipHead CH55x series 8051 USB micro controllers, including CH551, CH552, CH553, CH554, CH559, CH569 (including CH56x), etc. with bootloader version(BTV) above 2.30 (including 2.30, 2.31, 2.40, 2.71), etc. (You can check the verision by using the official CH55x Tool.)

Usage

.. code:: bash

python3 -m ch55xtool -f THE_BINARY_FILE.bin

Tool Setup

.. code:: bash

python3 -mpip install ch55xtool

..

For Mac OS, you need to install both libusb and pyusb.

.. code:: bash

If you dont have brew installed.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install libusb python3 -mpip install ch55xtool

FAQ

..

On windows, this means you dont a valid libusb device, see the guide above. For other system, you might dont have the libusb installed, follow the guide above.

..

Pyusb unable to fine the device with given PID&VID. Maybe you dont power on your device, or it is not in DFU mode.

..

This high probability is a permission issue. Add SUBSYSTEM=="usb", ATTRS{idVendor}=="4348", MODE="0666" to /etc/udev/rules.d/50-ch55x.rules, and re-plug your device. Otherwise you need sudo.

..

I never met with those problems on a working CH552. Checking the power, the previliage, and praying may help.

..

The program dont support BTVER lower than 2.30(welcome PR, but since they are too old, I dont have plan to support them). Or maybe they have a newer verison, for this situlation, it is welcome for you to open an issue.