Compiling ARM7_LPC2368_Eclipse demo

Hi guys,

I am getting erros when I tried to compile the ARM7_LPC2368_Eclipse demo using
arm-none-eabi (from Codesourcery).
They appear to be “linker” related, because all the files compiled ok.

First one:

c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: error: no memory region specified for loadable section `.ARM.exidx’

I tried to solve it (or at least, make the code compile) adding the following lines to the lpc2368.ld file (I found googling around):

  /* .ARM.exidx is sorted, so has to go in its own output section.  */
  __exidx_start = .;
  .ARM.exidx :
  {
    *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  } >ram
  __exidx_end = .;

I have no idea if this is ok, but at least I dont get this error anymore…

But, now I got the following errors:

c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-sbrkr.o): In function `_sbrk_r’:
sbrkr.c:(.text+0xc): undefined reference to `_sbrk’
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-writer.o): In function `_write_r’:
writer.c:(.text+0x10): undefined reference to `_write’
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-closer.o): In function `_close_r’:
closer.c:(.text+0xc): undefined reference to `_close’
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-fstatr.o): In function `_fstat_r’:
fstatr.c:(.text+0xe): undefined reference to `_fstat’
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-isattyr.o): In function `_isatty_r’:
isattyr.c:(.text+0xc): undefined reference to `_isatty’
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-lseekr.o): In function `_lseek_r’:
lseekr.c:(.text+0x10): undefined reference to `_lseek’
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumblibc.a(lib_a-readr.o): In function `_read_r’:
readr.c:(.text+0x10): undefined reference to `_read’

I am guessing it´s library related because of printf or something like it… What do I have to include explicitely ?

On the error messages, there´s references to libc.a , I tried to explicitely define -lc (no result). However in the demo projetct there is no explicit referente to any library.

Any sugestions?

THanks!
Sergio P. SIder

Compiling ARM7_LPC2368_Eclipse demo

Try compiling with Yagarto. See www.Yagarto.de.

Compiling ARM7_LPC2368_Eclipse demo

Dear Sergio,

  The Yagarto tools should do it. I have the lpc2368 Eclipse demo compiling with Eclipse (Europe) and Yagarto. Check the tutorial on http://www.freertos.org/Eclipse.html for installing/configuring Eclipse.

  OpenOSD might be usefull: http://openocd.berlios.de/web/.

Have fun,
Bart

Compiling ARM7_LPC2368_Eclipse demo

Thank you guys,

I will try it, although the link for download in sourceforge is broken (yagarto). I managed to download the file googling around, although it´s not too safe to do it…

Thanks again,
Sergio P. Sider

Compiling ARM7_LPC2368_Eclipse demo

Hi all,

I have followed the instructions to install Eclipse for testing the ARM7_LPC2368_Eclipse demo. But I have problem with the project’s compilation:

**** Build of configuration Default for project RTOSDemo ****

(Exec error:Launching failed)

I would like to know if I have to install some other additional tool or setting for compiling the project without error? Please help me. Thanks.

Compiling ARM7_LPC2368_Eclipse demo

Check that the GCC compiler is in your path.

Open a command prompt and type “arm-elf-gcc”, you should get a message saying something like “no input file specified”.  If you get a message saying arm-elf-gcc is not a known program then you need to add the YAGARTO/bin directory to your PATH environment variable.

Next in the command prompt try typing “make”.  Does it recognise that command?

Regards.

Compiling ARM7_LPC2368_Eclipse demo

Hi Richard,

It means that I have to install YAGATO as well? Anything else? Now I’ve just installed and configured Eclipse on my PC.

Compiling ARM7_LPC2368_Eclipse demo

Read the following page – http://www.freertos.org/portlpc2368_Eclipse.html

Compiling ARM7_LPC2368_Eclipse demo

Thanks Dave, I can now launch the yagarto tool but still have problem with the compilation:

**** Build of configuration Default for project RTOSDemo ****

make all
arm-elf-gcc -c -g -O1 -Tlpc2368.ld -I . -I ../../../Source/include -I ../../../Source/portable/GCC/ARM7_LPC23xx -I ../../Common/include -I ./webserver -I ../../Common/ethernet/uIP/uip-1.0/uip -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -mthumb main.c -o main.o
process_begin: CreateProcess(NULL, arm-elf-gcc -c -g -O1 -Tlpc2368.ld -I . -I ../../../Source/include -I ../../../Source/portable/GCC/ARM7_LPC23xx -I ../../Common/include -I ./webserver -I ../../Common/ethernet/uIP/uip-1.0/uip -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute((packed)) -D ALIGN_STRUCT_END=__attribute((aligned(4))) -fomit-frame-pointer -mthumb-interwork -mthumb main.c -o main.o, …) failed.
make (e=2): The system cannot find the file specified.

make: *** [main.o] Error 2

What is the solution?

Compiling ARM7_LPC2368_Eclipse demo

Now I can pass this step but still error ’cause some functions are not supported. Here some what I have from the output windows:

c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-freer.o): In function `_malloc_trim_r’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdlib/../../../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:3326: undefined reference to `_sbrk_r’
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdlib/../../../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:3335: undefined reference to `_sbrk_r’
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdlib/../../../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:3340: undefined reference to `_sbrk_r’
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-mallocr.o): In function `malloc_extend_top’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdlib/../../../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:2160: undefined reference to `_sbrk_r’
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdlib/../../../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:2197: undefined reference to `_sbrk_r’
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-makebuf.o): In function `__smakebuf_r’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/makebuf.c:59: undefined reference to `_fstat_r’
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/makebuf.c:110: undefined reference to `_isatty_r’
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-stdio.o): In function `__sclose’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:124: undefined reference to `_close_r’
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-stdio.o): In function `__sseek’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:106: undefined reference to `_lseek_r’
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-stdio.o): In function `__swrite’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:78: undefined reference to `_lseek_r’
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:86: undefined reference to `_write_r’
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/thumb/interworklibg.a(lib_a-stdio.o): In function `__sread’:
C:msys1.0homeyagartonewlib-buildarm-elfthumbinterworknewliblibcstdio/../../../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:48: undefined reference to `_read_r’
collect2: ld returned 1 exit status
make: *** [RTOSDemo.elf] Error 1

Any idea?

Compiling ARM7_LPC2368_Eclipse demo

Hi all, i am facing this problem as well.
i am using codesourcery 2009q1-161-arm-none-eabi- with eclipse Galileo.
is there any update version of the demo code could be compiled by codesourcery 2009q1-161-arm-none-eabi- with eclipse Galileo?

Thanks very much.

please update me

Compiling ARM7_LPC2368_Eclipse demo

Lao, you can fix it providin a syscalls.c file. That is because new newlib. Take a look at yagarto web site. They provide an example.

Compiling ARM7_LPC2368_Eclipse demo

Let me help a little bit more. If you are using newlib 1.17, just create a file called syscalls.c like http://www.yagarto.de/download/yagarto/syscalls.c and compile together.

There is more information on http://www.yagarto.de/howto/yagarto1/yagarto_newlib.txt .