Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: pb getting EA's examples to compile (general gcc-arm help!)

2006-01-24 by rtstofer

I am just guessing but I will bet your makefile is now very 
incorrect.  Why don't you post that file if it is a reasonable 
length.

Mine looks like this (but Yahoo will trash it):

NAME = Playstation Controller

CC = arm-elf-gcc
LD = arm-elf-ld -v
AR = arm-elf-ar
AS = arm-elf-as
CP = arm-elf-objcopy
OD = arm-elf-objdump

ARCHIVE1= "C:/Program Files/GNUARM/lib/gcc/arm-elf/3.4.3"
ARCHIVE2= "C:/Program Files/GNUARM/arm-elf/lib"
LIBFLAGS= -L${ARCHIVE2} -lc -lg -lm -L$(ARCHIVE1) -lgcc 
CFLAGS  = -I./ -c -fno-common -O0 -g -Wa,-ahls=$*.lst -Wall
AFLAGS  = -ahls -mapcs-32 -o crt.o
LFLAGS  =  -Map main.map -Tmain.cmd
CPFLAGS = -O ihex
ODFLAGS = -x --syms

objects = main.o conio.o spi.o timer.o interrupt.o setup.o

all: test

clean:
  -rm *.o *.lst *.dmp *.hex *.map *.out
	
test: main.out
 @ echo "...copying"
 $(CP) $(CPFLAGS) main.out main.hex
 $(OD) $(ODFLAGS) main.out > main.dmp

main.out: main.cmd crt.o $(objects)
 @ echo "..linking"
 $(LD) $(LFLAGS) -o main.out crt.o $(objects) $(LIBFLAGS)

crt.o: crt.s
 @ echo ".assembling"
 $(AS) $(AFLAGS) crt.s > crt.lst

$(objects): %.o: %.c
 @ echo ".compiling " $<
 $(CC) -c $(CFLAGS) $< -o $@

main.o: main.c setup.h spi.h conio.h timer.h lpc210x.h
conio.o: conio.c conio.h lpc210x.h
setup.o: setup.c setup.h spi.h lpc210x.h
spi.o: spi.c spi.h lpc210x.h
timer.o: timer.c timer.h
interrupt.o: interrupt.c interrupt.h lpc210x.h

The important part is the ARCHIVE1 and ARCHIVE2 paths and the 
LIBFLAGS definition.  The linker won't scan back and forth (without 
help) so the libraries have to be specified in the proper order.

Don't try to copy this file directly.  Make wants certain fields 
separated by TABS and they are now SPACES.

Richard




--- In lpc2000@yahoogroups.com, Sean <embeddedrelated@w...> wrote:
>
> Hello everyone.  I realize that this isn't necessarily the most 
appropriate 
> forum for this, but it is the most responsive :)
> 
> I'm having troubles trying to get some of the samples for my dev 
kit to 
> compile properly.  I installed everything as per defaults, but 
that didn't 
> seem to set up a lot of necessary environment variables.  I'm 
trying to 
> compile the uart_irq sample.
> 
> I have updated the executable path to be able to find make and the 
> compilers, then it couldn't find any header files, so I updated 
the make 
> files to include all necessary paths to find header files, then I 
got 
> problems finding -lgcc and -lc, so I added -L flags to the 
makefile to 
> point to (what I think are the correct) library paths, but now I 
get this:
> 
> ------------------------------------------------
> make[1]: Entering directory `uart_irq/startup'
> rm -f .depend
> make[1]: Leaving directory `uart_irq/startup'
> make[1]: Entering directory `uart_irq/irq_code'
> rm -f .depend
> make[1]: Leaving directory `uart_irq/irq_code'
> rm -f .depend
> arm-elf-gcc: /Progra~1/GNUARM/arm-elf/lib/thumb/interwork: linker 
input 
> file unused because linking not done
> arm-elf-gcc: /Progra~1/GNUARM/arm-elf/lib/thumb/interwork: linker 
input 
> file unused because linking not done
> arm-elf-gcc -c -mcpu=arm7tdmi -mthumb-interwork -I./startup 
> -I/Progra~1/gnuarm/arm-elf/include -I 
> /Progra~1/gnuarm/lib/gcc/arm-elf/3.4.3/include -DEL -DGCC -mthumb-
interwork 
> -mthumb -DTHUMB_CSTART -DTHUMB_INTERWORK 
> -L/Progra~1/GNUARM/lib/gcc/arm-elf/3.4.3/thumb/interwork /Progra~
> 1/GNUARM/arm-elf/lib/thumb/interwork -DLPC2148  -Os -gdwarf-2 -
Wall 
> -Wcast-align -Wcast-qual -Wimplicit -Wnested-externs -Wpointer-
arith 
> -Wswitch -Wreturn-type -Wa,-ahlms=main.lst -o main.o main.c
> arm-elf-gcc: /Progra~1/GNUARM/arm-elf/lib/thumb/interwork: linker 
input 
> file unused because linking not done
> cc1: /Progra~1/GNUARM/arm-elf/lib/thumb/interwork: No such file or 
directory
> cc1: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> make: *** [main.o] Error 1
> ------------------------------------------------
> 
> yay segfault!
> 
> I'll admit, I'm a windows guy, I use command line a lot, but I 
have very 
> little experience with cygwin and gnu utilities.  I have a licence 
to the 
> ARM SDK 2.51 so I will probably try to use that in the future, but 
for now 
> I'd just like to get the sample apps compiling and loaded.
> 
> Any ideas anyone?
> 
> Thanks!
> 
> -- Sean
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.