Hello,
I'm trying to use hardware CRC module to accelerate checksum computation but unfortunately I'm not getting the same results as when I use software implementation of CRC module from TivaWare library. The CRC alghoritm is CRC16-IBM (polynomial 0x8005).
Example code:
CRCConfigSet(CCM0_BASE, CRC_CFG_INIT_0 | CRC_CFG_SIZE_8BIT | CRC_CFG_TYPE_P8005); uint8_t test_data[4] = {0xFA, 0xFB, 0xFC, 0xFD}; uint32_t hw_crc = CRCDataProcess(CCM0_BASE, test_data, 4, 0); //hw_crc == 0x0000CE75 uint32_t sw_crc = Crc16(0, test_data, 4); //sw_crc == 0x0000A8C1
After call to CRCDataProcess registers looks like this:
I've also tried to omit calling CRCDataProcess and write data directly to registers to rule out any possible bugs, but result is identical:
uint8_t test_data[4] = {0xFA, 0xFB, 0xFC, 0xFD}; CRCConfigSet(CCM0_BASE, CRC_CFG_INIT_0 | CRC_CFG_SIZE_8BIT | CRC_CFG_TYPE_P8005); int i; for(i = 0; i < 4; i++) { HWREG(CCM0_BASE + 0x414) = test_data[i]; } uint32_t hw_crc = HWREG(CCM0_BASE + 0x410);
Is there something wrong with my CRCConfigSet call?