3.3.1. Using the compilers from the command line

There are four compiler variants as shown in Table 3.1:

Table 3.1. Compiler variants

Compiler nameCompiler variantSource languageCompiler output
armccCC32-bit ARM code
tccCC16-bit Thumb code
armcppC++C or C++32-bit ARM code
tcppC++C or C++16-bit Thumb code

Building an example

Sample C source code for a simple application is in install_directory\Examples\embedded\embed\main.c.

To build the example from the command line:

  1. Compile the C file main.c with either:

    armcc -g -O1 -c main.c (for ARM)

    tcc -g -O1 -c main.c   (for Thumb)

    where:

    -g

    Tells the compiler to add debug tables.

    -O1

    Tells the compiler to select the best possible optimization while maintaining an adequate debug view.

    -c

    Tells the compiler to compile only (not to link).

  2. Link the image using the following command:

    armlink main.o -o embed.axf 
    

    where:

    -o

    Specifies the output file as embed.axf.

  3. Use armsd or AXD to load and test the image.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0064D
Non-Confidential