MPC5746C CRC Module

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPC5746C CRC Module

2,750 次查看
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,

标签 (1)
标记 (3)
0 项奖励
回复
2 回复数

1,743 次查看
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 项奖励
回复

2,641 次查看
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