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.

TMS320F28P559SJ-Q1: How to generate the "data only" hex file

Part Number: TMS320F28P559SJ-Q1

Tool/software:

Hi Expert

Customer need to generate customized the S/W version information and downloaded to flash_bank_4, it should be a hex file data which is appended to the APP hex file. How can customer generate those data with CCS?

Thanks

Joe

  • It is probably better to encode the version information directly in the executable .out file, then extract it from there.

    Add lines similar to these in one source file:

    __attribute__((retain))
    static const char version_string[] = "VERSION: 1.2.3";

    Then dump the executable file to ASCII characters with a command similar to ...

    od -Anone -w200 -c file.out > dump.txt

    In that command, -w200 means dump 200 characters per line.  This reduces, but does not eliminate, the chance the version string spans two lines.  Inspect dump.txt to find something similar to ...

     V  \0   E  \0   R  \0   S  \0   I  \0   O  \0   N  \0   :  \0      \0   1  \0   .  \0   2  \0   .  \0   3  \0

    That's because the type char is 16-bits wide on C28x.  Viewed like this, there is a byte of 0 between each ASCII character.  With most text editors, you can automatically change that to something close to:

    VERSION: 1.2.3

    Thanks and regards,

    -George