3 Star 13 Fork 6

IOsetting / stc8prog

 / 详情

STC8H3K64S2不能使用,说是波特率设置读取不匹配,在win下用STC官方烧写程序正常。

待办的
创建于  
2022-06-23 13:07

调用命令和输出结果如下:

stc8prog -p /dev/ttyUSB0 -d                                                 1 ✘ 
Opening port /dev/ttyUSB0: done
Waiting for MCU, please cycle power: read 32 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
0x50 | sum:00F0, index:1, count:50 flag:5
0x00 | sum:00F0, index:2, count:50 flag:5
0xa8 | sum:0198, index:3, count:50 flag:5
0xb6 | sum:024E, index:4, count:50 flag:5
0xa0 | sum:02EE, index:5, count:50 flag:5
0x9e | sum:038C, index:6, count:50 flag:5
0x10 | sum:039C, index:7, count:50 flag:5
0x01 | sum:039D, index:8, count:50 flag:5
0xff | sum:049C, index:9, count:50 flag:5
0xff | sum:059B, index:10, count:50 flag:5
0xbf | sum:065A, index:11, count:50 flag:5
0xbf | sum:0719, index:12, count:50 flag:5
0xff | sum:0818, index:13, count:50 flag:5
0x26 | sum:083E, index:14, count:50 flag:5
0xc3 | sum:0901, index:15, count:50 flag:5
0xf7 | sum:09F8, index:16, count:50 flag:5
0xfe | sum:0AF6, index:17, count:50 flag:5
0x74 | sum:0B6A, index:18, count:50 flag:5
0x55 | sum:0BBF, index:19, count:50 flag:5
0x00 | sum:0BBF, index:20, count:50 flag:5
0xf7 | sum:0CB6, index:21, count:50 flag:5
0x4c | sum:0D02, index:22, count:50 flag:5
0x01 | sum:0D03, index:23, count:50 flag:5
0x8b | sum:0D8E, index:24, count:50 flag:5
0xd8 | sum:0E66, index:25, count:50 flag:5
0x21 | sum:0E87, index:26, count:50 flag:5
0x3e | sum:0EC5, index:27, count:50 flag:5
50 00 A8 B6 A0 9E 10 01 FF FF BF BF FF 26 C3 F7 FE 74 55 00 F7 4C 01 8B D8 21 3E 
detected
MCU type: STC8H3K64S2
Protocol: STC8G/8H
F/W version: 7.4.1U
IRC frequency(Hz): 11056800
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 A0 40 FF CC 00 00 97 03 BB 16 
read 26 bytes:
0x19 | sum:0EDE, index:28, count:50 flag:5
0x1e | sum:0EFC, index:29, count:50 flag:5
0x18 | sum:0F14, index:30, count:50 flag:5
0x16 | sum:0F2A, index:31, count:50 flag:5
0x01 | sum:0F2B, index:32, count:50 flag:5
0x00 | sum:0F2B, index:33, count:50 flag:5
0x00 | sum:0F2B, index:34, count:50 flag:5
0xfe | sum:1029, index:35, count:50 flag:5
0x04 | sum:102D, index:36, count:50 flag:5
0xa9 | sum:10D6, index:37, count:50 flag:5
0x21 | sum:10F7, index:38, count:50 flag:5
0x11 | sum:1108, index:39, count:50 flag:5
0x09 | sum:1111, index:40, count:50 flag:5
0x32 | sum:1143, index:41, count:50 flag:5
0x0d | sum:1150, index:42, count:50 flag:5
0x01 | sum:1151, index:43, count:50 flag:5
0x71 | sum:11C2, index:44, count:50 flag:5
0xa6 | sum:1268, index:45, count:50 flag:5
0xdc | sum:1344, index:46, count:50 flag:5
0x01 | sum:1345, index:47, count:50 flag:5
0x0b | sum:1350, index:48, count:50 flag:5
0x23 | sum:1373, index:49, count:50 flag:5
0x52 | sum:13C5, index:50, count:50 flag:6
0x13 | sum: 0x13 flag:7
0xc5 | sum check: 0xC5 flag:8
0x16 | end byte reached flag:9
1E 18 16 01 00 00 FE 04 A9 21 11 09 32 0D 01 71 A6 DC 01 0B 23 52 
baudrate_set read unmatched
failed

评论 (14)

就是希曼 创建了任务

运行的这个版本不是最新的

在检测到型号"detected MCU type: STC8H3K64S2" 之前已经出错了, 一直停留在状态5, 正常情况这时候应该到状态9, 然后在切换波特率后再来一遍状态1到状态9.

试试直接clone仓库的代码编译一个, 1.2之后改动挺大的. 如果不方便编译的话我这周会放一个1.3上来, 到时候再试试.

重新clone了一下仓库,1.2版的,重新编译还是一样的问题。等待着你的1.3版。 :v:

之前用STC8H3K32S2比较多, 担心和STC8H3K64S2有型号差异, 今天贴了一片试试, 好像没发现问题

$ ./stc8prog -v
stc8prog 1.3
Copyright(c) 2022 IOsetting <iosetting@outlook.com>
Licensed under the Apache License, Version 2.0

$ ./stc8prog -p /dev/ttyUSB0
Opening port /dev/ttyUSB0: done
Waiting for MCU, please cycle power: detected
MCU type: STC8H3K64S2
Protocol: STC8G/8H
F/W version: 7.4.1U
IRC frequency(Hz): unadjusted
Switching to 115200 baud, chip: set, host: set, ping: succ

型号和固件版本都是一样的, 也许是USB2TTL有差异? 我用的是CH340G和CP2102

Debug信息如下

