Closed HookeLiu closed 1 year ago
After I tried many USB-TTL devices, I got success. (the same PC and STC board environment )
With USB device: USB-SERIAL CH340 (COM5) USB\VID_1A86&PID_7523\5&5A64A5B&0&1 CH341SER_A64
python -m stcgal -p COM5 -P stc15 -D .pio\build\stc15w4k48s4\firmware.hex
Waiting for MCU, please cycle power: <- Packet data: 46 B9 68 00 34 50 8B BF 68 8B F7 BC 9F 00 A8 FC F0 FD 26 D8 80 00 73 54 00 F5 27 07 06 70 8B 02 17 1C 1F 22 24 00 EC C0 04 E6 EC 6B BF FF FF 20 07 14 80 15
74 16
done
Target model:
Name: STC15W4K48S4
Magic: F527
Code flash: 48.0 KB
EEPROM flash: 11.0 KB
Target frequency: 11.075 MHz
Target BSL version: 7.3.7T
Target wakeup frequency: 35.775 KHz
Target options:
reset_pin_enabled=False
clock_source=internal
clock_gain=high
watchdog_por_enabled=False
watchdog_stop_idle=True
watchdog_prescale=256
low_voltage_reset=True
low_voltage_threshold=4
eeprom_lvd_inhibit=True
eeprom_erase_enabled=False
bsl_pindetect_enabled=False
por_reset_delay=long
rstout_por_state=high
uart2_passthrough=False
uart2_pin_mode=normal
cpu_core_voltage=unknown
Loading flash: 165 bytes (Intel HEX)
Trimming frequency: -> Packet data: 46 B9 6A 00 20 00 0C 00 C0 80 C0 FF C0 00 80 80 80 FF 80 00 40 80 40 FF 40 00 00 80 00 C0 00 0A D3 16
<- Packet data: 46 B9 68 00 20 00 0C 0D 1A 12 D3 18 96 1A 76 25 D4 31 19 35 C4 4B D6 60 EE 53 D8 74 7B 83 F3 0B 19 16
-> Packet data: 46 B9 6A 00 20 00 0C 69 80 6A 80 6B 80 6C 80 6D 80 6E 80 67 40 68 40 69 40 6A 40 6B 40 6C 40 0A 14 16
<- Packet data: 46 B9 68 00 20 00 0C 23 E0 23 F9 24 0D 24 35 24 49 24 62 47 D5 47 F3 48 1B 48 43 48 70 48 B1 09 25 16
11.075 MHz
Switching to 19200 baud: -> Packet data: 46 B9 6A 00 0E 01 68 40 FE DF 6B 80 81 04 6A 16
<- Packet data: 46 B9 68 00 07 01 00 70 16
-> Packet data: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16
<- Packet data: 46 B9 68 00 07 05 00 74 16
done
Erasing flash: -> Packet data: 46 B9 6A 00 0B 03 00 00 5A A5 01 77 16
<- Packet data: 46 B9 68 00 0E 03 F5 27 C5 70 04 50 F8 04 16 16
done
-> Packet data: 46 B9 6A 00 4B 22 00 00 5A A5 02 00 06 02 00 62 75 81 07 12 00 A1 E5 82 60 03 02 00 03 79 00 E9 44 00 60 1B 7A 00 90 00 A5 78 01 75 A0 00 E4 93 F2 A3 08 B8 00 02 05 A0 D9 F4 DA F2 75 A0 FF E4 78 7F F6 D8 FD 78 00 E8 44 00 1B 89 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
Writing flash: 0%| | 0/512 [00:00<?, ? Bytes/s]-> Packet data: 46 B9 6A 00 4B 02 00 40 5A A5 60 0A 79 01 75 A0 00 E4 F3 09 D8 FC 78 00 E8 44 00 60 0C 79 00 90 00 01 E4 F0 A3 D8 FC D9 FA 02 00 03 75 B4 80 D2 C7 7C 20 7D A1 7E 07 7F 00 1C BC FF 09 1D BD FF 05 1E BE FF 01 1F EC 4D 4E 4F 1E 6F 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
-> Packet data: 46 B9 6A 00 4B 02 00 80 5A A5 70 ED C2 C7 7C 20 7D A1 7E 07 7F 00 1C BC FF 09 1D BD FF 05 1E BE FF 01 1F EC 4D 4E 4F 70 ED 80 C4 75 82 00 22 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 2E 08 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
Writing flash: 38%|███████████████████████████████████████████████████████▌ | 192/512 [00:00<00:00, 1717.77 Bytes/s]-> Packet data: 46 B9 6A 00 4B 02 00 C0 5A A5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 42 36 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
-> Packet data: 46 B9 6A 00 4B 02 01 00 5A A5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 41 77 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
-> Packet data: 46 B9 6A 00 4B 02 01 40 5A A5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 41 B7 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
Writing flash: 75%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 384/512 [00:00<00:00, 1350.88 Bytes/s]-> Packet data: 46 B9 6A 00 4B 02 01 80 5A A5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 41 F7 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
-> Packet data: 46 B9 6A 00 4B 02 01 C0 5A A5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 42 37 16
<- Packet data: 46 B9 68 00 08 02 54 00 C6 16
Writing flash: 576 Bytes [00:00, 1503.97 Bytes/s]
Finishing write: -> Packet data: 46 B9 6A 00 0B 07 00 00 5A A5 01 7B 16
<- Packet data: 46 B9 68 00 08 07 54 00 CB 16
done
Setting options: -> Packet data: 46 B9 6A 00 4B 04 00 00 5A A5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 FF A8 FF FC FF F0 FF FD FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF EC FF FF FF 6B BF F7 BC 9F 3E 7C 16
<- Packet data: 46 B9 68 00 08 04 54 00 C8 16
done
Target UID: F527C5700450F8
-> Packet data: 46 B9 6A 00 07 82 00 F3 16
Disconnected!
It seems STCGAL can't work well with same USB-TTL devices... As all the USB-TTL devices I have tried got success with stc-isp-15xx...
Please try again with proper MAX232-based serial interface/s if any available. Also checkout carefully the VCC level, 5V vs 3V3, I had similar problems and they were really caused by that, see e.g.: Trivial solution to "bricked" STC15s
Kind regards and good luck!
I got
Serial port error:read timeout
inErasing flash
with device STC15W4K48S4.Environment info:
LOG:
With stc-isp-15xx-v6.86D.exe
I also tried
-P STC15a -b 9600
/-b 115200
, but I got the same results.