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.

CRC_TABLE value in flash not math to value in map & xml file

Hello!

I want math map file with firmware version. I add crc_table keyword to linker cmd file. crc_table in memory contains crc_value field. This field contains 64 bit value.  .map file & xml.file contains 32bit value.  Where is error?

===============C code=======
extern CRC_TABLE crc_table; uint64_t get_flash_crc(void) { uint64_t i; uint64_t res = 0; for (i = 0; i < crc_table.num_recs; i++) { uint64_t val=crc_table.recs [i].crc_value; // res ^= val; printf("crc_val=0x%016llX\r\n", val); } return res; }

=============C code output======

crc_val=0x19F7FE3ECAD7EC6C
crc_val=0xE1EA649C3D1C4B81
crc_val=0xFAE17A96B265E31C
crc_val=0x00743C1800000000
crc_val=0x81E7E980829E2267
crc_val=0xDD2252DE85854DB9
crc_val=0x97D8C51F44450053

=======map file======

LINKER GENERATED CRC TABLES

crc_table @ 00052658 records: 7, size/record: 24, table size: 176
    .intvecs: algorithm=TMS570_CRC64_ISO(ID=10), load addr=00020000, size=00000020, CRC=00000000cad7ec6c
    .kernelTEXT: algorithm=TMS570_CRC64_ISO(ID=10), load addr=00020020, size=0000438c, CRC=000000003d1c4b81
    .cinit: algorithm=TMS570_CRC64_ISO(ID=10), load addr=000243b0, size=000002e0, CRC=00000000b265e31c
    .FLASH_STATE_PTR: algorithm=TMS570_CRC64_ISO(ID=10), load addr=00028000, size=00000004, CRC=0000000000000000
    .text: algorithm=TMS570_CRC64_ISO(ID=10), load addr=00028008, size=00029234, CRC=00000000829e2267
    .const: algorithm=TMS570_CRC64_ISO(ID=10), load addr=00051240, size=00001404, CRC=0000000085854db9
    .FLASH_STATE: algorithm=TMS570_CRC64_ISO(ID=10), load addr=00052648, size=0000000c, CRC=0000000044450053
==========xml file=======

   <crc_table_list>
      <crc_table>
         <name>crc_table</name>
         <crc_rec>
            <name>.intvecs</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x20000</load_address>
            <load_size>0x20</load_size>
            <crc_value>0xcad7ec6c</crc_value>
         </crc_rec>
         <crc_rec>
            <name>.kernelTEXT</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x20020</load_address>
            <load_size>0x438c</load_size>
            <crc_value>0x3d1c4b81</crc_value>
         </crc_rec>
         <crc_rec>
            <name>.cinit</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x243b0</load_address>
            <load_size>0x2e0</load_size>
            <crc_value>0xb265e31c</crc_value>
         </crc_rec>
         <crc_rec>
            <name>.FLASH_STATE_PTR</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x28000</load_address>
            <load_size>0x4</load_size>
            <crc_value>0x0</crc_value>
         </crc_rec>
         <crc_rec>
            <name>.text</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x28008</load_address>
            <load_size>0x29234</load_size>
            <crc_value>0x829e2267</crc_value>
         </crc_rec>
         <crc_rec>
            <name>.const</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x51240</load_address>
            <load_size>0x1404</load_size>
            <crc_value>0x85854db9</crc_value>
         </crc_rec>
         <crc_rec>
            <name>.FLASH_STATE</name>
            <alg_name>TMS570_CRC64_ISO</alg_name>
            <alg_id>0xa</alg_id>
            <load_address>0x52648</load_address>
            <load_size>0xc</load_size>
            <crc_value>0x44450053</crc_value>
         </crc_rec>
      </crc_table>
   </crc_table_list>

  • Vladimir Romanov said:
    This field contains 64 bit value.  .map file & xml.file contains 32bit value.  Where is error?

    The map file and XML file are in error. 

    Do you use the TI ARM compiler?  What version?  For right now I presume you use TI ARM compiler version 5.2.5.

    The CRC value is 64-bits.  You can see this in the include file crc_tbl.h, which is in the /include directory of the compiler installation.

    /*********************************************************/
    /* CRC Record Data Structure                             */
    /* NOTE: The list of fields and the size of each field   */
    /*       varies by target and memory model.              */
    /*********************************************************/
    typedef struct crc_record
    {
    uint64_t         crc_value;
    uint32_t         crc_alg_ID;    /* CRC algorithm ID */
    uint32_t         addr;          /* Starting address      */
    uint32_t         size;          /* size of data in bytes */
    uint32_t         padding;       /* explicit padding so layout is the same */ 
                                    /* for COFF and ELF                       */
    } CRC_RECORD;
    
     
    /*********************************************************/
    /* CRC Table Data Structure                              */
    /*********************************************************/
    typedef struct crc_table
    {
    uint32_t         rec_size;
    uint32_t         num_recs;
    CRC_RECORD       recs[1];
    } CRC_TABLE;

    I think I can reproduce this bug on my own.  If not, I may ask you for a test case.  Once I have reproduced the error, I'll submit a bug report and let you know the ID number.

    Thanks and regards,

    -George

  • CRC_Test.zipHello!

    I use TI ARM Compiler 5.2.6. Same problem with 5.2.4. My target platform TMS570. You can found very simple sample in attachment

  • Thank you for reporting this problem.  I can reproduce the same results.  I filed SDSCM00052430 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George