AMX 4-ARM Tool Guide: First Printing: August 1, 1997 Last Printing: November 1, 2007
AMX 4-ARM Tool Guide: First Printing: August 1, 1997 Last Printing: November 1, 2007
KADAK Products Ltd. is committed to technical support for its software products. Our
programs are designed to be easily incorporated in your systems and every effort has
been made to eliminate errors.
Engineering Change Notices (ECNs) are provided periodically to repair faults or to
improve performance. You will automatically receive these updates during the product's
initial support period. For technical support beyond the initial period, you must purchase
a Technical Support Subscription. Contact KADAK for details. Please keep us informed
of the primary user in your company to whom update notices and other pertinent
information should be directed.
Should you require direct technical assistance in your use of this KADAK software
product, engineering support is available by telephone, fax or e-mail. KADAK reserves
the right to charge for technical support services which it deems to be beyond the normal
scope of technical support.
We would be pleased to receive your comments and suggestions concerning this product
and its documentation. Your feedback helps in the continuing product evolution.
DISCLAIMER
TRADEMARKS
AMX in the stylized form and KwikNet are registered trademarks of KADAK Products Ltd.
AMX, AMX/FS, InSight, KwikLook and KwikPeg are trademarks of KADAK Products Ltd.
Microsoft, MS-DOS and Windows are registered trademarks of Microsoft Corporation.
ARM is a trademark of Advanced RISC Machines Ltd.
All other trademarked names are the property of their respective owners.
Debugger
-- Advanced RISC Machines Ltd. AXD ARM Extended Debugger
-- Advanced RISC Machines Ltd. ADW ARM Debugger for Windows
-- Advanced RISC Machines Ltd. RealView Debugger
-- MetaWare Incorporated SeeCode Debugger for ARM
-- Metrowerks CodeWarrior for ARM
-- IAR Systems C-SPY Debugger for ARM
Toolset id: RM RV MW ME AR
Vendor: ARM ARM MetaWare Metrowerks IAR Systems
(SDT, ADS) (RVDS)
AMX 4-ARM and KwikLook have been tested on the following platforms.
Advanced RISC Machines ARM Development Board (ARM7TDMI Version)
Advanced RISC Machines ARM Development Board (ARM940T Version)
Advanced RISC Machines Integrator/AP Board (with ARM966E)
Advanced RISC Machines Integrator/CP Board (with ARM920T)
Intel (Digital Semiconductor) EBSA-285 Evaluation Board
Intel (Digital Semiconductor) Brutus SA-1100 Evaluation Platform
Intel SA-1110 Development Platform (includes SA-1111 Development Module)
Intel XScale IQ80321 Evaluation Platform
Atmel AT91EB40 Evaluation Board
Atmel AT91EB42 Evaluation Board
Atmel AT91SAM7S-EK Evaluation Kit
Advanced RISC Machines ARM Evaluator-7T (with Samsung S3C4510 processor)
Cogent Computer Systems, Inc. CSB238 Single Board Computer
(with Cirrus Logic EP7312 processor)
Freescale i.MX21ADS board
Environment Variables
Set the following environment variables to provide access to all AMX and ARM tools,
header files, object files and libraries.
CJPATH Path to AMX installation directory (...\AMX402)
PATH Path to AMX and ARM executable programs
ARMCONF Path to ARM configuration files
ARMDLL Path to ARM DLL support files
ARMINC Path to ARM C include files
ARMLIB Path to ARM C library files
TMP Path to a temporary directory for use by ARM tools
Object Formats
ARM supports the Executable and Linking Format (ELF). The AMX 4-ARM libraries
and object modules are provided in ELF format. Your object modules and the AMX and
ARM libraries and object modules, all in ELF format, can be combined to create an
executable module in ARM Executable Format (AXF) suitable for use with the AXD ARM
Extended Debugger or the ARM RealView Debugger.
ARM v2.11 only supports the ARM Object Format (AOF). If you are using ARM v2.11
tools, you must rebuild the AMX 4-ARM libraries and object modules using those tools
as described in Appendix D of the AMX User's Guide. Your object modules and the
AMX and ARM libraries and object modules, all in ARM format, can be combined to
create an executable module in ARM Image Format (AIF) suitable for use with the ADW
ARM Debugger for Windows.
Register Usage
AMX 4-ARM makes the following C interface register assumptions. Registers a1, a2,
a3, a4, ip and lr and the flags in CPSR can always be altered by C procedures. All other
registers are preserved by AMX according to the ATPCS rules for C procedures.
Integers and pointers are returned from C procedures in register a1. You must NOT use
any C compilation switch which changes these register assumptions.
For ADS 1.0 and later, the compilation command line is therefore of the following form.
ARMCC -cpu 4 -c -Otime -apcs /noswst -li
-o FILENAME.O -errors FILENAME.ERR FILENAME.C
v2.11 only
by default ; v2.11 promotes char and short int values to integers
; prior to passing them as function parameters
-zpq8 ; avoid compiler code generation bug
For ARM v2.11 and v2.50 tools, use the following command line. Note that switch
-zpq8 is only required for ARM v2.11 tools. The braces {} must be omitted.
For ARM v1.0 and later tools, use the following librarian command line switches.
-create ; create a library module
-c ; create a new library module
-via YOURLIB.LBM ; use library command file YOURLIB.LBM
>YOURLIB.LBE ; redirect librarian error messages to YOURLIB.LBE
Make your library as follows.
ARMAR -create -c -via YOURLIB.LBM >YOURLIB.LBE
For ARM v2.11 and v2.50 tools, use the following librarian command line switches.
-c ; create a new library module
-o ; include public symbols in the library
-v YOURLIB.LBM ; use library command file YOURLIB.LBM
>YOURLIB.LBE ; redirect librarian error messages to YOURLIB.LBE
Make your library as follows.
ARMLIB -c -o -v YOURLIB.LBM >YOURLIB.LBE
Create a link specification file YOURLINK.LKS. Use the AMX 4-ARM Sample Program
link specification file CJSAMPLE.LKS as a guide.
Start with the sample link specification file for the board which most closely resembles
your hardware configuration.
Note
If you decide to omit any of the link and locate commands
from the sample specification, you may encounter link
errors or run-time faults.
v2.11 only
-aif -bin ; generate ARM Image Format file suitable for use with
; the ARM ADW debugger (replaces the -elf switch)
The link and locate command line is therefore of the following form. If you are using
ARM v2.11 or v2.50 tools, be sure to add the extra - after the -symbols switch. If you
are using ARM v2.11 tools, be sure to replace the -elf switch with the -aif -bin
switches.
ARMLINK -nodebug -symbols -elf -errors YOURLINK.LKE
-o YOURLINK.AXF -via YOURLINK.LKS
The resulting load module YOURLINK.AXF in ELF format is suitable for use with the AXD
ARM Extended Debugger or the ARM RealView Debugger. If you are using ARM
v2.11 tools, the resulting load module YOURLINK.AXF in AIF format is suitable for use
with the ADW ARM Debugger for Windows. Load modules in other formats ready for
burning into EPROM can also be created.
The ROM Option and ROM Access source modules are assembled as follows. Use the
-li for little endian systems and -bi switch for big endian systems. Note that parameters
/noswst and -cpu must be replaced with the proper switches if you are using ARM
v2.11 or v2.50 tools (see page 2-4).
ARMASM -apcs /noswst -cpu 4 -li -e CJ402ROP.ERR
-o CJ402ROP.O CJ402ROP.S
The AMX ROM is linked using link specification file CJ402ROP.LKS as follows.
ARMLINK -nodebug -errors AMXROM.LKE -o AMXROM.AXF -via CJ402ROP.LKS
This example generates file AMXROM.AXF in ELF format. The ARM FROMELF.EXE utility
can be used to convert this ELF file to other formats suitable for transfer to ROM.
When you link your AMX application, be sure to include your customized AMX ROM
Access Module CJ402RAC.O (created above) in your system link specification file.
Copy the ROM Option and ROM Access template files CJ402ROP.CT and CJ402RAC.CT
to the current directory. Also copy the ROM Option Link Specification Template file
CJ402ROP.LKT to the current directory.
Use the AMX Configuration Generator to generate the ROM option source modules as
follows.
CJ402CG HDWCFG.UP CJ402ROP.CT CJ402ROP.S
CJ402CG HDWCFG.UP CJ402RAC.CT CJ402RAC.S
CJ402CG HDWCFG.UP CJ402ROP.LKT CJ402ROP.LKS
Once the ROM option source modules have been created, you can proceed to build your
AMX ROM image and your AMX application as described above.
AMX 4-ARM and KwikLook have been tested on the following platforms.
Advanced RISC Machines ARM Development Board (ARM7TDMI Version)
Advanced RISC Machines ARM Development Board (ARM940T Version)
Advanced RISC Machines Integrator/AP Board (with ARM966E)
Advanced RISC Machines Integrator/CP Board (with ARM920T)
Intel (Digital Semiconductor) EBSA-285 Evaluation Board
Intel (Digital Semiconductor) Brutus SA-1100 Evaluation Platform
Intel SA-1110 Development Platform (includes SA-1111 Development Module)
Intel XScale IQ80321 Evaluation Platform
Atmel AT91EB40 Evaluation Board
Atmel AT91EB42 Evaluation Board
Atmel AT91SAM7S-EK Evaluation Kit
Advanced RISC Machines ARM Evaluator-7T (with Samsung S3C4510 processor)
Cogent Computer Systems, Inc. CSB238 Single Board Computer
(with Cirrus Logic EP7312 processor)
Freescale i.MX21ADS board
Environment Variables
Set the following environment variables to provide access to all AMX and MetaWare
tools, header files, object files and libraries.
CJPATH Path to AMX installation directory (...\AMX402)
PATH Path to AMX and MetaWare executable programs
TOOLSDIR Path to MetaWare executable programs
HCDIR Path to MetaWare installation directory
TMP,TMPPREFIX Path to a temporary directory for use by MetaWare tools
The AMX libraries have been constructed using the following assumptions. The
resulting AMX 4-ARM libraries are ready for use with any ARM processor which is
compatible with the ARM v4, v4T, v5 or v5T architecture.
AMX 4-ARM target processor is little endian and of ARM v4 architecture
AMX 4-ARM is generated in ELF object format
AMX 4-ARM assumes software floating point emulation
Register Usage
AMX 4-ARM makes the following C interface register assumptions. Registers a1, a2,
a3, a4, ip and lr and the flags in CPSR can always be altered by C procedures. All other
registers are preserved by AMX according to the ATPCS rules for C procedures.
Integers and pointers are returned from C procedures in register a1. You must NOT use
any C compilation switch which changes these register assumptions.
Making Libraries
To make a library from a collection of object modules, create a library specification file
YOURLIB.LBM. Use the MetaWare version of the AMX library specification file
CJ402.LBM as a guide.
Use the following command line switches when using the MetaWare librarian.
-r ; replace (add) modules in (to) library
YOURLIB.A ; output library module YOURLIB.A
>YOURLIB.LBE ; redirect librarian error messages to YOURLIB.LBE
Make your library as follows.
ARARM -r YOURLIB.A @YOURLIB.LBM >YOURLIB.LBE
Warning
MetaWare libraries for release v4.2f and earlier have
known problems with the stack and heap setup. If you
encounter difficulties using the MetaWare C startup code in
your embedded system, contact MetaWare for an updated
library or contact KADAK for a temporary work around.
Note
Symbol cj_mw_tls (or cj_mw_tlsmin) must be undefined
(using the linker -u switch) to force the full (or minimal)
thread-safe support modules to be resolved from the AMX
4-ARM Library.
Be sure to follow the guidelines for thread-safe library
usage presented later in this Tool Guide.
Note
You must not use the linker -u switch to force symbol
cj_mw_tls or cj_mw_tlsmin to be undefined.
Note
Link and locate with the MetaWare linker using the following command line switches.
-Hthread ; link for thread-safe use (preferred)
-u cj_mw_tls ; load AMX 4-ARM thread-safe support (full)
-u cj_mw_tlsmin ; load AMX 4-ARM thread-safe support (minimal)
; (see the topic Guidelines for Thread-safe Library Use)
or
-Hnothread ; link for non-thread-safe use
For little endian use without full thread-safe support, link as follows:
HCARM -o YOURLINK.OUT -m -HL -Hnothread -xm
YOURLINK.LKS -Lmwpath -lc -lmw >YOURLINK.MAP
The resulting load module YOURLINK.OUT is suitable for use with the MetaWare SeeCode
Debugger. The resulting load module YOURLINK.HEX is ready for burning into EPROM.
Add one the following statements to your link specification file or to your link command
line to force the appropriate thread-safe support modules to be loaded from the AMX
4-ARM Library.
-u cj_mw_tls ; load AMX 4-ARM thread-safe support (full)
-u cj_mw_tlsmin ; load AMX 4-ARM thread-safe support (minimal)
MetaWare recommends that you compile and link your application modules with the
-Heos=amx command line switch to specify AMX as the target operating system.
However, you can safely omit this switch since all MetaWare specific support for AMX
is provided by KADAK, not MetaWare.
The following step is very IMPORTANT! If you miss it, malloc() will fail because the
bss and sbss sections are not initialized. If your link/locate specification includes a data
initialization directive such as
INITDATA !data
Note that only one thread storage block is used by the MetaWare Library prior to the
AMX launch. After AMX shuts down, the MetaWare Library will be forced to resume
using the same thread storage block which was in use before AMX was launched.
The ROM Option and ROM Access source modules are assembled as follows. Use the
-le switch for little endian systems and -be for big endian systems. For MetaWare v4.1
tools, you must use the -Eo switch without the braces.
ASARM -le -noswst CJ402ROP.S {-Eo} >CJ402ROP.ERR
The AMX ROM is linked using link specification file CJ402ROP.LKS as follows. Use the
-HL switch for little endian systems and -HB for big endian systems. Use the -Hthread
switch for thread-safe systems and -Hnothread for non-thread-safe systems. You must
use the -Hnocrt switch to preclude linking the MetaWare C startup code and libraries.
HCARM -o AMXROM.OUT -m -HL -Hthread -Hnocrt -xm
CJ402ROP.LKS >AMXROM.MAP
This example generates file AMXROM.HEX in Motorola S-record format suitable for transfer
to ROM. Other formats supported by MetaWare can be selected with the appropriate
command switch.
When you link your AMX application, be sure to include your customized AMX ROM
Access Module CJ402RAC.O (created above) in your system link specification file.
Copy the ROM Option and ROM Access template files CJ402ROP.CT and CJ402RAC.CT
to the current directory. Also copy the ROM Option Link Specification Template file
CJ402ROP.LKT to the current directory.
Use the AMX Configuration Generator to generate the ROM option source modules as
follows.
CJ402CG HDWCFG.UP CJ402ROP.CT CJ402ROP.S
CJ402CG HDWCFG.UP CJ402RAC.CT CJ402RAC.S
CJ402CG HDWCFG.UP CJ402ROP.LKT CJ402ROP.LKS
Once the ROM option source modules have been created, you can proceed to build your
AMX ROM image and your AMX application as described above.
AMX 4-ARM and KwikLook have been tested on the following platforms.
Advanced RISC Machines ARM Development Board (ARM7TDMI Version)
Advanced RISC Machines ARM Development Board (ARM940T Version)
Advanced RISC Machines Integrator/AP Board (with ARM966E)
Advanced RISC Machines Integrator/CP Board (with ARM920T)
Intel (Digital Semiconductor) EBSA-285 Evaluation Board
Intel (Digital Semiconductor) Brutus SA-1100 Evaluation Platform
Intel SA-1110 Development Platform (includes SA-1111 Development Module)
Intel XScale IQ80321 Evaluation Platform
Atmel AT91EB40 Evaluation Board
Atmel AT91EB42 Evaluation Board
Atmel AT91SAM7S-EK Evaluation Kit
Advanced RISC Machines ARM Evaluator-7T (with Samsung S3C4510 processor)
Cogent Computer Systems, Inc. CSB238 Single Board Computer
(with Cirrus Logic EP7312 processor)
Freescale i.MX21ADS board
Environment Variables
Set the following environment variables to provide access to all AMX and ARM tools,
header files, object files and libraries.
CJPATH Path to AMX installation directory (...\AMX402)
PATH Path to AMX and ARM executable programs
RVCT20INC Path to ARM C include files (use correct version number)
RVCT20LIB Path to ARM C library files (use correct version number)
TMP Path to a temporary directory for use by ARM tools
Object Formats
ARM supports the Executable and Linking Format (ELF). The AMX 4-ARM libraries
and object modules are provided in ELF format. Your object modules and the AMX and
ARM libraries and object modules, all in ELF format, can be combined to create an
executable module in ARM Executable Format (AXF) suitable for use with the ARM
RealView Debugger.
Register Usage
AMX 4-ARM makes the following C interface register assumptions. Registers a1, a2,
a3, a4, ip and lr and the flags in CPSR can always be altered by C procedures. All other
registers are preserved by AMX according to the AAPCS rules for C procedures.
Integers and pointers are returned from C procedures in register a1. You must NOT use
any C compilation switch which changes these register assumptions.
Create a link specification file YOURLINK.LKS. Use the AMX 4-ARM Sample Program
link specification file CJSAMPLE.LKS as a guide.
Start with the sample link specification file for the board which most closely resembles
your hardware configuration.
Note
If you decide to omit any of the link and locate commands
from the sample specification, you may encounter link
errors or run-time faults.
The link and locate command line is therefore of the following form.
ARMLINK --nodebug --symbols --elf --errors YOURLINK.LKE
-o YOURLINK.AXF --via YOURLINK.LKS
The resulting load module YOURLINK.AXF in ELF format is suitable for use with the
ARM RealView Debugger. Load modules in other formats ready for burning into
EPROM can also be created.
The ROM Option and ROM Access source modules are assembled as follows. Use the
--li for little endian systems and --bi switch for big endian systems.
The AMX ROM is linked using link specification file CJ402ROP.LKS as follows.
ARMLINK --nodebug --errors AMXROM.LKE -o AMXROM.AXF
--via CJ402ROP.LKS
This example generates file AMXROM.AXF in ELF format. The ARM FROMELF.EXE utility
can be used to convert this ELF file to other formats suitable for transfer to ROM.
When you link your AMX application, be sure to include your customized AMX ROM
Access Module CJ402RAC.O (created above) in your system link specification file.
Copy the ROM Option and ROM Access template files CJ402ROP.CT and CJ402RAC.CT
to the current directory. Also copy the ROM Option Link Specification Template file
CJ402ROP.LKT to the current directory.
Use the AMX Configuration Generator to generate the ROM option source modules as
follows.
CJ402CG HDWCFG.UP CJ402ROP.CT CJ402ROP.S
CJ402CG HDWCFG.UP CJ402RAC.CT CJ402RAC.S
CJ402CG HDWCFG.UP CJ402ROP.LKT CJ402ROP.LKS
Once the ROM option source modules have been created, you can proceed to build your
AMX ROM image and your AMX application as described above.
AMX 4-ARM and KwikLook have been tested on the following platforms.
Advanced RISC Machines ARM Development Board (ARM7TDMI Version)
Advanced RISC Machines ARM Development Board (ARM940T Version)
Advanced RISC Machines Integrator/AP Board (with ARM966E)
Advanced RISC Machines Integrator/CP Board (with ARM920T)
Intel (Digital Semiconductor) EBSA-285 Evaluation Board
Intel (Digital Semiconductor) Brutus SA-1100 Evaluation Platform
Intel SA-1110 Development Platform (includes SA-1111 Development Module)
Intel XScale IQ80321 Evaluation Platform
Atmel AT91EB40 Evaluation Board
Atmel AT91EB42 Evaluation Board
Atmel AT91SAM7S-EK Evaluation Kit
Advanced RISC Machines ARM Evaluator-7T (with Samsung S3C4510 processor)
Cogent Computer Systems, Inc. CSB238 Single Board Computer
(with Cirrus Logic EP7312 processor)
Freescale i.MX21ADS board
Environment Variables
Set the following environment variables to provide access to all AMX and Metrowerks
tools, header files, object files and libraries.
CJPATH Path to AMX installation directory (...\AMX402)
PATH Path to AMX and Metrowerks executable programs
TMPDIR Path to a temporary directory for use by Metrowerks tools
CWFolder Path to Metrowerks installation directory
MWCIncludes Path to Metrowerks include directories
MWLibraries Path to Metrowerks library directories
MWLibraryFiles Filenames of Metrowerks C libraries to be searched
AMX Libraries
The AMX libraries have been constructed using the following assumptions. The
resulting AMX 4-ARM libraries are ready for use with any ARM processor which is
compatible with the ARM v4, v4T, v5 or v5T architecture.
AMX 4-ARM target processor is little endian and of ARM v4 architecture
AMX 4-ARM is generated in ELF object format
AMX 4-ARM assumes software floating point emulation
Object Formats
Metrowerks supports the Executable and Linking Format (ELF). The AMX 4-ARM
libraries and object modules are provided in ELF format. Your object modules and the
AMX and Metrowerks libraries and object modules, all in ELF format, can be combined
to create an executable module in ELF format suitable for use with the Metrowerks
CodeWarrior Debugger.
Register Usage
AMX 4-ARM makes the following C interface register assumptions. Registers a1, a2,
a3, a4, ip and lr and the flags in CPSR can always be altered by C procedures. All other
registers are preserved by AMX according to the ATPCS rules for C procedures.
Integers and pointers are returned from C procedures in register a1. You must NOT use
any C compilation switch which changes these register assumptions.
If the command line becomes too long, use a command file. For example, create a text
file CCSW.CMD which contains the following command string.
-c -proc v4 –nointerworking –little -sdatathreshold 0
-nopic –nopid -Cpp_exceptions off -Op
Making Libraries
To make a library from a collection of object modules, create a library specification file
YOURLIB.LBM. Use the Metrowerks version of the AMX library specification file
CJ402.LBM as a guide.
Use the following command line switches when using the Metrowerks linker/librarian.
-library ; create a library
-o YOURLIB.A ; output library module YOURLIB.A
>YOURLIB.LBE ; redirect librarian error messages to YOURLIB.LBE
Make your library as follows.
MWLD -library -o YOURLIB.A @YOURLIB.LBM >YOURLIB.LBE
Note
Link and locate with the Metrowerks linker and locator using the following command
line switches.
by default ; main entry point is at symbol __start
-proc v4 ; ARM v4 instruction compliance
-nointerworking ; generate non-interworking code
-little ; target processor is little endian (-big for big endian)
-nopic -nopid ; no position independednt code or data
-map unused ; direct section and symbol summary to
; file YOURLINK.OUT.XMAP
; include unused symbols in map file output
-g ; (optional) add debug information to the output to file
-srec ; direct HEX output to file YOURLINK.OUT.S19
; generate Motorola S-record format
-o ; direct link output to file YOURLINK.OUT
; use linker command file YOURLINK.LCF
@ ; use link specification file YOURLINK.LKS
> ; direct link error messages to file YOURLINK.LKE
To avoid an overlength command line, create a command file LDSW.CMD, a text file
containing the command line switches which you require.
-proc v4 –nointerworking –little -nopic -nopid -map unused -srec
The resulting load module YOURLINK.OUT is suitable for use with the Metrowerks
CodeWarrior ARM debugger.
The resulting load module YOURLINK.OUT.S19 is ready for burning into EPROM.
The ROM Option and ROM Access source modules are assembled as follows.
MWASM –proc arm4 –little -o CJ402ROP.O CJ402ROP.S >CJ402ROP.ERR
The AMX ROM is linked using linker command file CJ402ROP.LCF and link
specification file CJ402ROP.LKS as follows.
MWLD –proc arm4 –nointerworking –little -nopic –nopid
-map unused –srec -nostdlib -main "cjksenter"
-o AMXROM.OUT CJ402ROP.LCF @CJ402ROP.LKS >AMXROM.LKE
This example generates file AMXROM.OUT.S19 in Motorola S-record format suitable for
transfer to ROM.
Note that command line switch -main "cjksenter" is used to prevent loading of the
default C startup module. Command line switch -nostdlib is used to prevent loading of
the default C runtime library.
When you link your AMX application, be sure to include your customized AMX ROM
Access Module CJ402RAC.O (created above) in your system link specification file.
Copy the ROM Option and ROM Access template files CJ402ROP.CT and CJ402RAC.CT
to the current directory. Also copy the ROM Option Linker Command Template file
CJ402ROP.LCT to the current directory.
Use the AMX Configuration Generator to generate the ROM option source modules as
follows.
CJ402CG HDWCFG.UP CJ402ROP.CT CJ402ROP.S
CJ402CG HDWCFG.UP CJ402RAC.CT CJ402RAC.S
CJ402CG HDWCFG.UP CJ402ROP.LCT CJ402ROP.LCF
Once the ROM option source modules have been created, you can proceed to build your
AMX ROM image and your AMX application as previously described.
AMX 4-ARM and KwikLook have been tested on the following platforms.
Advanced RISC Machines ARM Development Board (ARM7TDMI Version)
Advanced RISC Machines ARM Development Board (ARM940T Version)
Advanced RISC Machines Integrator/AP Board (with ARM966E)
Advanced RISC Machines Integrator/CP Board (with ARM920T)
Intel (Digital Semiconductor) EBSA-285 Evaluation Board
Intel (Digital Semiconductor) Brutus SA-1100 Evaluation Platform
Intel SA-1110 Development Platform (includes SA-1111 Development Module)
Intel XScale IQ80321 Evaluation Platform
Atmel AT91EB40 Evaluation Board
Atmel AT91EB42 Evaluation Board
Atmel AT91SAM7S-EK Evaluation Kit
Advanced RISC Machines ARM Evaluator-7T (with Samsung S3C4510 processor)
Cogent Computer Systems, Inc. CSB238 Single Board Computer
(with Cirrus Logic EP7312 processor)
Freescale i.MX21ADS board
Environment Variables
Set the following environment variables to provide access to all AMX and IAR Systems
tools, header files, object files and libraries.
CJPATH Path to AMX installation directory (...\AMX402)
PATH Path to AMX and IAR Systems executable programs
TOOLPATH Path to IAR Systems ARM installation directory
TOOLCMN Path to IAR Systems common installation directory
AMX Libraries
The AMX libraries have been constructed using the following assumptions. The
resulting AMX 4-ARM libraries are ready for use with any ARM processor which is
compatible with the ARM v4, v4T, v5 or v5T architecture.
AMX 4-ARM target processor is little endian and of ARM v4 architecture
AMX 4-ARM is generated in ELF object format
AMX 4-ARM assumes software floating point emulation
Object Formats
IAR Systems supports the Executable and Linking Format (ELF). The AMX 4-ARM
libraries and object modules are provided in ELF format. Your object modules and the
AMX and IAR Systems libraries and object modules, all in ELF format, can be combined
to create an executable module in ELF format suitable for use with the IAR Systems
C-SPY Debugger.
Register Usage
AMX 4-ARM makes the following C interface register assumptions. Registers a1, a2,
a3, a4, ip and lr and the flags in CPSR can always be altered by C procedures. All other
registers are preserved by AMX according to the ATPCS rules for C procedures.
Integers and pointers are returned from C procedures in register a1. You must NOT use
any C compilation switch which changes these register assumptions.
If the command line becomes too long, use a command file. For example, create a text
file CCSW.CMD which contains the following command string.
--cpu_mode=arm --cpu=4 --endian=little
--dlib_config DLib_Config_Normal.h
--only_stdout --silent --diag_suppress=Pa082
Making Libraries
To make a library from a collection of object modules, create a library specification file
YOURLIB.LBM. Use the IAR Systems version of the AMX library specification file
CJ402.LBM as a guide.
Use the following command line switches when using the IAR Systems librarian.
by default ; retain case sensitivity
qc ; create a library and quick append files
YOURLIB.A ; output library module YOURLIB.A
@YOURLIB.LBM ; use library specification file YOURLIB.LBM
>YOURLIB.LBE ; redirect librarian error messages to YOURLIB.LBE
Make your library as follows.
AR qc YOURLIB.A @YOURLIB.LBM >YOURLIB.LBE
Note
Link and locate with the IAR Systems linker and locator using the following command
line switches.
by default ; retain case sensitivity
by default ; retain debug information in the output file
--cpu=4 ; ARM v4 instruction compliance
--only_stdout ; send all information to standard output
--silent ; do not generate extraneous information
--strip ; (optional) omit debug information from the output file
--config YOURLINK.LCF ; use link configuration file YOURLINK.LCF
--map YOURLINK.MAP ; direct linker list to file YOURLINK.MAP
--output YOURLINK.OUT ; direct linker output to file YOURLINK.OUT
-f YOURLINK.LKS ; link files per link specification file YOURLINK.LKS
>YOURLINK.LKE ; direct link error messages to file YOURLINK.LKE
-O srec ; direct HEX output to file YOURLINK.HEX
; generate Motorola S-record format
The link and locate command lines are then of the form:
ILINKARM --cpu=4 --only_stdout --silent
--config YOURLINK.LCF --map YOURLINK.MAP
--output YOURLINK.OUT -f YOURLINK.LKS >YOURLINK.LKE
The resulting load module YOURLINK.OUT is suitable for use with the IAR Systems
C-SPY ARM debugger.
The resulting load module YOURLINK.HEX is ready for burning into EPROM.
The ROM Option and ROM Access source modules are assembled as follows.
IASMARM --cpu 4 --endian little -S -j
-o CJ402ROP.O CJ402ROP.S >CJ402ROP.ERR
The AMX ROM is linked using link configuration file CJ402ROP.LCF and link
specification file CJ402ROP.LKS as follows.
ILINKARM --cpu=4 --only_stdout --silent --strip
--config CJ402ROP.LCF --map AMXROM.MAP
--output AMXROM.OUT -f CJ402ROP.LKS >AMXROM.LKE
This example generates file AMXROM.HEX in Motorola S-record format suitable for transfer
to ROM.
When you link your AMX application, be sure to include your customized AMX ROM
Access Module CJ402RAC.O (created above) in your system link specification file.
Copy the ROM Option and ROM Access template files CJ402ROP.CT and CJ402RAC.CT
to the current directory. Also copy the ROM Option Link Configuration Template file
CJ402ROP.LCT to the current directory.
Use the AMX Configuration Generator to generate the ROM option source modules as
follows.
CJ402CG HDWCFG.UP CJ402ROP.CT CJ402ROP.S
CJ402CG HDWCFG.UP CJ402RAC.CT CJ402RAC.S
CJ402CG HDWCFG.UP CJ402ROP.LCT CJ402ROP.LCF
Once the ROM option source modules have been created, you can proceed to build your
AMX ROM image and your AMX application as previously described.