$ ./stc8prog -p /dev/ttyUSB0 -d
Opening port /dev/ttyUSB0: done
Waiting for MCU, please cycle power: read 1 bytes:
0x46 | flag:1
read 2 bytes:
0xb9 | flag:2
0x68 | flag:3
read 2 bytes:
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
read 2 bytes:
0x50 | sum:00F0, index:1, count:50 flag:5
0xff | sum:01EF, index:2, count:50 flag:5
read 2 bytes:
0xff | sum:02EE, index:3, count:50 flag:5
0xff | sum:03ED, index:4, count:50 flag:5
read 3 bytes:
0xff | sum:04EC, index:5, count:50 flag:5
0x40 | sum:052C, index:6, count:50 flag:5
0x00 | sum:052C, index:7, count:50 flag:5
read 2 bytes:
0x04 | sum:0530, index:8, count:50 flag:5
0xff | sum:062F, index:9, count:50 flag:5
read 2 bytes:
0xff | sum:072E, index:10, count:50 flag:5
0xbf | sum:07ED, index:11, count:50 flag:5
read 2 bytes:
0xfd | sum:08EA, index:12, count:50 flag:5
0xff | sum:09E9, index:13, count:50 flag:5
read 3 bytes:
0x26 | sum:0A0F, index:14, count:50 flag:5
0xbd | sum:0ACC, index:15, count:50 flag:5
0xf5 | sum:0BC1, index:16, count:50 flag:5
read 2 bytes:
0xfe | sum:0CBF, index:17, count:50 flag:5
0x74 | sum:0D33, index:18, count:50 flag:5
read 2 bytes:
0x55 | sum:0D88, index:19, count:50 flag:5
0x00 | sum:0D88, index:20, count:50 flag:5
read 2 bytes:
0xf7 | sum:0E7F, index:21, count:50 flag:5
0x4c | sum:0ECB, index:22, count:50 flag:5
read 2 bytes:
0x01 | sum:0ECC, index:23, count:50 flag:5
0x89 | sum:0F55, index:24, count:50 flag:5
read 3 bytes:
0xcb | sum:1020, index:25, count:50 flag:5
0x21 | sum:1041, index:26, count:50 flag:5
0x40 | sum:1081, index:27, count:50 flag:5
read 2 bytes:
0x1c | sum:109D, index:28, count:50 flag:5
0x20 | sum:10BD, index:29, count:50 flag:5
read 2 bytes:
0x1b | sum:10D8, index:30, count:50 flag:5
0x18 | sum:10F0, index:31, count:50 flag:5
read 2 bytes:
0x01 | sum:10F1, index:32, count:50 flag:5
0x00 | sum:10F1, index:33, count:50 flag:5
read 2 bytes:
0x00 | sum:10F1, index:34, count:50 flag:5
0xfe | sum:11EF, index:35, count:50 flag:5
read 3 bytes:
0x04 | sum:11F3, index:36, count:50 flag:5
0xa2 | sum:1295, index:37, count:50 flag:5
0x21 | sum:12B6, index:38, count:50 flag:5
read 2 bytes:
0x09 | sum:12BF, index:39, count:50 flag:5
0x22 | sum:12E1, index:40, count:50 flag:5
read 2 bytes:
0x32 | sum:1313, index:41, count:50 flag:5
0x0e | sum:1321, index:42, count:50 flag:5
read 2 bytes:
0x01 | sum:1322, index:43, count:50 flag:5
0x71 | sum:1393, index:44, count:50 flag:5
read 3 bytes:
0xa4 | sum:1437, index:45, count:50 flag:5
0xdc | sum:1513, index:46, count:50 flag:5
0x01 | sum:1514, index:47, count:50 flag:5
read 2 bytes:
0x0f | sum:1523, index:48, count:50 flag:5
0x25 | sum:1548, index:49, count:50 flag:5
read 2 bytes:
0x56 | sum:159E, index:50, count:50 flag:6
0x15 | sum: 0x15 flag:7
read 2 bytes:
0x9e | sum check: 0x9E flag:8
0x16 | end byte reached flag:9
50 FF FF FF FF 40 00 04 FF FF BF FD FF 26 BD F5 FE 74 55 00 F7 4C 01 89 CB 21 40 1C 20 1B 18 01 00 00 FE 04 A2 21 09 22 32 0E 01 71 A4 DC 01 0F 25 56 
detected
MCU type: STC8H3K64S2
Protocol: STC8G/8H
F/W version: 7.4.1U
IRC frequency(Hz): unadjusted
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 FF 40 FF CC 00 00 97 04 1A 16 
read 1 bytes:
0x46 | flag:1
read 2 bytes:
0xb9 | flag:2
0x68 | flag:3
read 2 bytes:
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
read 3 bytes:
0x01 | sum:0070, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x70 | sum check: 0x70 flag:8
read 1 bytes:
0x16 | end byte reached flag:9
01 
set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16 
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x05 | sum:0074, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x74 | sum check: 0x74 flag:8
0x16 | end byte reached flag:9
05 
succ

用了一下1.3,还是一样的问题,出错的位置还是一样。

