How to Convert AXF to BIN Using fromelf in Keil MDK

Follow+Star Public Account, don’t miss exciting content

How to Convert AXF to BIN Using fromelf in Keil MDK

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

Configure Output Hex
Keil MDK’s default output option only includes hex files.
Project -> Options for Target -> Output check “Create HEX File” (as shown below)

How to Convert AXF to BIN Using fromelf in Keil MDK

In IAR, the project configuration has an option to choose between bin or hex, Project -> Options -> Output Converter:

How to Convert AXF to BIN Using fromelf in Keil MDK

Embedded Column

2

AXF to BIN Configuration
Although there are many methods to convert hex to bin, you can use the built-in fromelf tool in Keil MDK to convert axf to bin files.

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;

How to Convert AXF to BIN Using fromelf in Keil MDK

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
-o: is the abbreviation command for older versions of the tool.
You can refer to:

https://www.keil.com/support/man/docs/armutil/armutil_pge1362128885938.htm

———— END ————

Reply with ‘Keil Series Tutorial’ or ‘IAR Series Tutorial’ to read more related articles.

Follow WeChat Public Account ‘Embedded Column’, check the bottom menu for more content, reply ‘Join Group’ to join the technical exchange group as per the rules.

How to Convert AXF to BIN Using fromelf in Keil MDK

Click ‘Read the Original’ for more shares, feel free to share, bookmark, like, and view.

Leave a Comment