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.

why Intel 32bit hex file can run on TMS570LS MCU

Other Parts Discussed in Thread: TMS570LS20216

Hi TI experts,

I'm now developing TMS570LS20216, using CCS 4.2.3 IDE, when build in CCS, it will generate *.out file, and i use hex470.exe generate a 32bit intel hex file.

TMS570 is big-endian, Intel hex is little-endian format, so, I'm wondering why inter 32bit hex file can run on TMS570? How does it achieve this? Could you explain this for me. Thanks.

  • Hi Fumin,

    The format of the file and the format of the code on the device are two separate things. Ultimately, as long as the device you use for programming understands the format of  the file, it doesn't matter that the processor is big endian and the file format is little endian.

    As I'm sure you are aware the options for hex470 are described in http://www.ti.com/lit/ug/spnu118j/spnu118j.pdf

    Regards,
    Richard

  • Hi Richard,

    Thanks for you kindly reply. I don't catch this sentence "The format of the file and the format of the code on the device are two separate things. ".

    can you explain in details? and what's the difference and what's the purpose of the format of hex file and format of code on device ?

    Does TMS570(32bit MCU) can run 16bit intel hex format ? and why?

    Highly appreciated if you can give a link to me for understanding these questions.

  • Hi Fumin,

    The byte order in the hex file (little endian) is not directly related to the byte order in the processor (big endian). When you generate a hex file (using hex470 in this case), the format of the output file must meet the specification for that type of hex file. Alternatively you could generate an ELF file and program the processor from that provided that your programmer understands ELF format (and NowFlash does).

    When you program the hex file into the TMS570 (using NowFlash for example), the programmer reads data from the hex file and formats it into commands that are sent to the processor through the JTAG interface. The processor stores the program in flash memory that is organised as 32 bit words.

    To summarise, the processor does not actually run the Hex file, it runs the image that is stored in its flash memory. The hex file is simply a way of representing the data in a well defined format.

    I hope this answers your question!

    Regards,
    Richard

  • Hi Richard,

    Thanks for your detailed answer.

    could you confirm my understanding: the hex fomat is only for conveying data from compiler build output file to flash programmer(e.g nowflash), so, as long as flash programmer can understand the data format from compiler build output file, it don't care the hex file is in intel format or motorola format, and also don't care the hex format endianess, right? The flash programmer will translate the hex file into the right format that target processor can run, right?

    And another question:

    Does TMS570(32bit processor) can run 16bit intel hex format ? and why?

  • Hi Fumin,

    Your first statement is correct. We tend to use either Intel Hex 32 bit format or ELF format.

    As I recall the different intel hex formats primarily relate to the address size. The main limitation of 16 bit Intel hex format is that it can only address 64 KBytes. The 32 bit format enables the full 4GByte range to be addressed. As far as I am aware the largest TMS570 devices have 3 MBytes flash. In order to be able to store a program that is longer than 64 KBytes you therefore need to use the 32 bit Intel hex format.

    Regards,
    Richard