I am trying to use the CRC module.
I'm not having any fun.
It seem that no matter what I do, the calculated CRC value is incorrect.
I tried searching for examples and came upon the following:
Which points to an example
Unfortunately, the file does not exist.
My attempt at getting the CRC module to work.
calc_crc_32(UINT8* _ptr, UINT32 _size)
UINT32 iter = 0;
CRC.INP.R = 0;
CRC.CSTAT.R = 0xFFFFFFFF;
CRC.OUTP.R = 0;
//0xA453C517 // Output with both INV and SWP 0
//0x175C35DA// Output with both INV and SWP 1
//0x868A4C74 // Output with both INV and SWP 1 and BYTEWISE = 1
CRC.CFG.B.INV = 1; //Set to 1 for CRC-32
CRC.CFG.B.POLYG = CRC_32;
CRC.CFG.B.SWAP = 1; //Set to 1 for CRC-32
CRC.CFG.B.SWAP_BITWISE = 0;
CRC.CFG.B.SWAP_BYTEWISE = 1;
for(iter=0; iter < _size; iter++)
CRC.INP.R = _ptr[iter];
I fixed the problem, the example is available again:
Thanks for pointing this out.
Please check the example and let me know if you still can't make it working. It worked as expected on my side.