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.

CCSV6 .bin file creation problem

Other Parts Discussed in Thread: TMS320F2808

Hello all, 

I am having some trouble with generating a binary output (.bin) file from an C2000 example project at CCS6.1. (variant : TMS320F2808). I have followed the steps mentioned in the wiki and forum discussions ( links below ): 
http://processors.wiki.ti.com/index.php/Projects_and_Build_Handbook_for_CCS#Pre_and_Post_Build_Steps 
https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/362725 
http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/68158 

"${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd2000" "${CG_TOOL_ROOT}/bin/hex2000" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"

With the c2000 hex utility I receive my .hex file normally, but however ,
although I receive a generated .bin file the information within it consists of unreadable symbols ( attached file ). 

Here is also the summary of flags set:
--fill=0x00000000 --image --memwidth=8 --ti_txt --binary

Any suggestions would be highly appreciated!

Thank you in advance!

-Kalo

  • I might be wrong.  But I suspect you misunderstand the details of what is contained in a binary file or a hex file.

    A binary file contains the raw binary bits that are present in system memory when execution begins.  When you attempt to look at it with a plain text viewer, it groups those bits into 8-bit bytes and tries to display them as if they are all ASCII characters.  A few of those bytes may actually be ASCII characters, a few other bytes might just happen to map to ASCII characters even though that is not what they really are, and most of the bytes are not ASCII characters at all.  That's why you mostly see nonsense.

    A hex file contains a representation of the same stream of bits.  Regarding the binary bits directly, two mappings occur.  One, every four bits is mapped to a hex value.  Second, each hex value is mapped to the ASCII character for that hex value.  In addition to that mapping of the binary bits, other meta-data is added.  By meta-data I mean things like the : that starts every line, address records, byte counts, check sums, and so on.  

    Thanks and regards,

    -George

  • Thank you for your fast response, George! 

    I am trying to generate a .bin file in CCS by following the given instructions from the wiki and the other abovementioned topics from the forum. 
     Could you please give a step by step walkthrough on how to do so without receiving unreadable characters on my bin file.

    Thank you in advance!

    Best regards,

    Kaloyan 

  • Kaloyan Grigorov said:
    please give a step by step walkthrough on how to do so without receiving unreadable characters on my bin file.

    That's impossible.  I'll try to show why with this example.

    Presume, just for the sake of discussion, that your entire program consists of one NOP instruction.  The opcode for NOP is 0x7700.  Here is what that looks like using gvim (a plain text editor I use) ...

    Notepad views it this way ...

    Note the ASCII value for the character "w" is 0x77.  So, it is not surprising to see the w character.  Note how it is in the second position. That is because instruction opcodes are in little endian order in C28x.  The other byte is 0.  You can see how different plain text editors handle that 0.

    I hope this makes it clear that any .bin file will contain lots of bytes that do not map to ASCII character values.  And that is why it is impossible to avoid unreadable characters.

    Thanks and regards,

    -George