Atmel Evaluation Board using the SAM7SE Microcontroller AT91SAM7SE-EK AT91SAM7SE-EK Data Sheet

Product codes
AT91SAM7SE-EK
Page of 24
18
6295A–ATARM–27-Mar-07
Application Note
4.1
ARM Compiler Toolchain
To generate the binary file to be downloaded into the target, we use the YAGARTO GNU ARM
compiler toolchain (
This toolchain provides ARM assembler, compiler, and linker tools. Useful programs for debug
are also included.
We also require another software that is not included into the Yagarto package: the make utility.
We get it by installing the unxutils package available at 
.
4.1.1
Makefile
The Makefile contains rules indicating how to assemble, compile and link the project source files
to create a binary file ready to be downloaded on the target.
The makefile is divided into two parts, one for variables settings, and the other for rules
implementation.
4.1.1.1
Variables
The first part of the Makefile contains variables (uppercase), used to set up some environment
parameters, such as the compiler toolchain prefix and program names, and options to be used
with the compiler.
CROSS_COMPILE=arm-elf-
• Defines the cross-compiler toolchain prefix.
OUTFILE_SDRAM=at91sam7se_getting_started_sdram
OUTFILE_FLASH=at91sam7se_getting_started_flash
• Outfile name (without extension).
INCL=./../include
• Paths for header files.
OPTIM = -Os
• Level of optimization used during compilation (-Os optimizes for size).
AS=$(CROSS_COMPILE)gcc
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)gcc
NM= $(CROSS_COMPILE)nm
SIZE=$(CROSS_COMPILE)size
OBJCOPY=$(CROSS_COMPILE)objcopy
OBJDUMP=$(CROSS_COMPILE)objdump
• Names of cross-compiler toolchain binutils (assembler, compiler, linker, symbol list extractor, 
etc.).
$(OPTIM)CCFLAGS=-g -mcpu=arm7tdmi $(OPTIM) -Wall -I$(INCL)