This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: TMC4C1294 HW CRC problem

Part Number: TM4C1294NCPDT

Hey I was hoping the E2E community could help me out. I am having issues with the HW CRC in a TM4C1294 uC. We use the Tivaware calls to access the peripheral.

Here is some example code the result I get is: 0xBE33EAB6.


From an online CRC calculater I get these result when I input the same as in the example (0001020304).

we need this CRC check to cummunicate with a desktop application that we also develop.

In the desktop application we are able to get the CRC codes as shown in the table below. So what are we doing wrong in the TM4C1294?

    uint32_t result;
    uint8_t buf[5];

    buf[0] = 0;
    buf[1] = 1;
    buf[2] = 2;
    buf[3] = 3;
    buf[4] = 4;
    
    CRCConfigSet(CCM0_BASE,CRC_CFG_SIZE_8BIT | CRC_CFG_TYPE_P4C11DB7 |CRC_CFG_INIT_SEED);
  
    CRCSeedSet(channel->Base, 0);
    result = CRCDataProcess(CCM0_BASE, buf, sizeof(buf),false);
  • It appears to me that the algorithm for CRC-32 used on the website you cited uses a 32-bit implementation. The following code gives 0x9F68AA88 which matches the CRC-32 Reversed 0xEDB88320 pattern from the website:

    main(void)
    {
        uint32_t ui32SysClock;
        uint32_t result;
        uint8_t buf[8];
    
        //
        // Run from the PLL at 120 MHz.
        //
        ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                           SYSCTL_OSC_MAIN |
                                           SYSCTL_USE_PLL |
                                           SYSCTL_CFG_VCO_480), 120000000);
    
        SysCtlPeripheralEnable(SYSCTL_PERIPH_CCM0);
    
    
        buf[0] = 0x00;
        buf[1] = 0x01;
        buf[2] = 0x02;
        buf[3] = 0x03;
        buf[4] = 0x04;
        buf[5] = 0x05;
        buf[6] = 0x06;
        buf[7] = 0x07;
    
        CRCConfigSet(CCM0_BASE, (CRC_CFG_INIT_1 | CRC_CFG_TYPE_P4C11DB7 | CRC_CFG_IBR | CRC_CFG_OBR |
        CRC_CFG_SIZE_32BIT | CRC_CFG_RESINV));
    
        result = CRCDataProcess(CCM0_BASE, (uint32_t *)buf, 2, true);
       	return result;
    }