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.

Compiler/TMS320F28035: How to know linker generated CRC value

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

Hi,

After some reading, I was able to set the linker to create CRC tables. I want to use the same CRC value in the post-build steps. 

How to know linker generated CRC value after compilation?

  • That is not how the CRC values are intended to be used.  In typical usage, dedicated hardware in the system computes and checks the CRC as part of startup.  The CRC computed by the linker has to match, or some sort of memory corruption is assumed.  

    I suppose it is possible to check the linker computed CRC in some other way, but TI has no support for it.

    Thanks and regards,

    -George

  • Thanks, George.
    I was caught up in another issue.
    I defined something as below in my linked file.

    /*For CRC tables */
    .text : > FLASHH, PAGE=0, crc_table(_crc_table_text, algorithm=CRC32_PRIME )
    .TI.crctab : > FLASHC, PAGE=0

    Here my entire code is in FlashH. Now I want to access _crc_table_text in my main code. so I did something as below.

    //For linked generated CRC table only
    #include "crc_tbl.h"
    #include "crc_defines.h"
    extern CRC_TABLE _crc_table_text; //For infused CRC in the flash

    void main()
    {
    Init();
    Uint32 crc32 = _crc_table_text.recs[0].crc_value;

    }


    This did not compile. It complained about this,

    undefined first referenced
    symbol in file
    --------- ----------------
    __crc_table_text ./main.obj


    What am I missing?
  • For global names written in C code, drop the leading underscore.  In this case, change _crc_table_text to crc_table_text

    I think there are examples of using the linker CRC feature in C2000Ware.  I recommend you organize your code the same way.

    Thanks and regards,

    -George

  • Thanks, George. This resolved my issue.