Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner