Quality RTOS & Embedded Software

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




Loading

SAM7X lwIP_Demo Project Modification

Posted by Nobody/Anonymous on January 26, 2007
Hi,

I've been attempting to take the lwIP_Demo project and modify it for my own use. It compiles initially before I start modifying it, but after a while it starts to break. The issue seems to come up as soon as I try to remove the demo tasks:

(from main.c)
/* Demo application includes. */
//#include "partest.h"
#include "PollQ.h"
//#include "semtest.h"
//#include "flash.h"
#include "integer.h"
#include "BlockQ.h"
//#include "BasicWEB.h"
#include "USB-CDC.h"

I was able to remove the BasicWS and lwIP without problems, but once I start removing the partest.h, samtest.h, flash.h and the other related referenced I get the following errors:

../../Source/queue.o(.text+0x4c8): In function `xQueueReceive':
../../Source/queue.c:470: internal error: dangerous error
/usr/local/bin/../lib/gcc-lib/arm-elf/3.3.2/../../../../arm-elf/bin/ld: /usr/local/bin/../lib/gcc-lib/arm-elf/3.3.2/../../../../arm-elf/lib/libg.a(memcpy.o)(memcpy): warning: interworking not enabled.
/usr/local/bin/../lib/gcc-lib/arm-elf/3.3.2/../../../../arm-elf/bin/ld: first occurrence: ../../Source/queue.o: thumb call to arm
../../Source/queue.o(.text+0x59a): In function `xQueueReceiveFromISR':
../../Source/queue.c:515: internal error: dangerous error
collect2: ld returned 1 exit status
make: *** [rtosdemo.elf] Error 1
ecnaab119:~


I don't know what it is that causes these issues, but it is really annoying! Are these demo applications necessary for the project to compile for some reason? The error seems to be in the linking phase but I can't nail it down.

Thanks,
Chris

RE: SAM7X lwIP_Demo Project Modification

Posted by Nobody/Anonymous on January 26, 2007
Hi,

I did the same thing. I.e. removed demo project and tried to make use of lwip optional (as its easier to fit the application to ram as lwip is not included to test different stuff). My make file source list looks like:

# List C source files here
FREERTOS_THUMB_SRC= \
../FreeRTOS/Source/tasks.c \
../FreeRTOS/Source/queue.c \
../FreeRTOS/Source/list.c \
../FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/port.c \
../FreeRTOS/Source/portable/MemMang/heap_2.c

DEMO_APP_THMUB_SRC= \
main.c \
serial/serial.c

# BasicWEB.c
# USB/USB-CDC.c
# ../FreeRTOS/Demo/Common/Minimal/flash.c \
# ../FreeRTOS/Demo/Common/Minimal/BlockQ.c \
# ../FreeRTOS/Demo/Common/Minimal/integer.c \
# ../FreeRTOS/Demo/Common/Minimal/PollQ.c \
# ../FreeRTOS/Demo/Common/Minimal/semtest.c \

ifeq ($(USE_LWIP),YES)

LWIP_THUMB_SRC= \
lwip-1.1.0/src/core/tcp_out.c \
lwip-1.1.0/src/core/inet.c \
lwip-1.1.0/src/core/mem.c \
lwip-1.1.0/src/core/memp.c \
lwip-1.1.0/src/core/netif.c \
lwip-1.1.0/src/core/pbuf.c \
lwip-1.1.0/src/core/raw.c \
lwip-1.1.0/src/core/stats.c \
lwip-1.1.0/src/core/sys.c \
lwip-1.1.0/src/core/tcp.c \
lwip-1.1.0/src/core/tcp_in.c \
lwip-1.1.0/src/core/ipv4/ip.c \
lwip-1.1.0/src/core/ipv4/ip_addr.c \
lwip-1.1.0/src/core/ipv4/icmp.c \
lwip-1.1.0/src/api/tcpip.c \
lwip-1.1.0/src/api/api_msg.c \
lwip-1.1.0/src/api/err.c \
lwip-1.1.0/src/api/api_lib.c \
lwip-1.1.0/src/netif/etharp.c \
lwip-1.1.0/contrib/port/FreeRTOS/AT91SAM7X/sys_arch.c \
lwip-1.1.0/src/netif/ethernetif.c \
EMAC/SAM7_EMAC.c \
lwip-1.1.0/src/core/udp.c \
lwip-1.1.0/src/core/ipv4/ip_frag.c

endif



ARM_SRC= \
../FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c \
Cstartup_SAM7.c \
serial/serial_ISR.c

ifeq ($(USE_LWIP),YES)
ARM_SRC += EMAC/SAM7_EMAC_ISR.c
endif

And had the same kind of problem as you. But I noticed that I forgot -mthumb-interwork from linker flags. Now I have:

LDFLAGS = $(MCFLAGS) -mthumb-interwork -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--no-warn-mismatch

and it works. Thing is that there are different versions of libraries under:
C:\Program Files\yagarto\arm-elf\lib
and linker has to know which one to use.

I hope this helps you,
Madis


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists