[arm-gnu] small Example project for Sourcery G++ Lite 2009q1-161
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[arm-gnu] small Example project for Sourcery G++ Lite 2009q1-161



Hi,
where can I find a complete small ARM example project for Sourcery G++ Lite 2009q1-161.
If possible with "hello world" printf and semihosting.

My attached code/Makefile is cached in __cs3_isr_dabort after some cycles. It is not
reaching main.

Maik Scholz

*_my current main.c:_*
#include <stdlib.h>
#include <stdio.h>

int main() {
   printf("Hello World\n");
   return 0;
}

*_my current Makefile:_*
CC=arm-none-eabi-gcc
LD=arm-none-eabi-ld
AS=$(CC) -x assembler-with-cpp
DEPEND=$(CC) -M

ODIR:=o

C_SRCS=\
   src/main.c

A_SRCS=

INCLUDES=\
   -Isrc


C_TARGET_OBJECTS+=$(patsubst %.c, %.o, $(addprefix ${ODIR}/,$(notdir ${C_SRCS}))) A_TARGET_OBJECTS+=$(patsubst %.s, %.o, $(addprefix ${ODIR}/,$(notdir ${A_SRCS})))
TARGET_DEPENDENCIES= $(C_TARGET_OBJECTS:.o=.d)
TARGET_OBJECTS= ${C_TARGET_OBJECTS} ${A_TARGET_OBJECTS}
VPATH = $(patsubst -I%,%,$(INCLUDES))

CFLAGS=  -g -mcpu=arm966e-s -ffunction-sections
ASFLAGS= -g
LDFLAGS= -g -T ./generic-hosted.ld

all: o ${ODIR}/HelloWorldTest.elf

${ODIR}/%.o: %.c ${ODIR}
   $(CC) $(CFLAGS) $(INCLUDES) -c -o ${ODIR}/$*.o $<

${ODIR}/%.d: %.c ${ODIR}
   $(DEPEND) $(CFLAGS) $(INCLUDES) -MT $(ODIR)/$(*F).o -M -o $@ $<

${ODIR}/%.o : %.s
   $(AS) -c $(ASFLAGS) -I . $(INCLUDES) $< -o $@

${ODIR}/AbortOverlayTest.elf: $(TARGET_DEPENDENCIES) $(TARGET_OBJECTS)
   $(LD) -o $@ $(TARGET_OBJECTS) $(LDFLAGS) \
-L"C:\Programme\CodeSourcery\Sourcery G++ Lite\lib\gcc\arm-none-eabi\4.3.3" \
       -L"C:\Programme\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib" \
"C:\Programme\CodeSourcery\Sourcery G++ Lite\lib\gcc\arm-none-eabi\4.3.3\crti.o"
       -Map=${ODIR}/HelloWorldTest.map
clean:
   rm -rf o

o:
   mkdir o

test:
@echo C_SRCS=$(C_SRCS) @echo A_SRCS=$(A_SRCS) @echo TARGET_DEPENDENCIES=$(TARGET_DEPENDENCIES) @echo TARGET_OBJECTS=$(TARGET_OBJECTS) @echo VPATH=$(VPATH) ifneq ($(MAKECMDGOALS),clean)
-include ${TARGET_DEPENDENCIES}
endif