stc8prog -v                                                              
stc8prog 1.3
Copyright(c) 2022 IOsetting <iosetting@outlook.com>
Licensed under the Apache License, Version 2.0
stc8prog -p /dev/ttyUSB0 -d                                                
Opening port /dev/ttyUSB0: done
Waiting for MCU, please cycle power: read 32 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
0x50 | sum:00F0, index:1, count:50 flag:5
0x00 | sum:00F0, index:2, count:50 flag:5
0xa8 | sum:0198, index:3, count:50 flag:5
0xb6 | sum:024E, index:4, count:50 flag:5
0xa0 | sum:02EE, index:5, count:50 flag:5
0x9e | sum:038C, index:6, count:50 flag:5
0x10 | sum:039C, index:7, count:50 flag:5
0x01 | sum:039D, index:8, count:50 flag:5
0xff | sum:049C, index:9, count:50 flag:5
0xff | sum:059B, index:10, count:50 flag:5
0xbf | sum:065A, index:11, count:50 flag:5
0xaf | sum:0709, index:12, count:50 flag:5
0xff | sum:0808, index:13, count:50 flag:5
0x26 | sum:082E, index:14, count:50 flag:5
0xc9 | sum:08F7, index:15, count:50 flag:5
0xf7 | sum:09EE, index:16, count:50 flag:5
0xfe | sum:0AEC, index:17, count:50 flag:5
0x74 | sum:0B60, index:18, count:50 flag:5
0x55 | sum:0BB5, index:19, count:50 flag:5
0x00 | sum:0BB5, index:20, count:50 flag:5
0xf7 | sum:0CAC, index:21, count:50 flag:5
0x4c | sum:0CF8, index:22, count:50 flag:5
0x01 | sum:0CF9, index:23, count:50 flag:5
0x8b | sum:0D84, index:24, count:50 flag:5
0xd8 | sum:0E5C, index:25, count:50 flag:5
0x21 | sum:0E7D, index:26, count:50 flag:5
0x3e | sum:0EBB, index:27, count:50 flag:5
50 00 A8 B6 A0 9E 10 01 FF FF BF AF FF 26 C9 F7 FE 74 55 00 F7 4C 01 8B D8 21 3E 
detected
MCU type: STC8H3K64S2
Protocol: STC8G/8H
F/W version: 7.4.1U
IRC frequency(Hz): 11056800
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 A0 40 FF CC 00 00 97 03 BB 16 
read 26 bytes:
0x19 | sum:0ED4, index:28, count:50 flag:5
0x1e | sum:0EF2, index:29, count:50 flag:5
0x18 | sum:0F0A, index:30, count:50 flag:5
0x16 | sum:0F20, index:31, count:50 flag:5
0x01 | sum:0F21, index:32, count:50 flag:5
0x00 | sum:0F21, index:33, count:50 flag:5
0x00 | sum:0F21, index:34, count:50 flag:5
0xfe | sum:101F, index:35, count:50 flag:5
0x04 | sum:1023, index:36, count:50 flag:5
0xa9 | sum:10CC, index:37, count:50 flag:5
0x21 | sum:10ED, index:38, count:50 flag:5
0x11 | sum:10FE, index:39, count:50 flag:5
0x09 | sum:1107, index:40, count:50 flag:5
0x32 | sum:1139, index:41, count:50 flag:5
0x0d | sum:1146, index:42, count:50 flag:5
0x01 | sum:1147, index:43, count:50 flag:5
0x71 | sum:11B8, index:44, count:50 flag:5
0xa6 | sum:125E, index:45, count:50 flag:5
0xdc | sum:133A, index:46, count:50 flag:5
0x01 | sum:133B, index:47, count:50 flag:5
0x0b | sum:1346, index:48, count:50 flag:5
0x23 | sum:1369, index:49, count:50 flag:5
0x52 | sum:13BB, index:50, count:50 flag:6
0x13 | sum: 0x13 flag:7
0xbb | sum check: 0xBB flag:8
0x16 | end byte reached flag:9
1E 18 16 01 00 00 FE 04 A9 21 11 09 32 0D 01 71 A6 DC 01 0B 23 52 
baudrate_set read unmatched
failed

我用的是CH340N,用的是自动下载电路(CH340N的RST管脚控制一个PMOS开关电源),在win下刷写程序没有问题。同样的电路用在了STC15上用你的下载器也是没有问题的。我也觉得很奇怪,下次我试试把自动下载电路换成手动的吧。

应该和自动下载关系不大, 我现在也用的自动下载. 看来我得跑个manjaro看看, 莫非这两发行版里的ch340驱动有变化.

另外,我看了另一个issus里面的兄弟也是和我一样的问题,我们使用的都是manjaro,你的好像是ubuntu吧?是不是这个造成的问题?

Tested under fresh-installed Manjaro, but cannot reproduce the error

    ~/WorkC/stc8prog    main  uname -a                                        ✔ 
Linux t401s 5.15.50-1-MANJARO #1 SMP PREEMPT Sun Jun 26 07:06:30 UTC 2022 x86_64 GNU/Linux
    ~/WorkC/stc8prog    main  ./stc8prog -v                                   ✔ 
stc8prog 1.3
Copyright(c) 2022 IOsetting <iosetting@outlook.com>
Licensed under the Apache License, Version 2.0
    ~/WorkC/stc8prog    main  ./stc8prog -d -p /dev/ttyUSB0                 1 ✘ 
