Keil Logo

µVISION: Creating Intel Hex Files for Arm-Based Devices


Information in this article applies to:

  • µVision Version 4 or later

QUESTION

How do I create an Intel HEX file using the Keil µVision IDE?

ANSWER FOR ARM DEVICES

Using the IDE

  1. Open the project in the Keil IDE
  2. Click the drop-down menu Project, then select Options for Target
  3. Select the Output tab
  4. Check Create HEX File
  5. Click the OK button
  6. Click the drop-down menu Project, then select Rebuild all target files - if the project builds without errors, the linker creates a hex file in the same location as the object files

What's going on here: By setting these options, (if the build succeeds) the the Keil IDE calls the the fromelf Image Converter to create a hex file. Call fromelf.exe directly, rather than the indirectly with the Create HEX File checkbox, to set additional options.

Using Fromelf.exe

Configure the µVision project to generate the hex automatically as follows:

  1. Go to Options for Target - User - After Build/Rebuild
  2. Check "Run #1"
  3. Enter the following in the "User Command" path (where "myprog" is the project's "Name of Executable")
C:\Keil\ARM\ARMCC\bin\fromelf.exe --hex --output=myprog.bin myprog.axf

...or with key sequences

$K\ARM\ARMCC\bin\fromelf.exe --hex--output=@L.bin !L

You can specify the base address of the output with the --base option.

From now on, after a Build, the IDE automatically calls fromelf.exe.

For Older versions of Keil the executable may instead be in the this folder

C:\KEIL\BINxx\FROMELF.exe

...where xx is 31 or 40, depending on the software version.

ANSWER FOR 8051, 251 AND 166 DEVICES

See µVision: Hex Output File for a Device Programmer.

MORE INFORMATION

SEE ALSO

Last Reviewed: Tuesday, December 8, 2020


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.