PRM generated CRC16 -- How to verify with assembly (no c routines)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

PRM generated CRC16 -- How to verify with assembly (no c routines)

跳至解决方案
2,168 次查看
Adam
Contributor III
With Codewarrior (hc12 v3.1), I am have specified in the prm file that a checksum be added, with this code in the prm:
// Generate the checksum: computed only on page 3e.
CHECKSUM
CHECKSUM_ENTRY METHOD_CRC16
OF READ_ONLY 0x3E8000 TO 0x3EBFFD
INTO READ_ONLY 0x3EBFFE SIZE 2
UNDEFINED 0xff
END
END

This will compute a CRC16 on most of Page 3e and store it in the last two bytes. This is nice as it keeps me from having to make a post linker cript/program to insert my own checksum.

The hc12 build tools manual covers how to set this up, and it works. However, I have a small issue. Metrowerks provides C utilities for verifying this checksum. So, how do I verify this if I only use assembly? I could easily write a routine to do so, except that I have no clue what algorithm was used to generate the crc16 (polynomial, etc).

Can anyone help
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,041 次查看
Adam
Contributor III
Found them, lib/hc12/src/checksum.c

Compile that in and disassemble it will give me what I need.

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,042 次查看
Adam
Contributor III
Found them, lib/hc12/src/checksum.c

Compile that in and disassemble it will give me what I need.
0 项奖励
回复