Opening port /dev/ttyUSB0: done
Waiting for MCU, please cycle power: read 2 bytes:
0x46 | flag:1
0xb9 | flag:2
read 3 bytes:
0x68 | flag:3
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
read 2 bytes:
0x50 | sum:00F0, index:1, count:50 flag:5
0x01 | sum:00F1, index:2, count:50 flag:5
read 2 bytes:
0x6e | sum:015F, index:3, count:50 flag:5
0x3f | sum:019E, index:4, count:50 flag:5
read 2 bytes:
0x60 | sum:01FE, index:5, count:50 flag:5
0x44 | sum:0242, index:6, count:50 flag:5
read 3 bytes:
0x20 | sum:0262, index:7, count:50 flag:5
0x01 | sum:0263, index:8, count:50 flag:5
0xff | sum:0362, index:9, count:50 flag:5
read 2 bytes:
0xff | sum:0461, index:10, count:50 flag:5
0xbf | sum:0520, index:11, count:50 flag:5
read 2 bytes:
0xbf | sum:05DF, index:12, count:50 flag:5
0xff | sum:06DE, index:13, count:50 flag:5
read 2 bytes:
0x26 | sum:0704, index:14, count:50 flag:5
0xb1 | sum:07B5, index:15, count:50 flag:5
read 3 bytes:
0xf7 | sum:08AC, index:16, count:50 flag:5
0xfe | sum:09AA, index:17, count:50 flag:5
0x74 | sum:0A1E, index:18, count:50 flag:5
read 2 bytes:
0x55 | sum:0A73, index:19, count:50 flag:5
0x00 | sum:0A73, index:20, count:50 flag:5
read 2 bytes:
0xf7 | sum:0B6A, index:21, count:50 flag:5
0x4c | sum:0BB6, index:22, count:50 flag:5
read 2 bytes:
0x01 | sum:0BB7, index:23, count:50 flag:5
0x89 | sum:0C40, index:24, count:50 flag:5
read 2 bytes:
0xcb | sum:0D0B, index:25, count:50 flag:5
0x21 | sum:0D2C, index:26, count:50 flag:5
read 3 bytes:
0x40 | sum:0D6C, index:27, count:50 flag:5
0x1c | sum:0D88, index:28, count:50 flag:5
0x20 | sum:0DA8, index:29, count:50 flag:5
read 2 bytes:
0x1b | sum:0DC3, index:30, count:50 flag:5
0x18 | sum:0DDB, index:31, count:50 flag:5
read 2 bytes:
0x01 | sum:0DDC, index:32, count:50 flag:5
0x00 | sum:0DDC, index:33, count:50 flag:5
read 2 bytes:
0x00 | sum:0DDC, index:34, count:50 flag:5
0xfe | sum:0EDA, index:35, count:50 flag:5
read 2 bytes:
0x04 | sum:0EDE, index:36, count:50 flag:5
0xa2 | sum:0F80, index:37, count:50 flag:5
read 3 bytes:
0x21 | sum:0FA1, index:38, count:50 flag:5
0x09 | sum:0FAA, index:39, count:50 flag:5
0x22 | sum:0FCC, index:40, count:50 flag:5
read 2 bytes:
0x32 | sum:0FFE, index:41, count:50 flag:5
0x0e | sum:100C, index:42, count:50 flag:5
read 2 bytes:
0x01 | sum:100D, index:43, count:50 flag:5
0x71 | sum:107E, index:44, count:50 flag:5
read 2 bytes:
0xa4 | sum:1122, index:45, count:50 flag:5
0xdc | sum:11FE, index:46, count:50 flag:5
read 3 bytes:
0x01 | sum:11FF, index:47, count:50 flag:5
0x0f | sum:120E, index:48, count:50 flag:5
0x25 | sum:1233, index:49, count:50 flag:5
read 2 bytes:
0x56 | sum:1289, index:50, count:50 flag:6
0x12 | sum: 0x12 flag:7
read 2 bytes:
0x89 | sum check: 0x89 flag:8
0x16 | end byte reached flag:9
50 01 6E 3F 60 44 20 01 FF FF BF BF FF 26 B1 F7 FE 74 55 00 F7 4C 01 89 CB 21 40 1C 20 1B 18 01 00 00 FE 04 A2 21 09 22 32 0E 01 71 A4 DC 01 0F 25 56 
detected
MCU type: STC8H3K64S2
Protocol: STC8G/8H
F/W version: 7.4.1U
IRC frequency(Hz): 24002400
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 60 40 FF CC 00 00 97 03 7B 16 
read 1 bytes:
0x46 | flag:1
read 2 bytes:
0xb9 | flag:2
0x68 | flag:3
read 2 bytes:
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
read 2 bytes:
0x01 | sum:0070, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
read 2 bytes:
0x70 | sum check: 0x70 flag:8
0x16 | end byte reached flag:9
01 
set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16 
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x05 | sum:0074, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x74 | sum check: 0x74 flag:8
0x16 | end byte reached flag:9
05 
succ

也许就是我的manjaro的问题,但是不知道问题出在哪里?我把你的程序用cygwin编译了一下,在win10下运行正常。

.\stc8prog.exe --version
stc8prog 1.3
Copyright(c) 2022 IOsetting <iosetting@outlook.com>
Licensed under the Apache License, Version 2.0

 .\stc8prog.exe -p  COM3 -d
Opening port COM3: done
Waiting for MCU, please cycle power: read 32 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
0x50 | sum:00F0, index:1, count:50 flag:5
0x00 | sum:00F0, index:2, count:50 flag:5
0xa8 | sum:0198, index:3, count:50 flag:5
0xb6 | sum:024E, index:4, count:50 flag:5
0xa0 | sum:02EE, index:5, count:50 flag:5
0x9e | sum:038C, index:6, count:50 flag:5
0x10 | sum:039C, index:7, count:50 flag:5
0x01 | sum:039D, index:8, count:50 flag:5
0xff | sum:049C, index:9, count:50 flag:5
0xff | sum:059B, index:10, count:50 flag:5
0xbf | sum:065A, index:11, count:50 flag:5
0xbf | sum:0719, index:12, count:50 flag:5
0xff | sum:0818, index:13, count:50 flag:5
0x26 | sum:083E, index:14, count:50 flag:5
0xc3 | sum:0901, index:15, count:50 flag:5
0xf7 | sum:09F8, index:16, count:50 flag:5
0xfe | sum:0AF6, index:17, count:50 flag:5
0x74 | sum:0B6A, index:18, count:50 flag:5
0x55 | sum:0BBF, index:19, count:50 flag:5
0x00 | sum:0BBF, index:20, count:50 flag:5
0xf7 | sum:0CB6, index:21, count:50 flag:5
0x4c | sum:0D02, index:22, count:50 flag:5
0x01 | sum:0D03, index:23, count:50 flag:5
0x8b | sum:0D8E, index:24, count:50 flag:5
0xd8 | sum:0E66, index:25, count:50 flag:5
0x21 | sum:0E87, index:26, count:50 flag:5
0x3e | sum:0EC5, index:27, count:50 flag:5
read 26 bytes:
0x19 | sum:0EDE, index:28, count:50 flag:5
0x1e | sum:0EFC, index:29, count:50 flag:5
0x18 | sum:0F14, index:30, count:50 flag:5
0x16 | sum:0F2A, index:31, count:50 flag:5
0x01 | sum:0F2B, index:32, count:50 flag:5
0x00 | sum:0F2B, index:33, count:50 flag:5
0x00 | sum:0F2B, index:34, count:50 flag:5
0xfe | sum:1029, index:35, count:50 flag:5
0x04 | sum:102D, index:36, count:50 flag:5
0xa9 | sum:10D6, index:37, count:50 flag:5
0x21 | sum:10F7, index:38, count:50 flag:5
0x11 | sum:1108, index:39, count:50 flag:5
0x09 | sum:1111, index:40, count:50 flag:5
0x32 | sum:1143, index:41, count:50 flag:5
0x0d | sum:1150, index:42, count:50 flag:5
0x01 | sum:1151, index:43, count:50 flag:5
0x71 | sum:11C2, index:44, count:50 flag:5
0xa6 | sum:1268, index:45, count:50 flag:5
0xdc | sum:1344, index:46, count:50 flag:5
0x01 | sum:1345, index:47, count:50 flag:5
0x0b | sum:1350, index:48, count:50 flag:5
0x23 | sum:1373, index:49, count:50 flag:5
0x52 | sum:13C5, index:50, count:50 flag:6
0x13 | sum: 0x13 flag:7
0xc5 | sum check: 0xC5 flag:8
0x16 | end byte reached flag:9
50 00 A8 B6 A0 9E 10 01 FF FF BF BF FF 26 C3 F7 FE 74 55 00 F7 4C 01 8B D8 21 3E 19 1E 18 16 01 00 00 FE 04 A9 21 11 09 32 0D 01 71 A6 DC 01 0B 23 52
detected
MCU type: STC8H3K64S2
Protocol: STC8G/8H
F/W version: 7.4.1U
IRC frequency(Hz): 11056800
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 A0 40 FF CC 00 00 97 03 BB 16
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x01 | sum:0070, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x70 | sum check: 0x70 flag:8
0x16 | end byte reached flag:9
01
set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x05 | sum:0074, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x74 | sum check: 0x74 flag:8
0x16 | end byte reached flag:9
05
succ

