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.

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

Other Parts Discussed in Thread: MSP430G2403

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 said:
    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