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

Missing chip data file after pipy installation #25

Closed kossnikita closed 2 years ago

kossnikita commented 2 years ago
Found CH552.
BTVER: V2.50.
Bootloader version not supported.
vowstar commented 2 years ago

The version on pipy is relatively old, please use the source code directly to support the version you mentioned. This tool has been tested to support versions 2.5, 2.6, 2.7 and higher, the version you reported is probably not the version in the current code. Please use branch https://github.com/MarsTechHAN/ch552tool/commit/master

kossnikita commented 2 years ago
PS D:\Keil\01-KeilExample\01-Blink\Objects> pip show ch55xtool
Name: ch55xtool
Version: 0.0.2
Summary: An open sourced python tool for flashing WCH CH55x series USB microcontroller
Home-page: https://github.com/MarsTechHAN/ch552tool
Author: Han Xiao
Author-email: hansh-sz@hotmail.com
License: UNKNOWN
Location: c:\python310\lib\site-packages
Requires: pyusb
Required-by:
PS D:\Keil\01-KeilExample\01-Blink\Objects> python -m ch55xtool -f .\Blink.hex
Chip ID: 52 is not known = not supported
Welcome to report this issue with a screen shot from the official CH5xx tool.

WCH tool log:

** User file name:D:\KEIL\01-KEILEXAMPLE\01-BLINK\OBJECTS\BLINK.HEX
** Download bytes:2744 B
User file HASH: B482ADA6A070DA0A5CE963F34EBD700635A46617
Via usb download CH552 firmware
Device No.65729464 is started to download
Jump to BOOT from the user area,configuration bits cannot be modified!
BTVER:02.50
UID:71-79-0-0-0-0-0
Erasing...
 complete
Programing...
 complete
Verifying...
complete
1#device device download is complete
Total download:1, 1 succeed, 0 failed
time used:0.908s
vowstar commented 2 years ago

Run pip install --upgrade ch55xtool and try again

kossnikita commented 2 years ago

Same again

PS D:\Keil\01-KeilExample\01-Blink\Objects> pip show ch55xtool
Name: ch55xtool
Version: 1.0.0
Summary: An open sourced python tool for flashing WCH CH55x series USB microcontroller
Home-page: https://github.com/MarsTechHAN/ch552tool
Author: Han Xiao
Author-email: hansh-sz@hotmail.com
License: UNKNOWN
Location: c:\python310\lib\site-packages
Requires: pyusb
Required-by:
PS D:\Keil\01-KeilExample\01-Blink\Objects> python -m ch55xtool -f .\Blink.hex
Chip ID: 52 is not known = not supported
Welcome to report this issue with a screen shot from the official CH5xx tool.
PS D:\Keil\01-KeilExample\01-Blink\Objects>
kossnikita commented 2 years ago

52 is id in HEX, but in the typeall.wcfg it is in DEC. Could there be a problem here?

vowstar commented 2 years ago

This is because the chip data file is missing after pipy is installed, so the installation from pipy cannot be programmed. https://github.com/MarsTechHAN/ch552tool/blob/master/ch55xtool/typeall.wcfg This is a bug in packaging.

vowstar commented 2 years ago

We have figured out the cause of this bug and repackaged v1.0.2. The new package will install two chip id configuration files, extended.wcfg and typeall.wcfg. This is not a hex conversion problem, but the file is not found. Run pip install --upgrade ch55xtool and try again

kossnikita commented 2 years ago

It's works! Thanks!

PS D:\Keil\01-KeilExample\01-Blink\Objects> python -m ch55xtool -f .\Blink.bin
Found CH552 with SubId:17
BTVER:02.50
UID:71-79-00-00-00-00-00-00
Erasing chip flash. Done.
Flashing chip. Done.
Finalize communication. Done.
Emiluren commented 1 year ago

Should perhaps this line: https://github.com/MarsTechHAN/ch552tool/blob/b9979e47b05498e6e2d1a614984f025db94766e8/ch55xtool/ch55xtool.py#L469 be changed to this?

pathname = os.path.dirname(__file__)

then ch55xtool would work as well as python3 -m ch55xtool.

vowstar commented 1 year ago

Should perhaps this line:

https://github.com/MarsTechHAN/ch552tool/blob/b9979e47b05498e6e2d1a614984f025db94766e8/ch55xtool/ch55xtool.py#L469

be changed to this?

pathname = os.path.dirname(__file__)

then ch55xtool would work as well as python3 -m ch55xtool.

Done https://github.com/MarsTechHAN/ch552tool/commit/e33ff9b09384bf40b496da39de2312ca57b38c1b.

Thanks a lot, this is a nice improvement.