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
153 stars 24 forks source link

Cannot flash CH559 board, but WCHISP can do it. #9

Open agatti opened 3 years ago

agatti commented 3 years ago

Hello,

I seem to have a CH559 board with bootloader 2.31 that cannot be flashed using this program even though it can be flashed fine using the WCHISP tool under Windows. Using ch55xtool flashes fail with a verification error, although nothing gets written to the board.

Now, I've captured the USB traffic on Windows by WCHISP if that helps, along with the firmware I flashed - so you can eventually check what WCHISP is doing differently.

In the meantime is there anything I can do on my end to further debug the issue in ch55xtool?

Thanks!

firmware.bin.gz usb_flash.pcapng.gz

MarsTechHAN commented 3 years ago

Hi, so my suggestion would be use the Wireshark to capture the USB sequence with the ch55xtool with debug on, comparing the difference in what the official tools send, and paste here. I dont have a ch559 with btver2.31 by my hand, but I think they use the same protocol as other ch55x。

Pe3ucTop commented 2 years ago

I think this problem relay on wrong erase command, which erase only firs 8kb. Because of that verification after flashing could definitely fail for big programs. Problem was reported in #17 , there is first fix but probably not final.