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.

[FAQ] AM2634: AM263X: MCRC generation procedure using external tool

Part Number: AM2634

Tool/software:

In this FAQ, i am going to explain detailed procedure for MCRC generation using external tool.

  • In this FAQ, i am going to explain detailed procedure for MCRC generation using external tool. For this purpose, i am considering the "sdl_mcrc_full_cpu_example_am263x-cc_r5fss0-0_nortos_ti-arm-clang" example, and in this example, we have multiple use cases so i want to give procedure for CRC generation for each use case in following sections.

    The input data taken for this example is given below:

    All the use cases will use the same buffer(pMCRCData) data that i highlighted above, here size value is 400, so this buffer consists of 100 words of data from 0x00000000 to 0x00000064.

    Use Case-0:

    The configuration for usecase-0 is highlighted below:

    Note that here we are using SDL_MCRC_DATA_64_BIT algorithm.

    The predetermined (reference) CRC for this use case is 0x749E85BFB9257584:

    In our code we are writing data into MCRC signature generation registers as below for SDL_MCRC_DATA_64_BIT algorithm:

    Here in usecase-0, we are not writing entire 64-bit data at a time to the regL and regH at a time, instead of here first we are writing one 32-bit input data to the reg-L and then followed by another 32-bit data to the reg-H, so that means the input data to the CRC generator is as follow:

    0x0000000000000000 0x0000000100000000 0x0000000000000002 0x0000000300000000

    0x0000000000000004 0x0000000500000000 0x0000000000000006 0x0000000700000000

    …………………………………………………………………………………………………………………………………………….

    0x0000000000000060 0x0000006100000000 0x0000000000000062 0x0000006300000000

    Now use below website for CRC calculation verification:

    CRC Calculation Online

    Here first keep the settings as below:

    Now copy our data into the Input data tab to generate the CRC:

    As you can see now our generated CRC from tool is matching with the referenced CRC that is 0x749E85BFB9257584.

    Use case-1:

    We don't need to perform CRC verification for this Use case-1 because,

    use case-1 is designed for negative test case, that means if we enable to perform signature validation for this use case then we will get signature validation fail result.

    The actual CRC for this use case should be 0xEDD1B33EFF852D40, however here intentionally given wrong CRC that is 0x749E85BFB9257584.

    And also note that by default signature validation for this usecase-1 is not enabled to perform:

    Use case-2:

    Similarly for use case-2 also, it is not required to perform this CRC calculation because this case have same configurations as case-0 including reference CRC:

    Use Case-3:

    The configuration for usecase-3 is highlighted below:

    Note that here we are using SDL_MCRC_DATA_32_BIT algorithm.

    The predetermined (reference) CRC for this use case is 0xEDD1B33EFF852D40:

    In our code we are writing data into MCRC signature generation registers as below for SDL_MCRC_DATA_32_BIT algorithm:

    Here in usecase-3 we are writing entire 32-bit data to the regL only and we are not using regH, so that means the input data to the CRC generator is as follow:

    0x00000000 0x00000001 0x00000002 0x00000003

    0x00000004 0x00000005 0x00000006 0x00000007

    …………………………………………………………………………………………………………………………………………….

    0x00000060 0x00000061 0x00000062 0x00000063

    Now use same website for CRC calculation verification:

    Now copy our data into the Input data tab to generate the CRC:

    As you can see now our generated CRC from tool is matching with the referenced CRC that is 0xEDD1B33EFF852D40.

    Use Case-4:

    The configuration for usecase-4 is highlighted below:

    Note that here we are using SDL_MCRC_DATA_16_BIT algorithm.

    The predetermined (reference) CRC for this use case is 0xB33EFF852D4885EB:

    In our code we are writing data into MCRC signature generation registers as below for SDL_MCRC_DATA_16_BIT algorithm:

    As the device is a little endian so the memory data will be as follow after we type cast into 16-bit (Least halfword at lower address):

    Here in usecase-4 we are writing entire 16-bit data to the regL only, so that means the input data to the CRC generator is as follow:

    0x0000 0x0000 0x0001 0x0000

    0x0002 0x0000 0x0003 0x0000

    …………………………………………………………………………………………………………………………………………….

    0x0062 0x0000 0x0063 0x0000

    Now use same website for CRC calculation verification:

    Now copy our data into the Input data tab to generate the CRC:

    As you can see now our generated CRC from tool is matching with the referenced CRC that is 0xB33EFF852D4885EB.