Compiling problems using ARM 7

rebelstar wrote on Tuesday, February 19, 2008:

Hello ,
        I am trying to compile free rtos for LPC 2964.
But i am unable to do so. I get some errors when i run the make file.
This was in linux environment using gcc.

In windows i ran the .bat files provided using cygwin,but even here i got some errors.

can anyone kindly give the exact steps to compile free rtos on linux and windows environment seperately. What tools do we need in each scenario.This will be of great help as i am stuck in this compilation process itself.

Thanks,
REBEL star

woops_ wrote on Tuesday, February 19, 2008:

How can anybody help if you dont say what the errors are?

davedoors wrote on Tuesday, February 19, 2008:

>can anyone kindly give the exact steps to compile free rtos on linux and windows environment seperately

Yes, give us the information we need to help you or read the documentation. Do you expect somebody to write you out full instructions here?

rebelstar wrote on Wednesday, February 20, 2008:

Hello i am extremely sorry for not communicating the required information.(And it is LPC2106)
What i have done is .
1) I am using arm-none-linux-gnueabi  compiler for building freertos.
2) Cygwin interface to run commands.
3)In make file i made a change to CC option as
CC=arm-none-linux-gnueabi-gcc  instead of CC=arm-elf-gcc
4) I mount to the  directory structure c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>
    and ran the batch file ram_arm.bat.

The error i got was as below ( i am pasting the entire logfile)

c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>set USE_THUMB_MODE=NO

c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>set DEBUG=-g

c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>set OPTIM=-O0

c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>set RUN_MODE=RUN_FROM_RAM

c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>set LDSCRIPT=lpc2106-ram.ld

