| |||
| Home > Writing Code for ROM > Converting ARM linker ELF output to binary ROM formats | |||
By default, the ARM SDT 2.50 linker produces industry-standard ELF images. For embedded applications, the image usually needs to be converted into a binary format suitable for an EPROM programmer.
For more information on the ARM ELF implementation, refer
to the ELF documentation in c:\ARM250\PDF\specs.
For the command-line options for fromELF, see Chapter 8 Toolkit
Utilities in the ARM Software Development Toolkit Reference Guide.
Follow these steps to add a FromELF build step to a project template:
Select the root of the project tree view. Choose Edit variables for project.apj... from the Project menu. The Edit variables dialog is displayed.
Find the variable named build_target and
change its value from <$projectname>.axf to <$projectname>.bin and
click OK.
Choose Edit Project template from the Project menu. The Project Template Editor dialog is displayed.
Select Edit Details... and add (ROM) to the title.
Create a CreateROM build step by clicking on the New... button in the Project template Editor dialog.
The Create a new build step pattern dialog is displayed.
Type CreateROM in the Name field,
and click OK. An empty Edit Build
Step Pattern dialog for CreateROM appears.
In the Command Lines field, type (on one line):
<fromelf> <FROMELFOPTIONS> <$projectname>.axf -bin <$projectname>.bin
The -bin option produces a Plain Binary
image, suitable for blowing into ROM.Other output formats are also
available, for example:
Motorola 32
bit Hex (-m32)
Intel 32 bit Hex (-i32)
Intellec Hex (-ihf).
In the Input Partition, type:
Image
In the Input Pattern, type:
<$projectname>.axf
This should match the Link build step output pattern.
Click Add.
In the Output Partition, type:
Eprom
In the Output Pattern, type:
<$projectname>.bin
This should match the Link build step output pattern.
Click Add, then OK.
Select Edit variables for project.apj... from the Project menu.
In the Name field of the Edit variables dialog, type
FROMELFOPTIONS
In the Value field, type your chosen options, for example:
-nozeropad
Click OK.
If you want to re-use this template for another project, save the template with the Save As Template option from the File menu.
Rebuild the project. If you see an error message like:
"project.apj"; No build target named '<$projectname>.bin'
Remove all source files from your project by highlighting the files, then pressing delete.
Replace all source files into your project using the Add Files to Project from the Project menu.