MPC5746C CRC Module

cancel
Showing results for 
Search instead for 
Did you mean: 

MPC5746C CRC Module

225 Views
cholland
Contributor V

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,

Labels (1)
Tags (3)
0 Kudos
1 Reply

116 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Christopher,

I fixed the problem, the example is available again:

https://community.nxp.com/docs/DOC-332223 

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.

Regards,

Lukas