I am trying to use the CRC module to calculate the CRC-32 using the polynomial above. I have another software based implementation I am using to compare the results, with no success so far. I have tried several combinations of seed, bit reversal, endiannes etc. but so far I do not get the same results for the same input data.
The software version of the CRC-32 was taken from FreeBSD code (github.com/.../crc32.c)
I used the first table as well as the code on the comment right bellow it. I compared the outputs with those of online crc calculators (http://www.zorc.breitbandkatze.de/crc.html
I tried changing configurations on the fly (i.e. changing the config registers before calling CRCDataProcess() without success.
What am I doing wrong?
uint32_t calc_crc32 (uint32_t * buf, uint32_t length)
{
uint32_t config = CRC_CFG_INIT_SEED | CRC_CFG_TYPE_P4C11DB7 | CRC_CFG_SIZE_8BIT;
uint32_t seed = ~0U;
// Reset
SysCtlPeripheralReset(SYSCTL_PERIPH_CCM0);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_CCM0)) {}
// Set operation mode
CRCConfigSet(CCM0_BASE, config);
CRCSeedSet(CCM0_BASE, seed);
uint32_t result = CRCDataProcess (CCM0_BASE, buf, length, false);
return result;
}