frank-zago / isp55e0

An ISP flashing tool for the WCH CH55x, CH579, CH32F103 under linux
GNU General Public License v3.0
52 stars 18 forks source link

ch579m Write code flash failure at offset 0 #5

Closed nikitos1550 closed 1 year ago

nikitos1550 commented 1 year ago

Hello!

Faced strange issue, is it known one?

sudo tools/isp55e0/isp55e0 -d -f /home/nikita1550/CH579/sample/output/firmware.bin
Dump - request
a1 12 00 00 00 4d 43 55 20 49 53 50 20 26 20 57 
43 48 2e 43 4e 
Dump - response
a1 00 02 00 79 13 
Found device CH579
Dump - request
a7 02 00 1f 00 
Dump - response
a7 00 1a 00 1f 00 ff ff ff ff ff ff ff ff d0 ff 
ff 50 00 02 08 00 aa 34 23 26 3b 38 08 93 
Bootloader version 2.8.0
Unique chip ID aa-34-23-26-3b-38-08-93
Dump - request
a3 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 
Dump - response
a3 00 02 00 21 00 
Dump - request
a8 0e 00 07 00 ff ff ff ff ff ff ff ff d0 ff ff 
50 
Dump - response
a8 00 02 00 00 00 
Dump - request
a4 04 00 16 00 00 00 
Dump - response
a4 00 02 00 00 00 
Dump - request
a5 3d 00 00 00 00 00 00 35 b5 35 15 d4 34 35 ae 
d0 10 35 35 28 37 35 ae 35 35 35 35 35 35 35 ae 
35 35 35 35 35 35 35 ae 35 35 35 35 35 35 35 ae 
35 35 35 35 28 37 35 ae 35 35 35 35 35 35 35 ae 
Dump - response
a5 00 02 00 fe 00 
isp55e0: Write code flash failure at offset 0
Makefile:125: recipe for target 'flash' failed
make: *** [flash] Error 1
frank-zago commented 1 year ago

It's probably coming from one of the config bit, like write_protect. isp55e0 doesn't change them, as it doesn't really support them. write_config() touches the write protect bit, but it's not generic. The best option is probably to flash once with the WCH windows utility to clear whatever is blocking. Or set need_remove_wp to true for the ch579, and see if that works, with no guarantee you'll see the device again.

frank-zago commented 1 year ago

Issue fixed.