新问题:STC8G1K17(SOP20)这个芯片,有时不能正确擦除和写入

 .\stc8prog.exe -p  COM3 -e -f .\firmware.hex -d
Loading hex file:    Loaded 1966 bytes between: 0000 to 07AD
Opening port COM3: done
Waiting for MCU, please cycle power: read 32 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
0x50 | sum:00F0, index:1, count:50 flag:5
0x00 | sum:00F0, index:2, count:50 flag:5
0xa8 | sum:0198, index:3, count:50 flag:5
0xbb | sum:0253, index:4, count:50 flag:5
0x50 | sum:02A3, index:5, count:50 flag:5
0xa4 | sum:0347, index:6, count:50 flag:5
0x00 | sum:0347, index:7, count:50 flag:5
0x02 | sum:0349, index:8, count:50 flag:5
0xff | sum:0448, index:9, count:50 flag:5
0xff | sum:0547, index:10, count:50 flag:5
0xbf | sum:0606, index:11, count:50 flag:5
0xbf | sum:06C5, index:12, count:50 flag:5
0xff | sum:07C4, index:13, count:50 flag:5
0x26 | sum:07EA, index:14, count:50 flag:5
0x2a | sum:0814, index:15, count:50 flag:5
0xf7 | sum:090B, index:16, count:50 flag:5
0x42 | sum:094D, index:17, count:50 flag:5
0x73 | sum:09C0, index:18, count:50 flag:5
0x55 | sum:0A15, index:19, count:50 flag:5
0x00 | sum:0A15, index:20, count:50 flag:5
0xf7 | sum:0B0C, index:21, count:50 flag:5
0x57 | sum:0B63, index:22, count:50 flag:5
0x0c | sum:0B6F, index:23, count:50 flag:5
0x89 | sum:0BF8, index:24, count:50 flag:5
0xe4 | sum:0CDC, index:25, count:50 flag:5
0x98 | sum:0D74, index:26, count:50 flag:5
0xc2 | sum:0E36, index:27, count:50 flag:5
read 26 bytes:
0x0e | sum:0E44, index:28, count:50 flag:5
0x1f | sum:0E63, index:29, count:50 flag:5
0x20 | sum:0E83, index:30, count:50 flag:5
0xff | sum:0F82, index:31, count:50 flag:5
0x00 | sum:0F82, index:32, count:50 flag:5
0x44 | sum:0FC6, index:33, count:50 flag:5
0x00 | sum:0FC6, index:34, count:50 flag:5
0x44 | sum:100A, index:35, count:50 flag:5
0x04 | sum:100E, index:36, count:50 flag:5
0xa1 | sum:10AF, index:37, count:50 flag:5
0x21 | sum:10D0, index:38, count:50 flag:5
0x10 | sum:10E0, index:39, count:50 flag:5
0x14 | sum:10F4, index:40, count:50 flag:5
0x32 | sum:1126, index:41, count:50 flag:5
0xff | sum:1225, index:42, count:50 flag:5
0x69 | sum:128E, index:43, count:50 flag:5
0x21 | sum:12AF, index:44, count:50 flag:5
0x4a | sum:12F9, index:45, count:50 flag:5
0x75 | sum:136E, index:46, count:50 flag:5
0x91 | sum:13FF, index:47, count:50 flag:5
0xad | sum:14AC, index:48, count:50 flag:5
0xda | sum:1586, index:49, count:50 flag:5
0xda | sum:1660, index:50, count:50 flag:6
0x16 | sum: 0x16 flag:7
0x60 | sum check: 0x60 flag:8
0x16 | end byte reached flag:9
50 00 A8 BB 50 A4 00 02 FF FF BF BF FF 26 2A F7 42 73 55 00 F7 57 0C 89 E4 98 C2 0E 1F 20 FF 00 44 00 44 04 A1 21 10 14 32 FF 69 21 4A 75 91 AD DA DA
detected
MCU type: STC8G1K17-20/16P
Protocol: STC8G/8H
F/W version: 7.3.12U
IRC frequency(Hz): 11058000
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 50 40 FF CC 00 00 97 03 6B 16
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x01 | sum:0070, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x70 | sum check: 0x70 flag:8
0x16 | end byte reached flag:9
01
set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x05 | sum:0074, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x74 | sum check: 0x74 flag:8
0x16 | end byte reached flag:9
05
succ
Erasing chip: TX: 46 B9 6A 00 0B 03 00 00 5A A5 01 77 16
failed

另外,多数时间无法写入,少数时间可以,碰运气。

