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.

TMS320F28379D: C2000 Hex Utility "--binary" option generates incomplete output

Part Number: TMS320F28379D

Hello,

It seems that binary option ("--binary") in C2000 Hex utility doesn't generate all words, specifically there are 4 missing. 2 0x0000's right before .text section, and the other 2 0x0000's between .text and .econst sections. Then, as this 4 words are not generated, at some point when linking a function call, an illegal instruction is executed because of the FLASH data shifting.

This problem doesn't happen if, instead of using "--binary" option, "--array" option is used. This option generates an ASCII file with a const variable initialized with all the data properly set (including the 4 missing wordst). It works perfect.

With this problem, if I want to generate with "--binary" option then once it is programmed into FLASH it will not work. As a temporary solution I can generate with "--array" option and implement a python script which converts the ascii generated file into a binary file, although there should not be need for that.

Can anyone tell me why those 4 words are missing or confirm that it is a bug from "--binary" option in C2000 Hex utility?

PD: if anyone wonders why I want to use "--binary" option when "--array" option works, the answer is that they are for different purposes. I was doing a little example to program FLASH with a hardcoded binary (which should be done with "--array" option) but in case you want to implement a full bootloader with a communication interface (which is what I am doing right now) then the right option is "--binary".

Best regards,

Adria

  • Please submit a test case which illustrates the difference between --array output and --binary output.  Include the following:

    • Version of the hex utility
    • Command line for each invocation of hex2000, with --array and --binary
    • The input files used by hex2000

    Please zip up the input files (even if it is just one file) and attach that to your next post.

    Thanks and regards,

    -George

  • Hello George,

    Thanks for your answer, please find below your requested information:

    1. Version of the hex utility: I have checked it by executing "./hex2000 -h" in tool directory. The important part of the output is:

    "TMS320C2000 Hex Converter               v18.1.3.LTS"

    It seems that hex utility has the same version as compiler.

    2. Command line with array option:

    /path_to_hex_utility_bin/hex2000 --array -o "blinky_cpu01.bin"  "blinky_cpu01.out"

    Command line with binary option:

    /path_to_hex_utility_bin/hex2000 --binary -o "blinky_cpu01.bin"  "blinky_cpu01.out"

    3. It is the same input file for both commands ("--binary" and "--array"). Please find attached file "input_file.zip".input_file.zip

    Best regards,

    Adria

  • Thank you for sending in the test case.  

    The best way to get the binary file you want is to use the utility tiobj2bin from the cg_xml package.  

    You are correct to point out that --binary and --array do not work the same way.  The option --binary ignores holes between sections.  The option --array fills holes between sections with the value 0.  You can get --binary to fill holes with 0 if you specify the system memory range with a ROMS directive, and use the -image option.  In final effect, this is what the utility tiobj2bin automatically does for you.  This explanation is a bit short.  I'm not sure how much you want to know.  Feel free to press me for more detail.

    Thanks and regards,

    -George

  • Hello George,

    Thanks for your answer!

    There is no need to install cg_xml_package because I found tiobj2bin script in /ccs_instlallation_path/utils/tiobj2bin/. I opened it and found, as an explanatory comment, how to call it from Post-build steps in CCS. So, just copy-pasting this line into corresponding CCS project properties section it works perfect.

    Best regards,

    Adria