

Using Keil’s built-in fromelf conversion tool
The method here is actually very simple, it is implemented through Keil’s built-in tool (fromelf).

We just need to add a command in the User options after compilation:
C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe –bin –output ./Objects/Demo.bin ./Objects/Demo.axf
Explain the meaning of the command
C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe
–bin –output
./Objects/Demo.bin
./Objects/Demo.axf
For more explanations about axf files, you can refer to the article:Is there a big difference between the three file formats: bin, hex, and axf?
The meaning of this command is: Use (fromelf.exe) this tool to convert the axf file into a bin file.
If it is the default installation path:
C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe
Then the command can be simplified like this:
fromelf –bin –output=./Objects/Demo.bin ./Objects/Demo.axf
This command has detailed explanations from the official side, if you want to know more, you can check the official website.
https://developer.arm.com/documentation/dui0477/latest/fromelf-command-line-options/–bin
Finally, I recorded a video, you can refer to it:
Click “Read Original” to see more shares.