small utility to merge selected data from two hex files

Aug 23, 2007 3 Replies

All,



I wrote a small tool for my own use, which some of you may find useful also. It allows to merge selected address ranges from two Intel hex files into a new hex file (currently limited to 64KB hex files).



I use it to copy calibration information in flash (which is stored at a known location) from an existing hex file into a newly compiled hex file where the calibration information is still blank, using this command:



hexmerge firmware-nocal.hex 0:FFFF calibration.hex F000:FFE0 firmware.hex



Program and source can be downloaded from:

formatting link
(hexmerge utility).



greetings, Tom



Not wanting to rain on your parade, but why not just concatenate the two files?

Hi Tom,

You may also find this of interest.

formatting link

David T. Ashley (dta@e3ft.com) http://www.e3ft.com (Consulting Home Page) http://www.dtashley.com (Personal Home Page) http://gpl.e3ft.com (GPL Publications and Projects)

On Aug 23, 10:24 pm, snipped-for-privacy@mojaveg.lsan.mdsg-pacwest.com (Everett M. Greene) wrote: [...]

To answer literally, because then you'd wind up with an EOF record in the middle of your file. But that's easy to fix.

Another problem is that the second file may overwrite values specified in the first. That sometimes causes problems with tools designed to read hex files. I'm thinking of a particular EPROM programmer I used in the past that would write the hex records to the EPROM in order. If the first file sets a location to 0x05, and the second tries to set it to 0x55, it's not pretty.

Regards,

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required