Keil™, An ARM® Company

Technical Support

GENERAL: MERGING TWO APPLICATIONS INTO ONE INTEL HEX FILE


Information in this article applies to:

  • C51 All Versions
  • C166 All Versions
  • C251 All Versions

QUESTION

I'm developing a bootloader program (project A) and a separate application program (project B). Project A starts at 0000h. Project B starts at 8000h.

I need a single HEX file that contains both programs for device programming. Is there a tool that allows me to do that?

ANSWER

Yes. You may use the HEX2BIN and BIN2HEX utilities (available from the Keil web site) to do this. The following commands combine two HEX files (PROJ_A.HEX and PROJ_B.HEX) and create a single HEX file (COMBINED.HEX):

HEX2BIN PROJ_A.HEX COMBINED.BIN
HEX2BIN /O32768 /M PROJ_B.HEX COMBINED.BIN
BIN2HEX COMBINED.BIN COMBINED.HEX

After the above executes, COMBINED.HEX contains the combined HEX file and COMBINED.BIN contains the combined data in a binary file.

Click on the links below to download the utilities:

If you run the utilities without any arguments, you will see a full list of all the options available for each.

Alternatively, you may use a commercial product like HEX Workshop (available from www.bpsoft.com). They offer an evaluation version that you may download from their web site.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Monday, November 13, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure