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.

MSP430 .Out File Size



I have a question  about the .out file being generated by the Code composer.

 

The binary .out file being generate is around 40 Kb for me but when I press debug, in the console it says, MSP430: Program loaded. Code Size - Text: 638 bytes  Data: 140 bytes

 

Can anyone explain it to me why this difference? What can I do to reduce my file size? What are the default options? Which options can help me reduce file size?

  • Teh .out file is NOT just binary data. It also contains informations about what to put where and which code byt ebelongs to which source line. Also, variable and function names are contained. Without this information, debugging would be impossible.

    You can reduce the filesize by converting the file to a Ti TXT file. Then it only contains the binary data, address informationand checksum in hexadezimal numbers format, app. 4 times as large as the raw binary data. But then you cannot debug anymore. In both cases, only the 638+140 bytes code are put into the MSP by the programming function.

     

  • So my next question would be,

     

    If I want to store a firmware image of the MSP4305438 in external flash, which file format should I store?  How do I generate just the file I want to program the MSP4305438?

     

    -Harsh

  • I think the installation of CCE (and maybe others) contains a program for converting the OUT file into TIs HEX or TXT format.
    Then there are two ways to deal with the data: Either you extract the binary values into a plain binary file and store this, or you transfer the (bigger) HEX value and extract the binary data while doing the program update. The HEX format is relatively straight forward:

    Also, the OUT format should be well documented (a.out is the default name and it is the standard format in the linux world), so you could write a small ustility which extracts the binary data.

    Example content of the .HEX format:
    :100000000C94770D0C94340E0C94340E0C94340E26
    :08FF1000616263646566000094
    2 digits number of bytes in this line, 4 digits address, 2 digits 00, then 0..16*2 digits data and 2 digits checksum.

    Even easier to parse (yet without checksum) is the Ti .txt format:
    @fe00
    01 00 00 00 00 04 00 00 ff ff 00 00 00 00 00 00
    If a line begins with an @, the destination address follows. If it is a 'q'it is the end of the file and in any other case, teh line contains the data bytes in hex values.
    The destination address is 16 bit only (AFAIK)., so it cannot address the area from 0x10000 on. Nevertheless, data blocks are usually sorted in ascending order, so if a @0000 follows a @5c00, it means @10000 etc.

**Attention** This is a public forum