Hi,
I am having the same issue.
The CRC16 value (using 1021) generated by PRM file is different from that generated using code (from the library, C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.2\lib\hc08c\src\checksum.c).
Hi...
This may be a bit late for you now, but I also
had the same problem when I was using the IAR
linker on a project.
Apart from different polynomial values, the algorithm
used to calculate the CRC also varies...
Envisage the CRC calculation as a serial bitstream of
data going into the LSB of a 16-bit CRC register, which
is occasionally XORed with the generating polynomial,
then:
CCITT algorithm will do the XOR if bit 15 of the CRC register
is different from the data bit being shifted in...
Other algorithm will always shift the data bit in, and will do the
XOR if bit 15 of the CRC register is 1....
There are other algorithms around (e.g. MODBUS algorithm
is very different from what I've described above!), BUT I suspect
that the linker will revert to using the CCITT algorithm if the polynomial
chosen is 1021 (with initial value of 0xFFFF), and use the second
algorithm above for all other cases.
[As if this weren't confusing enough, the CCITT algorithm also prepends
two NULs to the data stream... efectively changing the initial value from
$FFFF to $1D0F... this is definitely worth remembering.]
Hope this helps