2.9. RVCT 3.0 Options

Compiler and Assembler Options

When building code you will need to specify the correct CPU on your compiler and assembler command lines, as by default the RVCT 3.0 tools will build code for an ARMv4T core.

To do this you must add --cpu name to your command line, where name is either Cortex- M3 or Cortex-M3-rev0. You do not need to add --thumb to your command line as the Cortex-M3 is a Thumb-2 only core. The compiler will automatically generate Thumb-2 instructions and the assembler will only accept valid Thumb-2 instructions.

Linker Options

You do not need to specify any specific options to the linker to generate a suitable image for a Cortex-M3. The linker can obtain the required information from the object files specified on the linker command line.

However, we recommend that you use a scatter file (--scatter filename) as the memory map of the Cortex-M3 cannot easily be represented using command-line options available in the linker. You must also specify an entry point for the image using the --entry switch. Normally this will be the same entry point that you have specified as your reset handler in the exception table.

Copyright © 2007. All rights reserved.ARM DAI0179B