• TI Thinks Resolved

[FAQ] Explain the format of a binary (.bin) file

Tool/software: Code Composer Studio

Hello. I have an MSP430G2403 and I need to write a small bootloader. From a file format .out I receive by means of a strip file the format .bin. Help me find the datasheet on the bin format, where it is written in which segment and to which address the program code is located.

P.S.: Sorry for bad english(

  • I presume this .bin file is created by using either tiobj2bin or some variant of objcopy.

    There is no industry standard format for a .bin file.  objcopy started as a Unix utility.  Here is the objcopy man page entry on a .bin file ...

    When objcopy generates a raw binary file, it will essentially produce
    a memory dump of the contents of the input object file. All symbols
    and relocation information will be discarded. The memory dump will
    start at the load address of the lowest section copied into the output
    file.

    I think of it as a dump of the initialized raw data sections.  Any holes in the memory map, however that may occur, are filled with zero.  The length of the raw data is not encoded directly, but is implied by the length of the file.  

    Vitaliy Kvitov
    to which address the program code is located.

    This information is not encoded anywhere in the .bin file.  It is maintained separately by some other unspecified method.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.