Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I combine two hex files created by Keil uVision?

I am using the Keil uVision4 IDE to program an NXP LPC1768. I need recommendations for combining two hex files. The two files are going to be a boot loader and an application that will be used for production programming. Currently, I am successfully able to program each file to the device independently. This is done by running a build on each project and loading via the Keil uVision4 IDE.

Also, is it a valid approach to program the microcontroller with just the boot loader and then use the boot loader to upload the application file?

In regards to effort - I currently have each file built from the IDE. Following each build a hex file is automatically created and then downloaded to the device by using the FLASH->DOWNLOAD option in the IDE. Using the specfic "options for target" within the IDE, I can successfully load the boot at memory address 0x0 and the application at 0x10000.

like image 618
whitedog Avatar asked Mar 20 '23 16:03

whitedog


1 Answers

You can use an application called Hexmate to do this. I think it was created by Microchip a while ago, but you can certainly use it with hex files for other micros. You can find it here: http://www.schmalzhaus.com/Tools/HexmateInstructions.html

The manual is part of the PICC18 manual which can be found here (look at section 5.15): http://ww1.microchip.com/downloads/en/DeviceDoc/manual_STD952.pdf

The command to merge two files, one called "bootload.hex" and one called "mainline.hex" and output them to a file called "merged.hex" is:

hexmate bootload.hex mainline.hex -omerged.hex

Make sure that all 3 files are in the same directory when you execute that line.

like image 182
Seidleroni Avatar answered Apr 02 '23 10:04

Seidleroni