Hi,
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:
CRC signature value is different after flash write
Which points to an example
Example MPC5748G CRC32 GHS614
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];
}
return CRC_OUTP;
}
Thank you,