[STM32F0] stm32 bootloader 串口通信安全

[复制链接]
1330|2
 楼主| liguang02 发表于 2014-12-24 16:25 | 显示全部楼层 |阅读模式

Communication safety
All communications from the programming tool (PC) to the device are verified by:
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
2. for each command the host sends a byte and its complement (XOR = 0x00)
3. UART: parity check active (even parity)

1,2都看不明白啊,什么意思


airwill 发表于 2014-12-24 19:51 | 显示全部楼层
其实, 就是讲数据传输的时候会增加一个冗余校验码, 有的用 XOR (异或) 码, 有的在最后再添加校验和字节.
你看一下 Bootlaod 发的数据序列和说明, 就明白这是什么意思了
 楼主| liguang02 发表于 2014-12-24 20:57 | 显示全部楼层

A byte containing the computed
XOR of all previous bytes is added to the end of each communication (checksum byte).
这个意思不是说所有的数据异或的结果最后被加到每一次通信的最后(也就是作为校验和字节)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

56

主题

307

帖子

2

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