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.

Linux CCS6 MSP430 TI compiler ELF or COFF output to binary?

Greetings all,


Somehow I can't find the utility to convert the MSP430 ELF or COFF output to binary with the TI MSP430 compiler in CCS6.  What did I miss?


Thanks,

Dave

  • Haha, that's funny.  No, I mean "binary" in the classical sense.

  • Disclaimer: I don't use CCS6 nor Linux, but....


    According to <this thread> on another site:

    There is another program in your gnu-toolchain, it should be called msp430-objcopy or msp430-elf-objcopy, it helps to convert binary images. For information invoke this program with the parameter '--help'

  • Thanks, of course the gnu tools will help you do what needs to be done.  However, I'm blessed with the TI compiler on the project to which I've been assigned.  The Windows-based toolchain includes some special .exe (written locally I presume) that just magically converts the final coff  to a binary image.  Why something like that wasn't part of TI's basic toolchain since the very beginning is one of those imponderables...

    So, using the Linux-based TI toolchain, how do I get a binary image of the final elf or coff?

  • David,

    I am not sure what you are trying to do here. Can you please describe more in detail why you need the COFF in binary form? I am guessing that you need to do the firmware update either via bootloader or even JTAG from another host.

    As far as I understand, the COFF/EABI output file contains the output binary image of the MSP430 firmware, but also other informations. For example here is the description of the COFF file structure in detail:

    http://www.ti.com/lit/an/spraao8/spraao8.pdf

    in my opinion, the TI-TXT or Intel-Hex output is the closest representation of the firmware binary inside the COFF/EABI output file.

    There is also a wiki to show how to use the TI toolchain to extract/parse the output COFF file:

    http://processors.wiki.ti.com/index.php/MSP430_COFF_Parser

  • Of course a bootloader would need binary.

    Are you saying that these tools literally can't produce a binary?

  • David,

    I would need more information from you. How do you plan to get the new binary to the host first, and then how are you interfacing the host with the MSP430?

  • Leo Hendrawan said:
    How do you plan to get the new binary to the host first, and then how are you interfacing the host with the MSP430?

    Why does any of that matter? Customer wants a method to get binary output from the tools. Either the tools support it or don't.

    For what it's worth... the IAR Embedded Workbench tools for MSP430 have support for generating a pure binary output file. In fact I use it all the time. And it does this natively.

  • Brian,

    My thought is that you will always somehow the binary file on your PC, and then transfer it to the host (if necessary as the PC might not be the host). So in my opinion, the TI-TXT or Intel Hex should be sufficient, and then you can use e.g. script file to parse the text binary file and then do whatever you want with it. 

  • Leo,

    No disrespect, but that is a pretty narrow view and not representative of a lot of real-world applications.

    As an example, we use a lot of MSP430 devices and they are generally part of a larger system, often connected to DaVinci or OMAP processors via serial port. The MSP devices perform UI or sensor interface functions via a command/control protocol on the serial channel.

    Our systems are in-field reprogrammable, and the host processor (OMAP, etc) stores the binary flash image for the MSP in it's OS file system. On command the MSP430 goes into a reprogramming mode (copies and executes flash programming from RAM) and takes the binary image over the channel and programs the FLASH. (Simplified, there are other checks in there along the way).

    Bottom line is that this is something that IAR toolchain can perform, and appears to be lacking in CCS.

  • Brian,

    understand.

    However depends on how the binary files looks like, I think also you need extra effort for this. If you have a big image file for the whole code memory with all the empty FFs,  this should be ok, you can just push everything there, but you need also to translate it to (if you are using TI BSL) to BSL packets. If the image file is broken down in a kind of TI-TXT, or Intel Hex (with start address and length), you need first to parse the "segments" and then translate it to the BSL packets.

    Anyway the only other option crossing my mind is to use the ofd430 which is described here: http://www.ti.com/lit/pdf/slau131 - chapter 10.1 Invoking the Object File Display Utility. I am also moving this to the compiler forum to get in touch with the compiler team.

    Thanks.

  • Leo Hendrawan said:
    If you have a big image file for the whole code memory with all the empty FFs,  this should be ok,

    Exactly, but the blank regions don't have to be 0xFF. Other tools let you choose what value to put in the blank space.

    Leo Hendrawan said:
    but you need also to translate it to (if you are using TI BSL) to BSL packets.

    We don't use BSL. In some cases we use a custom bootloader with our internally-developed RTOS.

    For the OP, perhaps a workaround for this missing feature is to output an Intel-Hex file and then use a utility (such as Hex2Bin http://hex2bin.sourceforge.net/) to convert.

  • In defense of Mr. Hendrawan, a binary file is more of a concept than a specification.  Most people usually mean a binary file as produced by the Unix utility objcopy.  I presume that is what you mean here.

    The utility tiobj2bin from the cg_xml package can create a binary file from a COFF executable file.

    Thanks and regards,

    -George

  • Hi,
    How about C6000? I exactly want what Brian wants for MSP430.
    Thanks
    mustafa
  • The tiobj2bin utility works on both COFF and ELF files from the C6000 compiler tools.

    Thanks and regards,

    -George