.\stc8prog.exe -p  COM3 -e -f .\firmware.hex -d
Loading hex file:    Loaded 1966 bytes between: 0000 to 07AD
Opening port COM3: done
Waiting for MCU, please cycle power: read 32 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x38 | sum:00A0, count:50, index:0 flag:5
0x50 | sum:00F0, index:1, count:50 flag:5
0x00 | sum:00F0, index:2, count:50 flag:5
0xa8 | sum:0198, index:3, count:50 flag:5
0xbb | sum:0253, index:4, count:50 flag:5
0x50 | sum:02A3, index:5, count:50 flag:5
0xa4 | sum:0347, index:6, count:50 flag:5
0x00 | sum:0347, index:7, count:50 flag:5
0x02 | sum:0349, index:8, count:50 flag:5
0xff | sum:0448, index:9, count:50 flag:5
0xff | sum:0547, index:10, count:50 flag:5
0xbf | sum:0606, index:11, count:50 flag:5
0xbf | sum:06C5, index:12, count:50 flag:5
0xff | sum:07C4, index:13, count:50 flag:5
0x26 | sum:07EA, index:14, count:50 flag:5
0x2a | sum:0814, index:15, count:50 flag:5
0xf7 | sum:090B, index:16, count:50 flag:5
0x42 | sum:094D, index:17, count:50 flag:5
0x73 | sum:09C0, index:18, count:50 flag:5
0x55 | sum:0A15, index:19, count:50 flag:5
0x00 | sum:0A15, index:20, count:50 flag:5
0xf7 | sum:0B0C, index:21, count:50 flag:5
0x57 | sum:0B63, index:22, count:50 flag:5
0x0c | sum:0B6F, index:23, count:50 flag:5
0x89 | sum:0BF8, index:24, count:50 flag:5
0xe4 | sum:0CDC, index:25, count:50 flag:5
0x98 | sum:0D74, index:26, count:50 flag:5
0xc2 | sum:0E36, index:27, count:50 flag:5
read 26 bytes:
0x0e | sum:0E44, index:28, count:50 flag:5
0x1f | sum:0E63, index:29, count:50 flag:5
0x20 | sum:0E83, index:30, count:50 flag:5
0xff | sum:0F82, index:31, count:50 flag:5
0x00 | sum:0F82, index:32, count:50 flag:5
0x44 | sum:0FC6, index:33, count:50 flag:5
0x00 | sum:0FC6, index:34, count:50 flag:5
0x44 | sum:100A, index:35, count:50 flag:5
0x04 | sum:100E, index:36, count:50 flag:5
0xa1 | sum:10AF, index:37, count:50 flag:5
0x21 | sum:10D0, index:38, count:50 flag:5
0x10 | sum:10E0, index:39, count:50 flag:5
0x14 | sum:10F4, index:40, count:50 flag:5
0x32 | sum:1126, index:41, count:50 flag:5
0xff | sum:1225, index:42, count:50 flag:5
0x69 | sum:128E, index:43, count:50 flag:5
0x21 | sum:12AF, index:44, count:50 flag:5
0x4a | sum:12F9, index:45, count:50 flag:5
0x75 | sum:136E, index:46, count:50 flag:5
0x91 | sum:13FF, index:47, count:50 flag:5
0xad | sum:14AC, index:48, count:50 flag:5
0xda | sum:1586, index:49, count:50 flag:5
0xda | sum:1660, index:50, count:50 flag:6
0x16 | sum: 0x16 flag:7
0x60 | sum check: 0x60 flag:8
0x16 | end byte reached flag:9
50 00 A8 BB 50 A4 00 02 FF FF BF BF FF 26 2A F7 42 73 55 00 F7 57 0C 89 E4 98 C2 0E 1F 20 FF 00 44 00 44 04 A1 21 10 14 32 FF 69 21 4A 75 91 AD DA DA
detected
MCU type: STC8G1K17-20/16P
Protocol: STC8G/8H
F/W version: 7.3.12U
IRC frequency(Hz): 11058000
Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 50 40 FF CC 00 00 97 03 6B 16
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x01 | sum:0070, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x70 | sum check: 0x70 flag:8
0x16 | end byte reached flag:9
01
set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16
read 9 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x07 | sum:006F, count:1, index:0 flag:5
0x05 | sum:0074, index:1, count:1 flag:6
0x00 | sum: 0x00 flag:7
0x74 | sum check: 0x74 flag:8
0x16 | end byte reached flag:9
05
succ
Erasing chip: TX: 46 B9 6A 00 0B 03 00 00 5A A5 01 77 16
read 16 bytes:
0x46 | flag:1
0xb9 | flag:2
0x68 | flag:3
0x00 | flag:4
0x0e | sum:0076, count:8, index:0 flag:5
0x03 | sum:0079, index:1, count:8 flag:5
0xf7 | sum:0170, index:2, count:8 flag:5
0x57 | sum:01C7, index:3, count:8 flag:5
0xc5 | sum:028C, index:4, count:8 flag:5
0xcc | sum:0358, index:5, count:8 flag:5
0x11 | sum:0369, index:6, count:8 flag:5
0x75 | sum:03DE, index:7, count:8 flag:5
0x35 | sum:0413, index:8, count:8 flag:6
0x04 | sum: 0x04 flag:7
0x13 | sum check: 0x13 flag:8
0x16 | end byte reached flag:9
03 F7 57 C5 CC 11 75 35
succ
Writing flash, size 1966:   0.00%TX: 46 B9 6A 00 8B 22 00 00 5A A5 02 00 06 02 01 CC 75 81 65 12 07 8D E5 82 60 03 02 00 03 79 00 E9 44 00 60 1B 7A 00 90 07 AE 78 01 75 A0 00 E4 93 F2 A3 08 B8 00 02 05 A0 D9 F4 DA F2 75 A0 FF E4 78 FF F6 D8 FD 78 00 E8 44 00 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 75 12 01 02 00 03 AF 82 C2 90 74 F0 5F F5 B0 C2 91 D2 91 90 00 01 C0 07 12 06 83 D0 07 EF C4 54 F0 3A E9 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 00 80 5A A5 FF 74 F0 5F F5 B0 C2 91 D2 91 90 00 01 02 06 83 AF 82 D2 90 74 F0 5F F5 B0 C2 91 D2 91 90 00 01 C0 07 12 06 83 D0 07 EF C4 54 F0 FF 74 F0 5F F5 B0 C2 91 D2 91 90 00 01 02 06 83 53 92 FC 53 91 FC 53 B2 0F 53 B1 0F C2 90 C2 91 53 B0 F0 22 12 00 BB 90 00 32 12 06 83 75 82 33 12 00 65 90 00 0A 12 06 83 75 82 32 12 00 65 90 00 0A 12 06 83 75 82 28 12 00 65 90 00 0A 12 06 83 75 82 08 12 37 CD 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 01 00 5A A5 00 65 75 82 01 12 00 65 75 82 06 02 00 65 02 00 65 AE 82 53 08 01 75 09 00 53 06 0F E5 08 45 09 60 03 43 06 40 43 06 80 8E 82 02 00 65 85 0A 08 85 0B 09 12 01 11 85 0C 82 85 0D 83 85 0E F0 02 01 42 AD 82 AE 83 AF F0 8D 82 8E 83 8F F0 12 06 D0 FC 60 18 8C 82 0D BD 00 01 0E C0 07 C0 06 C0 05 12 00 90 D0 05 D0 06 D0 07 80 DC 22 85 0F 08 85 10 09 12 01 11 85 11 82 02 00 90 53 A2 3F 75 29 59 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 01 80 5A A5 26 01 E4 F5 27 75 28 C2 75 29 01 F5 2A 75 82 01 02 02 97 22 12 01 7C 12 01 93 12 00 CF 75 0C 91 75 0D 07 75 0E 80 E4 F5 0A F5 0B 90 00 02 12 01 2D 75 82 0F 12 01 0E 75 0F 01 75 10 00 75 11 4D 90 00 01 02 01 6D 90 00 64 02 06 83 12 01 94 12 01 C6 80 FB AC 82 AD 83 AE F0 FF E5 22 25 22 F5 13 E5 23 33 F5 14 E5 24 33 F5 15 E5 25 33 F5 16 E5 13 25 13 F5 13 E5 14 33 F5 14 E5 15 33 F5 15 2F 3F 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 02 00 5A A5 E5 16 33 F5 16 8C 82 8D 83 8E F0 EF 12 05 DB AC 82 AD 83 AE F0 FF E5 21 70 1B 75 13 0C E4 F5 14 F5 15 F5 16 8C 82 8D 83 8E F0 EF 12 05 DB AC 82 AD 83 AE F0 FF C3 74 FF 9C 74 FF 9D E4 9E E4 9F 50 04 90 00 00 22 C3 E4 9C F5 82 E4 9D F5 83 22 AF 82 74 FE 55 8E FE 8F 05 ED 4E F5 8E EF 70 1A 74 BF 55 8E FF E5 13 03 03 54 C0 4F F5 8E 53 89 CF 85 15 8D 85 14 8B D2 8E 22 74 FB 55 8E FF E5 49 20 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 02 80 5A A5 13 25 E0 25 E0 4F F5 8E 85 15 D6 85 14 D7 74 EF 55 8E 44 10 F5 8E 22 AF 82 C2 9F D2 9E C0 07 12 06 BA AB 82 AC 83 AD F0 FE 85 26 21 85 27 22 85 28 23 85 29 24 85 2A 25 8B 82 8C 83 8D F0 EE 12 01 D4 85 82 14 85 83 15 D0 07 85 26 13 8F 82 02 02 50 AF 82 D2 9F D2 9E C0 07 12 06 BA AB 82 AC 83 AD F0 FE 85 2B 21 85 2C 22 85 2D 23 85 2E 24 85 2F 25 8B 82 8C 83 8D F0 EE 12 01 D4 85 82 14 3C 3C 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 03 00 5A A5 85 83 15 D0 07 85 2B 13 8F 82 02 02 50 10 99 02 80 02 C2 00 10 98 01 22 78 45 86 07 78 45 EF 04 F6 EF 24 46 F8 A6 99 78 45 E6 54 1F F6 22 AF 82 20 00 FD D2 00 8F 99 22 E5 82 FF C4 54 0F 90 07 9E 93 F5 82 C0 07 12 03 2E D0 07 53 07 0F 7E 00 EF 24 9E F5 82 EE 34 07 F5 83 E4 93 F5 82 02 03 2E AD 82 AE 83 AF F0 8D 82 8E 83 8F F0 12 06 D0 FC 60 18 8C 82 0D BD 00 01 0E C0 07 C0 06 C0 05 38 B8 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 03 80 5A A5 12 03 2E D0 05 D0 06 D0 07 80 DC 22 85 82 99 10 99 02 80 FB 22 E5 82 FF C4 54 0F 90 07 9E 93 F5 82 C0 07 12 03 8C D0 07 53 07 0F 7E 00 EF 24 9E F5 82 EE 34 07 F5 83 E4 93 F5 82 02 03 8C AD 82 AE 83 AF F0 8D 82 8E 83 8F F0 12 06 D0 FC 60 18 8C 82 0D BD 00 01 0E C0 07 C0 06 C0 05 12 03 8C D0 05 D0 06 D0 07 80 DC 22 AE 82 AF 83 8E 99 10 99 02 80 FB 8E 82 8F 83 22 AF 82 C0 07 12 06 BA 3B 8F 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 04 00 5A A5 AB 82 AC 83 AD F0 FE D0 07 8F 21 85 30 22 85 31 23 85 32 24 85 33 25 8B 82 8C 83 8D F0 EE C0 07 12 01 D4 AD 82 AE 83 D0 07 74 FB 55 8E FC EF 2F 25 E0 4C F5 8E 8E D6 8D D7 74 EF 55 8E 44 10 F5 8E 22 85 82 9B E5 9A 30 E1 FB 53 9A FD 22 E5 82 FF C4 54 0F 90 07 9E 93 F5 82 C0 07 12 04 42 D0 07 53 07 0F 7E 00 EF 24 9E F5 82 EE 34 07 F5 83 E4 93 F5 82 02 04 42 AD 82 AE 83 AF F0 8D 82 8E 43 30 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 04 80 5A A5 83 8F F0 12 06 D0 FC 60 18 8C 82 0D BD 00 01 0E C0 07 C0 06 C0 05 12 04 42 D0 05 D0 06 D0 07 80 DC 22 AF 82 53 AC BF C0 07 12 06 BA AB 82 AC 83 AD F0 FE D0 07 8F 21 85 34 22 85 35 23 85 36 24 85 37 25 8B 82 8C 83 8D F0 EE C0 07 12 01 D4 AD 82 AE 83 D0 07 74 FB 55 8E FC EF 2F 25 E0 4C F5 8E 8E D6 8D D7 74 EF 55 8E 44 10 F5 8E 22 AF 82 74 BF 55 AC 44 40 F5 AC C0 07 12 06 BA AB 82 AC 3E B6 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 05 00 5A A5 83 AD F0 FE D0 07 8F 21 85 38 22 85 39 23 85 3A 24 85 3B 25 8B 82 8C 83 8D F0 EE C0 07 12 01 D4 AD 82 AE 83 D0 07 74 FD 55 D1 FC EF 2F 4C F5 D1 8E D4 8D D5 74 F7 55 D1 44 08 F5 D1 22 AF 82 53 84 BF C0 07 12 06 BA AB 82 AC 83 AD F0 FE D0 07 8F 21 85 3C 22 85 3D 23 85 3E 24 85 3F 25 8B 82 8C 83 8D F0 EE C0 07 12 01 D4 AD 82 AE 83 D0 07 74 FB 55 8E FC EF 2F 25 E0 4C F5 8E 8E D6 8D D7 43 EA 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 05 80 5A A5 74 EF 55 8E 44 10 F5 8E 22 AF 82 74 BF 55 84 44 40 F5 84 C0 07 12 06 BA AB 82 AC 83 AD F0 FE D0 07 8F 21 85 40 22 85 41 23 85 42 24 85 43 25 8B 82 8C 83 8D F0 EE C0 07 12 01 D4 AD 82 AE 83 D0 07 74 DF 55 D1 FC EF C4 23 54 E0 4C F5 D1 8E D2 8D D3 74 7F 55 D1 44 80 F5 D1 22 FB 7A 20 E4 FC FD FE FF E5 82 25 82 F5 82 E5 83 33 F5 83 E5 F0 33 F5 F0 EB 33 FB 40 17 DA E9 80 42 E5 82 25 82 49 4C 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 06 00 5A A5 F5 82 E5 83 33 F5 83 E5 F0 33 F5 F0 EB 33 FB EC 33 FC ED 33 FD EE 33 FE EF 33 FF EC 95 13 ED 95 14 EE 95 15 EF 95 16 40 13 EC 95 13 FC ED 95 14 FD EE 95 15 FE EF 95 16 FF 43 82 01 DA BE EB 22 7E 00 7F 00 75 BA 80 90 FE 01 E0 60 1A 90 FE 01 E4 F0 7C 00 7D 00 7B 05 1C BC FF 01 1D EC 4D 70 F7 DB F5 8C 06 8D 07 75 BA 00 75 12 01 75 9D 00 75 A6 00 75 9F 00 75 9E 00 1E BE FF 01 1F EE 4F 44 CF 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 06 80 5A A5 70 F7 22 AE 82 AF 83 90 07 9B E4 93 FC 74 01 93 FD 1C BC FF 01 1D EC 4D 70 F7 1E BE FF 01 1F EE 4F 70 E4 22 AE 82 AF 83 90 07 9D E4 93 FD DD FE 1E BE FF 01 1F EE 4F 70 EF 22 85 12 13 75 14 00 75 15 00 75 16 00 90 C0 00 75 F0 A8 E4 02 05 DB 20 F7 14 30 F6 14 88 83 A8 82 20 F5 07 E6 A8 83 75 83 00 22 E2 80 F7 E4 93 22 E0 22 75 98 50 43 8E 40 53 8E FE 53 89 0F 75 8B 8F 75 8D FD C2 AB 41 85 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 8B 22 07 00 5A A5 D2 8E 22 75 98 50 43 8E 40 53 8E FE 53 89 0F 75 8B CC 75 8D FF C2 AB D2 8E 22 75 98 50 43 8E 40 53 8E FE 53 89 0F 75 8B A0 75 8D FC C2 AB D2 8E 22 75 98 50 43 8E 40 53 8E FE 53 89 0F 75 8B B8 75 8D FF C2 AB D2 8E 22 75 98 50 43 8E 40 53 8E FE 53 89 0F 75 8B 70 75 8D FC C2 AB D2 8E 22 75 98 50 43 8E 40 53 8E FE 53 89 0F 75 8B 40 75 8D FC C2 AB D2 8E 22 75 98 50 43 8E 40 53 8E FE 53 42 D2 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
TX: 46 B9 6A 00 39 22 07 80 5A A5 89 0F 75 8B B0 75 8D FF C2 AB D2 8E 22 75 82 00 22 31 32 33 34 35 36 37 38 39 00 24 03 00 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 10 42 16
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
read nothing
 done

