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.

AM2634-Q1: CRC-16/IBM-3740 Calculation Using MCRC Module on TI AM2634 Controller

Part Number: AM2634-Q1
Other Parts Discussed in Thread: AM2634

Tool/software:

Hi TI Team,

I am using the TI AM2634 controller and working with the MCRC module. My requirement is to calculate CRC-16/IBM-3740 with the following parameters:

Polynomial: 0x1021
Initial value: 0xFFFF
Input reflection: False
Result reflection: False
Final XOR value: 0x0000

Can this specific CRC-16 calculation be performed directly by the MCRC hardware module in the AM2634? Or do I need to implement this CRC calculation separately in software to meet this?

Thanks,
Rahul

  • Hi Rahul,

    Thanks for reaching out. This should be possible, but it isn't clear to me how this would be handled from a software perspective. I am looping in a fellow expert to provide additional feedback for application level usage of the MCRC.

    In the meantime, please refer to the thread below where similar functionality was implemented via MCAL MCRC.

    (+) AM2634: Doubts regarding mcrc module - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Best Regards,

    Zackary Fleenor

  • Hi Zackary,

    From a software perspective, I am referring to implementing CRC using C code in the application.

    For ex -

    uint16_t crc16_ibm3740(const uint8_t *data, size_t length) {
        uint16_t crc = CRC16_IBM3740_INIT;
        int i, j;
        
        for (i = 0; i < length; i++) {
            crc ^= (uint16_t)(data[i] << 8);
            for (j = 0; j < 8; j++) {
                if (crc & 0x8000) {
                    crc = (crc << 1) ^ CRC16_IBM3740_POLY;
                } else {
                    crc = crc << 1;
                }
            }
        }
        
        return crc;
    }

    Thanks,
    Rahul

  • Hi Rahul,

    Polynomial: 0x1021
    Initial value: 0xFFFF
    Input reflection: False
    Result reflection: False
    Final XOR value: 0x0000

    Our CRC-16 polynomial is matching with yours.

    Please test it at your end with our MCRC-16 polynomial once. Regarding, initial value, input reflection and output reflection even if they didn't match, we can do some software workaround on top of the MCRC module. If you want default values of these parameters in MCRC, then i will test and let you know.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Using the settings mentioned below, I am getting a CRC16-XMODEM result. When I pass the data 0xAAAAAAAA, the output I get is 0x1E95, which corresponds to CRC16-XMODEM. Could you please let me know what settings I should use for CRC-IBM3740?

    static SDL_MCRC_Config_t SDL_MCRC_Config =
    {
         SDL_MCRC_CTRL0_CH1_CRC_SEL_16BIT,
         SDL_MCRC_DATALENGTH_16BIT,
         SDL_MCRC_DATA_16_BIT,
         SDL_MCRC_BITSWAP_MSB,
         SDL_MCRC_BYTESWAP_DISABLE
    };

    Thanks,
    Rahul

  • Hi Rahul,

    I am off for a week due to personal work, so i didn't get time to look into this issue.

    Are you still stuck with this issue?

    --
    Thanks & regards,
    Jagadish.