Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

Calculating der CRC32 by external program

$
0
0
Hi,
I found here: "https://www.infineonforums.com/archive/index.php/t-2114.html" an example written by user freyes on Oct 13th, 2015, 01:30 PM, which seems to be near the method realised on the XMC4500_AB. The only difference is that the bit-wise inversion at the end is not needed. So the method would be:
/*
* https://www.infineonforums.com/archi...hp/t-2114.html
* Arguments:
* 1 CRC_DataPtr: pointer to buffer with 32-bit-values
* 2 CRC_Len: Count of 32-bit-values in buffer
* Return: the calculated CRC32-value
*/
uint32_t MyCRC32(uint32_t * CRC_DataPtr, uint32_t CRC_Len)
{
uint32_t CRC_Value = 0; // CRC_StartValue is 0 !!
while (CRC_Len--)
{
CRC_Value ^= *CRC_DataPtr++;
for (uint32_t i = 0; i <= 31; i++)
{
if (CRC_Value & 0x80000000)
CRC_Value = (CRC_Value << 1) ^ 0x04C11DB7; // Polynomial used in Tricore
else
CRC_Value = (CRC_Value << 1);
}
}
return CRC_Value;
}

At the moment, I have only these short examples:
- from this thread above: Input: 0x20000800, CRC 0x60A105A3
- from elsewhere: Input: { 0xA5C3E10F, 0x08020000, 0xFFFFFFFF, 0xFFFFFFFF }, CRC 0xEF423163
so if there is something wrong, I would appreciate any further information.

Viewing all articles
Browse latest Browse all 9892


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>