Skip to main content
Associate III
May 24, 2024
Solved

How to generate an hex file to use directly for download?

  • May 24, 2024
  • 3 replies
  • 2345 views

Hi,

I'm using TMS570 with SPC5STUDIO environment.

My toolchain generates out.elf and out.hex but I would like to have 

a byte hex stream (without address and other information) directly do use as download by

another microcontroller that lead TMS570.

I have to write a source code to analyze and parse the .hex or

it already exsist that format?

Thanks

Fabio

Best answer by Tesla DeLorean

The format is relatively trivial as object files go, well documented and 40 years or so old.

Tools like SRECORDs can output, modify, etc.

OBJCOPY, OBJDUMP and FROMELF among others can also be used in various forms.

 

http://www.s-record.com/

https://github.com/sierrafoxtrot/srecord

https://srecord.sourceforge.net/

3 replies

Peter BENSCH
Technical Moderator
May 24, 2024

 TMS570 is from Texas Instruments, you might mean SPC570?

Irrespective of this, a hex file in Intel format without address information is quite pointless, as it can consist of sections that are loaded at different addresses. For this reason, I am not aware of any ready-to-use tools. However, if you absolutely want the pure data, you could use external tools to remove the header with colon, record length and address, also the checksum byte at the end.

Hope that helps?
Regards
/Peter

Associate III
May 24, 2024

Hi,

yes sorry SPC570 :(

TMS570 is the other microcontroller that has to be donwload the code into SPC570 and for 

that reason I need a pure data because the other software still know where it must donwload the code.

Which external tool can I use for that?

Thanks

Fabio

Peter BENSCH
Technical Moderator
May 24, 2024

A simple text editor with a macro function, such as Notepad++, can do this without any problems.

Regards
/Peter

Associate III
May 24, 2024

ok thanks

it should be better an external tool called directly by the toolchain or 

integrated into to have the nude data file coming form the toolchain automatically

Fabio

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
May 24, 2024

The format is relatively trivial as object files go, well documented and 40 years or so old.

Tools like SRECORDs can output, modify, etc.

OBJCOPY, OBJDUMP and FROMELF among others can also be used in various forms.

 

http://www.s-record.com/

https://github.com/sierrafoxtrot/srecord

https://srecord.sourceforge.net/

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Associate III
May 27, 2024

Hi Tesla,

many thanks .... I will try

Fabio