请教一下,STM32 ISP中Checksum是怎么算的?

[复制链接]
6366|2
 楼主| javenreal 发表于 2011-6-16 17:29 | 显示全部楼层 |阅读模式
官方文档中的流程中有多处checksum,请问其中的XOR是什么意思呢?:

文档中这样的描述:
1. checksum: received blocks of data bytes are XORed. A byte containing the computed
XOR of all previous bytes is added to the end of each communication (checksum byte).
By XORing all received bytes, data + checksum, the result at the end of the packet
must be 0x00

其中一处用到checksum的流程:
The host sends the bytes to the STM32 as follows:
Byte 1: 0x31
Byte 2: 0xCE
Wait for ACK
Byte 3 to byte 6: start address
byte 3: MSB
byte 6: LSB
Byte 7: Checksum: XOR (Byte3, Byte4, Byte5, Byte6)
Wait for ACK
Byte 8: Number of bytes to be received (0 < N ≤ 255)
N +1 data bytes:(Max 256 bytes)
Checksum byte: XOR (N, N+1 data bytes)
香水城 发表于 2011-6-16 17:42 | 显示全部楼层
XOR 就是异或运算。
电子发烧者 发表于 2018-11-30 14:50 | 显示全部楼层
本帖最后由 电子发烧者 于 2018-11-30 18:31 编辑
香水城 发表于 2011-6-16 17:42
XOR 就是异或运算。


您需要登录后才可以回帖 登录 | 注册

本版积分规则

15

主题

48

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部