MPC5746C CRC Module

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

MPC5746C CRC Module

2,329 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
Reply
2 Replies

1,322 Views
mayank22
Contributor II

i am working on CRC implementation for MPC5746C, there is instruction in reference manual in section 76.2.2 which says

"When generating CRC-32 for the ITU-T V.42 standard the user needs to set SWAP_BYTEWISE together with INV and SWAP." 

what does this mean exactly ??

I understand that bit->26 'SWAP_BYTEWAISE' and bit->27 'SWAP_BYTEWISE' applied to input only.

what's the function of bit->30 'SWAP' ?

I am doing this configuration for CRC-32 polynomial. any configuration selection can be taken depending output matches the sunshine calculator.

0 Kudos
Reply

2,220 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