Follow+Star Public Account, don’t miss exciting content
Author | strongerHuang
WeChat Public Account | Embedded Column
Previously, we discussed bin, hex, axf, and elf file formats, where axf is also considered an executable program file, but it has more debugging information compared to bin and hex.
Keil MDK does not generate bin files by default. If a bin file is needed, it can be converted from axf using the fromelf tool.
Embedded Column
1
In IAR, the project configuration has an option to choose between bin or hex, Project -> Options -> Output Converter:
Embedded Column
2
1. Determine the location (directory) of the fromelf tool
Keil MDK V4 version is located at: C:\Keil/ARM/BIN40
Keil MDK V5 version is located at: C:\Keil_v5\ARM\ARMCLANG\bin
If you modified the path during installation, you will need to use the corresponding path.
2. Configure Keil Project Options
Project -> Options for Target -> User -> After Build/Rebuild add the command:
C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe --bin --output ./Objects/Demo.bin ./Objects/Demo.axf
Where:
-
C:\Keil_v5: is your corresponding installation path (tool path);
-
Objects: is the input/output location;
3. Format Description
The basic format is:
fromelf [options] output_file input_file
Where:
-
[options]: option words
-
output_file: output file
-
input_file: input file
Combining the example above, you will find:
-
Option words: –bin –output
-
Output file: ./Objects/Demo.bin
-
Input file: ./Objects/Demo.axf
You may see different implementations, for example:
C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe --bin -o ./Objects/Demo.bin ./Objects/Demo.axf
C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe --bin --output=./Objects/Demo.bin ./Objects/Demo.axf
https://www.keil.com/support/man/docs/armutil/armutil_pge1362128885938.htm
Reply with ‘Keil Series Tutorial’ or ‘IAR Series Tutorial’ to read more related articles.
Click ‘Read the Original’ for more shares, feel free to share, bookmark, like, and view.