Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

compiler error with lwIP gcc sam7x demo

Posted by bejkarna on February 25, 2010
when I try to compile the demo using yagarto gcc 4.4.2 under eclipse (same results under command line)

I get this:

...-I./lwip-1.1.0/contrib/port/FreeRTOS/AT91SAM7X -I./lwip-1.1.0/src/include/ipv4 -D SAM7_GCC -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -fno-strict-aliasing -fno-dwarf2-cfi-asm EMAC/SAM7_EMAC_ISR.c -o EMAC/SAM7_EMAC_ISR.o
EMAC/SAM7_EMAC_ISR.c: In function 'vEMACISR_Wrapper':
EMAC/SAM7_EMAC_ISR.c:92: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6835
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
make: *** [EMAC/SAM7_EMAC_ISR.o] Error 1

this is with optimisation level O3, with lower level eg O2 I get:

...-Map=rtosdemo.map
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: RTOSDemo.elf section `.bss' will not fit in region `ram'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: region `ram' overflowed by 27568 bytes
collect2: ld returned 1 exit status
make: *** [RTOSDemo.elf] Error 1

I also tried older version of gcc with the same result. Version of FreeRTOS V6.0.1
Any ideas what can be wrong, I am really stuck here with no idea, where to search for problem.
thanks for anything.


RE: compiler error with lwIP gcc sam7x demo

Posted by Richard on February 25, 2010
I just tried the same, and found it compiled with no problem but generated the following error while linking:

"no memory region specified for loadable section `.eh_frame"

I have read stuff about this error before and from memory (so might be wrong) there are two things that can cause this. The first is an error in the linker script - but the linker script worked fine with previous versions of Yagarto. The second is simply that the section ".eh_frame" should be stripped out using some command line option or other that I can't remember. I think this will require a bit of Googling.

Regards.

RE: compiler error with lwIP gcc sam7x demo

Posted by bejkarna on February 25, 2010
Thanks a lot for your answer, it now works, I dont know how :( i will try to explain

I found on yagarto.de that if the message you mentioned about ".eh_frame" appears one should add the following to the linker script:

. = ALIGN(4);
.eh_frame :
{
KEEP (*(.eh_frame))
} > ram

Now I was actually working with two demos: SAM7X WEB Server & USB Mouse Demo
Using Eclipse where I removed the uIP stack and added lwIP from the lwIP demo
and I also tried lwIP demo as I said earlier.

with the uIP demo the linker script contained the above part but the lwIP did not, so I added it there, this removed the .eh_frame error but new one appeard:

c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib/interwork\libg.a(lib_a-sbrkr.o): In function `_sbrk_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\interwork\newlib\libc\reent/../../../../../../newlib-1.18.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
collect2: ld returned 1 exit status

but I found that the linker script works with memory I increased it as I have at91sam7x512 which has larger memory. this caused that the uip demo (with lwIP implemented) started working. Sadly the lwIP demo does not work as it throws the error mentioned above.

I am not really sure what I exactly did as I am just begginer, but now it works. Amazing.

RE: compiler error with lwIP gcc sam7x demo

Posted by bejkarna on February 25, 2010
I changed the following in atmel-rom.ld

MEMORY
{
flash: ORIGIN = 0x00100000, LENGTH = 256K
ram: ORIGIN = 0x00200000, LENGTH = 64K
}

__stack_end__ = 0x00200000 + 64K - 4;

to

MEMORY
{
flash: ORIGIN = 0x00100000, LENGTH = 512K
ram: ORIGIN = 0x00200000, LENGTH = 128K
}

__stack_end__ = 0x00200000 + 128K - 4;

I found also that lowering configTOTAL_HEAP_SIZE in FreeRTOSConfig.h to 20 * 1024 also works. It is about the same as set up in the lwIP demo.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS