Konnte das Problem nun lösen, indem ich die Pfadangabe für Includes
unter Eclipse an der folgeden Stelle änderte:
project-->properties-->C/C++Build-->Settings-->Directories
Habe nun aber ein neues Problem: Unter Eclipse beim Ausführen von Build
all wird eine .exe anstelle einer .bin erzeugt. Außerdem werden keine
.elf und .o Dateien erzeugt. Das Maekfile sieht so aus:
# Definition des cross-compiler toolchain Präfixes
#
CROSS_COMPILE=arm-elf-
#
#
# Outputdateinamen (ohne Dateierweiterung)
#
OUTFILE_SRAM=at91sam7x_getting_started_sram
OUTFILE_FLASH=at91sam7x_getting_started_flash
#
#
# Pfadangabe der Headerdateien
#
INCL=./../include
#
#
# Optimierungsgrad während der Kompilierung (-Os bedeutet
Größenoptimierung)
#
OPTIM = -Os
#
#
# Angabe der cross-compiler toolchain Binutilities (assembler, compiler,
# linker, symbol list extractor, etc.)
#
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
#
#
# Compiler Optionen: -g: generate debugging information for GDB usage.
# -mcpu = arm7tdmi type of ARM CPU core.
# -c: indicates to gcc to only compile the file, and
# to not link it (link is done later, when all code
# files are compiled).
# -Wall: displays all warnings.
# -I$(INCL): set paths for include files.
#
$(OPTIM)CCFLAGS=-g -mcpu=arm7tdmi $(OPTIM) -Wall -I$(INCL)
#
#
# Assembler Optionen: -D__ASSEMBLY__ : defines the _ASSEMBLY_ symbol,
# which is used in header files to distinguish
# inclusion of the file in assembly code or in C code.
#
ASFLAGS=-D__ASSEMBLY__ -g -mcpu=arm7tdmi -c -Os -Wall -I$(INCL)
#
#
# Linker Optionen: -nostartfile: Do not use the standard system startup
# files when linking.
# -Wl,--cref: Pass the --cref option to the linker
# (generates cross-reference in map file if this one
# is requested).
# -lc: use standard C library.
# -lgcc: use gcc library.
# -T elf32-littlearm.lds: use the file elf32-littlearm.lds
# as linker file.
#
LDFLAGS+=-nostartfiles -Wl,--cref
LDFLAGS+=-lc -lgcc
LDFLAGS+=-T elf32-littlearm.lds
#
#
# Liste der Objektdateien
OBJS=cstartup.o
OBJS+= lowlevel.o \
main.o
#
#
# ‘all’, ist eine Default Regel, wenn nichts weiteres spezifiziert wird
#
all: sram flash
#
#
# Erstellung der Objektdateien aufgrundlage der Source-Files. Die Option
-c
# teilt gcc mit, dass der compiler und der assembler gestartet werden
#
main.o: main.c
$(CC) -c $(CCFLAGS) main.c -o main.o
lowlevel.o: lowlevel.c
$(CC) -c $(CCFLAGS) lowlevel.c -o lowlevel.o
cstartup.o: cstartup.S
$(AS) $(ASFLAGS) cstartup.S -o cstartup.o
#
#
# Beschreibung wie Source und Link Objekt Files zusammen kompiliert
werden
#
sram: $(OBJS)
$(LD) $(LDFLAGS) -Ttext 0x201000 -Tdata 0x200000 -n -o
$(OUTFILE_SRAM).elf $(OBJS)
$(OBJCOPY) --strip-debug --strip-unneeded $(OUTFILE_SRAM).elf -O binary
$(OUTFILE_SRAM).bin
$(OUTFILE_FLASH).bin
flash: $(OBJS)
$(LD) $(LDFLAGS) -Ttext 0x100000 -Tdata 0x200000 -n -o
$(OUTFILE_FLASH).elf $(OBJS)
$(OBJCOPY) --strip-debug --strip-unneeded $(OUTFILE_FLASH).elf -O binary
$(OUTFILE_FLASH).bin
ein kurzes linker-Skript sieht wie folgt aus:
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(reset_handler)
/*#include "project.h"*/
SECTIONS
{
.text : {
_stext = .;
*(.text)
*(.rodata) /* read-only data (constants) */
*(.rodata*)
. = ALIGN(4);
_etext = . ;
}
/* collect all initialized .data sections that go into FLASH */
.data : AT ( ADDR (.text) + SIZEOF (.text) ) {
_sdata = .;
*(.vectors)
*(.data)
_edata = .;
}
/* collect all uninitialized .bss sections that go into FLASH */
.bss (NOLOAD) : {
. = ALIGN(4);
_sbss = .;
*(.bss)
_ebss = .;
}
}
end = .;
Wo ist das Problem? Kann mir da jemand helfen? Wäre sehr nett.
LG
MArk