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: What is the Value for (Polynomial, Initial value, Final XOR, Inverted Input, Inverted Output) in CRC32

Part Number: AM2634

Tool/software:

Hi teams,

I am using AM2634 MCU in that i am working on the SDL_MCRC_FULL CPU examples I have few doubt's on this example.

1. In the below image you are Taking the data and you are doing CRC.

    

    so, Instead of this I Tested my own data to calculate the CRC like below

   

so, from this value i am getting some CRC value(i attached below)



but i couldn't able to find those values (Polynomial, Initial value, Final XOR, Inverted Input, Inverted Output),because without those values how they where calculating CRC?

2.   I referred TRM in that i could able to find the polynomial for crc32
     

  but if you see that those polynomial are not in the hex. because my understanding is that we need 
   

all the value required to CRC Sunshine's Homepage - Online CRC Calculator Javascript (sunshine2k.de) 

My doupt is that what is the (Polynomial, Initial value, Final XOR, Inverted Input, Inverted Output)? used in the SDL_MCRC_FULL example?can you mention what are the value using for doing crc32 calculation.

  • Hi Aakash,

    The CRC-64-ISO is used by MCRC on AM263x device. The polynomial is f(n) = X^64 + X^4 + X^3 + X^1 + 1

    The computation is performed by the MCRC hardware. Normally the initial value of CRC is 0xFF, and final XOR is 0x00. I don't know the inverted Input and output used in CRC computation.

    The CRC64 in Sunshine2k may use different polynomial from MCRC does. 

    For SW solution, pleas refer to 

    crc64iso/crc64iso/crc64iso.py at master · blievrouw/crc64iso · GitHub

  • Hi QJ Wang,

    Thank you for your answer, I need some more clarification 

    1. I understand that the MCRC module is using a 64 bit CRC calculation, i want check 32 bit CRC of memory in that case how can configure the module?Because i need to implement the crc32 only not 64 how to customize it?
    2. CRC is calculation is done in the MCRC module in that how they were calculating? were can we refer?
  • Hi Aakash,

    CRC32 and CRC64 use different polynomial formulas which generate different check values (or CRCs) for the same input data. 

    At start up, the CRC algorithm sets the CRC to the initial CRC value (0xFFFFFFFFFFFFFFFF) XOR the input data (dividend). Once the CRC MSB is equal to 1, algorithm shifts CRC one bit to the left and XORs it with the polynomial. Otherwise, it only shifts the CRC one bit to the left. Repeat this process, the remainder is the CRC value or check value.

  • Hi QJ Wang,

    Thank you For Your Replay,

    I have the Doubt,



    1. I can see in SDK they provided the example which is Related to CRC-64,

    But My Requirement i need to use the MCRC peripheral in CRC32 not in CRC-64. how?

    2. I can see below are the certain polynomial which is supported for this controller. 

    Here, I want to change my Polynomial from CRC64 to CRC32 how to configure and can you say what are all the things i need to change to get CRC32?


  • Hi Aakash,

    The polynomial can be selected by the value of CRC_CTRL0[12:11] and CRC_CTRL0[4:3]:

    000: CRC-64
    001: CRC-16
    010: CRC-32