上面这个问题把波特率提高为1152000后,情况有所好转。你的程序很好,辛苦了!

可能还是有某些配置的差异, 我测的每次读取只有几个字节, 但是出状况的输出, 都是每次读取几十个字节, 也许和STC-ISP设置的IRC频率有关? 我一般都设成24MHz, 下次我写成11.0592MHz看看.

@就是希曼 我今天用新打的板子新做了一个自动下载, 结果正好复现了这个问题. 已经把修复提交上去了, 可以本地编译一个试试看是否能解决问题.

这个问题貌似和uart通信的机制有关, 但是我不确定这种区别是CH340引起的还是MCU引起的

如果每次读取是一两个字节的情况, 通信间隔很短没问题, 如果是每次读取二三十个字节的情况, 中间通信间隔时间会超过100ms, 正好就超过了程序里设置的超时时间, 现在把超时时间增加到320ms就没问题了.

1.4版已经在manjaro和win11下编译通过并且可以正常烧录程序了,分别用24M和11.0592M都测试了没问题。

目前还有一个问题,每次烧录都要加-e参数,不然不能烧写成功,是不是直接就把这个参数作为默认参数编译进程序中?

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
10101600 iosetting 1638204395
C
1
https://gitee.com/iosetting/stc8prog.git
git@gitee.com:iosetting/stc8prog.git
iosetting
stc8prog
stc8prog

搜索帮助