AnsweredAssumed Answered

CRC-32 for MPC5676R correction required

Question asked by DINESH S on Apr 29, 2017
Latest reply on May 3, 2017 by Lukas Zadrapa

uint8_t index = 0;
uint32_t calculatedCRC = 0;

CRC.CNTX[3].CRC_CFG.B.POLYG = 1; /* To select CRC32 polynomial */
CRC.CNTX[3].CRC_CFG.B.SWAP = 1; /* To select swap in output CRC */
CRC.CNTX[3].CRC_CFG.B.INV = 1; /* inversion applied on CRC output */
CRC.CNTX[3].CRC_CSTAT.R = 0xFFFFFFFF; /*Seed Value*/


for(index= 0; index<inputdata_Length; index++)
{
__stwbrx( inputdata[index],0, &CRC_Engine->CNTX[3].CRC_INP.R );
}
calculatedCRC = CRC_Engine->CNTX[CONTEXT3].CRC_OUTP.R;

can some body help to replace __stwbrx( dataStartAddress[index],0, &CRC_Engine->CNTX[CONTEXT3].CRC_INP.R ); to equivalent C code ,as it is inline assembly code that violates the coding standard or pls share entire in assembly code power pc architecture
__stwbrx( dataStartAddress[index],0, &CRC_Engine->CNTX[CONTEXT3].CRC_INP.R );
is used to handled errata issue in MPC5676R
errta: input value get swapped in CRC_Engine->CNTX[3].CRC_INP.R
if input is 0x1234 to CRC_INP actually feed as 0x3412 to CRC_INP

Outcomes