AnsweredAssumed Answered

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

Question asked by Adam Oldham on Aug 4, 2006
Latest reply on Aug 4, 2006 by Adam Oldham
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

Outcomes