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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,575 Views
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
Labels (1)
Tags (1)
0 Kudos
1 Solution
448 Views
Adam
Contributor III
Found them, lib/hc12/src/checksum.c

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

View solution in original post

0 Kudos
1 Reply
449 Views
Adam
Contributor III
Found them, lib/hc12/src/checksum.c

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