Hello,
I'm trying to validate the output of the TMS570 CRC with an external reference without success.
I've used this link as a reference(in another post in E2E forum):
The pycrc project supports this algorithm:
http://www.tty1.net/pycrc/index_en.html
The code used for the computation is as follows(Code idebtical in functionality from another post on E2E forum ) :
uint64 CRC_CalcCRC(const uint8 *ubData, uint8 ubSize, bool bCRCReset)
{
uint8 count;
uint64 result = 0;
uint64 tempC;
if( bCRCReset )
{
/* reset CRC module */
sCRC_t->CRC_CTRL0 |= 1;
sCRC_t->CRC_CTRL0 &= ~1;
}
/* Configure the CRC controller */
/* configure full CPU mode */
sCRC_t->CRC_CTRL2 = 0;
sCRC_t->CRC_CTRL2 = 3;
for(count = 0; count < ubSize; count++)
{
sCRC_t->PSA_SIGREGL1 = ubData[count]; /* write a byte at address 0xFE000060 */
}
tempC = sCRC_t->PSA_SIGREGH1;
result = (uint64)((uint64)sCRC_t->PSA_SIGREGL1 | (tempC <<32));
return result;
}
The bytes array used for the computation is "123456789"
The output from the TMS570 CRC64 is 0x000002F9AE1A415B.
The actual CRC from the python project above (for the same reference string) is 0xE4FFBEA588933790.
Not close.
Any idea what is wrong ?
Thanks for your help
Regards,
Normand