How to Generate .bin Files in Keil/MDK

By default, Keil/MDK can generate ***.axf and ***.hex files. To generate a ***.bin file, you first need to know what tool is used for this process.

The fromelf.exe conversion tool is part of the development suite provided by ARM, and it is already located in the installation folder when you install MDK. This tool is used to generate the ***.bin file.

Steps to follow:

1. Search for fromelf.exe or fromelf in the MDK installation folder, find and open the folder where fromelf.exe is located, and note down the file path.

How to Generate .bin Files in Keil/MDK

2. Open the Keil project properties (magic wand) Option for Target “xxx”, select the User tab, check the Run User Programs After Build/Rebuild option under Run #1, and then fill in the following in the box: D:\Keil\ARM\ARMCC\bin\fromelf.exe –bin -o ./output/***.bin ./output/***.axf

Here, the path before fromelf.exe is the path found in step one, indicating where to look for the fromelf.exe file.

–bin is used to generate the output in bin file format, and -o is for generating .o files.

./output/***.bin generates the ***.bin file in the output directory of the current project folder, where *** is the name of the file, usually the same as the project name.

./output/***.axf is the generated .axf file.

A simpler method can be written as:

fromelf.exe –bin -o “[email protected]” “#L”

How to Generate .bin Files in Keil/MDK

3. After setting up, click OK to confirm, then recompile, and you will find the corresponding ***.bin file in the output folder of the project directory.

How to Generate .bin Files in Keil/MDK

Leave a Comment