c:\FreeRtos\FreeRTOS\Demo\ARM7_LPC2106_GCC>make
arm-none-linux-gnueabi-gcc -c -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-funct
ion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmi
ssing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I.
-I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld -
O0 -fomit-frame-pointer serial/serialISR.c -o serial/serialISR.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer main.c -o main.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer serial/serial.c -o serial/serial.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer ParTest/ParTest.c -o ParTest/ParTest.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/integer.c -o …/Common/Minimal/intege
r.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/flash.c -o …/Common/Minimal/flash.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/PollQ.c -o …/Common/Minimal/PollQ.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/comtest.c -o …/Common/Minimal/comtes
t.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/flop.c -o …/Common/Minimal/flop.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/semtest.c -o …/Common/Minimal/semtes
t.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/dynamic.c -o …/Common/Minimal/dynami
c.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/Common/Minimal/BlockQ.c -o …/Common/Minimal/BlockQ.
o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/…/Source/tasks.c -o …/…/Source/tasks.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/…/Source/queue.c -o …/…/Source/queue.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/…/Source/list.c -o …/…/Source/list.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/…/Source/portable/MemMang/heap_2.c -o …/…/Source/
portable/MemMang/heap_2.o
arm-none-linux-gnueabi-gcc -c  -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-func
tion-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I
. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld
-O0 -fomit-frame-pointer …/…/Source/portable/GCC/ARM7_LPC2000/port.c -o …/…/
Source/portable/GCC/ARM7_LPC2000/port.o
arm-none-linux-gnueabi-gcc -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function
-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissi
ng-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I. -I
…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld -O0
-fomit-frame-pointer …/…/Source/portable/GCC/ARM7_LPC2000/portISR.o serial/ser
ialISR.o main.o serial/serial.o ParTest/ParTest.o …/Common/Minimal/integer.o …
/Common/Minimal/flash.o …/Common/Minimal/PollQ.o …/Common/Minimal/comtest.o …
/Common/Minimal/flop.o …/Common/Minimal/semtest.o …/Common/Minimal/dynamic.o .
./Common/Minimal/BlockQ.o …/…/Source/tasks.o …/…/Source/queue.o …/…/Source
/list.o …/…/Source/portable/MemMang/heap_2.o …/…/Source/portable/GCC/ARM7_LP
C2000/port.o -nostartfiles boot.s -Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -
Map=rtosdemo.map
c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gn
ueabi/4.2.1/…/…/…/…/arm-none-linux-gnueabi/bin/ld.exe: error: no memory regi
on specified for loadable section `.interp’
collect2: ld returned 1 exit status
make: *** [rtosdemo.elf] Error 1

Many Thanks,
kishore.

davedoors wrote on Wednesday, February 20, 2008:

Everything is compiling without error, but not linking. It might that there is an incompatibility between your version of GCC and the linker script.

I’m not fammiliar with building on Linux, is arm-none-linux-gnueabi just a standard cross compiler, not one specific for building linux kernels? This might be a dumb question its just my ignorance of linux. I know code sourcery do a linux version of the ARM cross compiler. http://www.codesourcery.com/gnu_toolchains/arm/download.html.

A quick google shows the following about the missing .interp section

“.interp
This section holds the path name of a program interpreter. If the file has a loadable segment that includes relocation, the sections’ attributes…”

This does not seem right for a static build. Could it just be the version of GCC that is not correct?

rebelstar wrote on Wednesday, February 20, 2008:

Hello ,
The version of the tool chain is  2007 q3-51.

I think arm-none-linux-gnueabi is a standard cross tool compiler because in the documentation he explains  its usage in windows platfor using cygwin.

Actually all the objet files are created and as you rightly said, there is a linking problem.
However the output of the process was a file called  rtosdemo.map  the contents of which are
Archive member included because of file (symbol)

c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.1\libgcc.a(_udivsi3.o)
                              serial/serial.o (__aeabi_uidiv)
c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.1\libgcc.a(_arm_addsubdf3.o)
                              …/Common/Minimal/flop.o (__aeabi_dsub)
c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.1\libgcc.a(_arm_muldivdf3.o)
                              …/Common/Minimal/flop.o (__aeabi_dmul)
c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.1\libgcc.a(_arm_cmpdf2.o)
                              …/Common/Minimal/flop.o (__aeabi_dcmpgt)
c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.1\libgcc.a(_dvmd_lnx.o)
                              c:/program files/codesourcery/sourcery g++ lite/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.1\libgcc.a(_udivsi3.o) (__div0)

Allocating common symbols
Common symbol       size              file

xSuspendedTestQueue
                    0x4               …/Common/Minimal/dynamic.o

And  in the makefile ,there is a reference to the error -----nostartfiles boot.s -Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -
Map=rtosdemo.map

Segement of the Makefile is here

rtosdemo.hex : rtosdemo.elf
    $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex

rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
    $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)

$(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
    $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@

$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
    $(CC) -c $(CFLAGS) $< -o $@

Thanks,
Kishore

chaalar wrote on Wednesday, February 20, 2008:

You can not use an arm-linux toolchain to build freertos. You need to use a bare-metal toolchain(arm-elf).
Moreover you don’t need to tackle with cygwin. I’m using winarm arm-elf toolchain without cygwin. But
if you want cygwin, you can also obtain an arm-elf toolchain from www.gnuarm.com for cygwin.

And please be sure that whole freertos project tree is compiling under Linux/Windows out of the box, provided that
system dependencies are satisfied.

Regards,
Caglar

rebelstar wrote on Wednesday, February 20, 2008:

Hello,
I am now using winARM elf tool chain.
The free rtos directory structure -( i have tried with both windows platform specific and platform independent files.)

But i get the following compiler errors ( in both cases)

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>rom_arm.bat

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>set USE_THUMB_MODE=NO

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>set DEBUG=

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>set OPTIM=-O3

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>set RUN_MODE=RUN_FROM_ROM

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>set LDSCRIPT=lpc2106-rom.ld

D:\FreeRTOS\Demo\ARM7_LPC2106_GCC>make
arm-elf-gcc -c -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast
-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototype
s -Wmissing-declarations -Wunused -D RUN_FROM_ROM -D GCC_ARM7 -I. -I…/…/Source
/include -I…/Common/include  -mcpu=arm7tdmi -Tlpc2106-rom.ld -O3 -fomit-frame-p
ointer …/…/Source/portable/GCC/ARM7_LPC2000/portISR.c -o …/…/Source/portable
/GCC/ARM7_LPC2000/portISR.o
process_begin: CreateProcess((null), arm-elf-gcc -c -Wall -Wextra -Wshadow -Wpoi
nter-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return -W
strict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused -D RUN_FR
OM_ROM -D GCC_ARM7 -I. -I…/…/Source/include -I…/Common/include -mcpu=arm7tdmi
-Tlpc2106-rom.ld -O3 -fomit-frame-pointer …/…/Source/portable/GCC/ARM7_LPC200
0/portISR.c -o …/…/Source/portable/GCC/ARM7_LPC2000/portISR.o, …) failed.
make (e=2): The system cannot find the file specified.
make: *** […/…/Source/portable/GCC/ARM7_LPC2000/portISR.o] Error 2

Thanks,
Kishore

rebelstar wrote on Wednesday, February 20, 2008:

sorry, issue solved…
The path variable was wrongly set this time.

Many thanks,
Kishore…

rebelstar wrote on Thursday, February 21, 2008:

Hello,
     Now i want to compile the same for LPC2294.But the required files are not present in the freertos directory structure.

If i want to compile and generate hex files for Lpc2294, what all changes do i need to make.( like linker scripts etc…i do not exactly know what all to change. )
Can any one plz answer…

Thanks,
rebelstar

rtel wrote on Thursday, February 21, 2008:

All you should need to change are the memory sizes to be correct for the LPC2294 - these can be found at the top of the linker script.

Regards.