打印
[STM32F0]

stm32 bootloader 串口通信安全

[复制链接]
1089|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 | 只看该作者
airwill 发表于 2014-12-24 19:51
其实, 就是讲数据传输的时候会增加一个冗余校验码, 有的用 XOR (异或) 码, 有的在最后再添加校验和字节.
你 ...

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

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

56

主题

307

帖子

2

粉丝