打印
[STM32F0]

【STM32F072】+利用IAR EWARM自带checksum工具计算crc16,及ROM校验

[复制链接]
7575|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
1 -- crc16的多项式余式简记为0x11021,使用了半字节查表法,兼具较小程序空间及较快计算速度的优点,不追求极限速度的可以考虑这种计算方式
2 -- crc计算函数计算了从地址0x08000000到0x0801fffd的ROM空间数据的crc16
3 -- 利用IAR EWARM的linker的checksum计算crc
4 -- 两个计算方式的结果进行比较,正确则点亮LED5,否则点亮LED3;可应用于需校验ROM空间的合法性
5 -- 工程解压缩到..\STM32F072B-Discovery_FW_V1.0.1\Projects\Peripheral_Examples目录下可直接编译运行

CRC_16BitsCRCMessage.zip

26.22 KB, 阅读权限: 10

IAR EWARM7.10工程代码

评分
参与人数 1威望 +1 收起 理由
kingjason2009 + 1 赞一个!
沙发
mmuuss586| | 2014-4-9 13:16 | 只看该作者

使用特权

评论回复
板凳
winrap| | 2015-6-1 23:34 | 只看该作者
下载不了

使用特权

评论回复
地板
guolisong1983| | 2015-8-10 21:52 | 只看该作者
你好,我照你说的步骤去配置CRC,编译没有问题,但是链接始终失败,报错误是ielftool error: The string '__checksum' was not found in the string table 。请问你知道是什么原因吗?

使用特权

评论回复
5
guolisong1983| | 2015-8-10 22:13 | 只看该作者
本帖最后由 guolisong1983 于 2015-8-10 22:17 编辑

找到原因了。 原来需要额外做一点事情,如下所述:
Include checksum calculation source in your application.
•        
The minimum requirement is that your source uses the symbol __checksum.
•        
Note: If your source doesn't use the symbol __checksum you will get an error message from IELFTOOL: "The string '__checksum' was not found in the string table".
•        
To be able to link anyway, you can turn on Project > Options... > Linker > Extra Options > mark "Use command line options" and add the command line option "--keep __checksum".
加入这个信息后,link 就不再报错了。对了,我的IAR版本:

IAR Embeded workbench for ARM 7.40.3.8938
IAR Embeded workbench common components 7.2.4.3784

使用特权

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

本版积分规则

8

主题

106

帖子

0

粉丝