lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Using UDP and TCP simultaneously (FreeRTOS 4.2.1 & lwip 1.1


From: BMW Cyclist RR
Subject: [lwip-users] Using UDP and TCP simultaneously (FreeRTOS 4.2.1 & lwip 1.1.0)
Date: Thu, 24 Jan 2008 13:45:06 -0500

I am hoping someone can provide some insight regarding some problems I am
seeing when trying to use UDP (multicast) and TCP (FreeRTOS 4.2.1 BasicWeb
demo app) concurrently on a AT91SAM7X512 platform.

I am doing development under YAGARTO on WinXP using Eclipse with gcc. My
makefile successfully builds the standard FreeRTOS 4.2.1 release just fine.
I can run gdb on my platform under Eclipse using the Amontec JTAGKEY
product.

I've kept the basic Web server application intact while I've added a UDP
task that sends multicast packets via the default ethernet interface. I am
using a standard Atmel AT91SAM7X-EK board with a (self-upgraded)
AT91SAM7X512 processor. So I now have a full 128 KB of RAM available.

The UDP task is currently created in the vBasicWEBServer function within the
BasicWeb.c file, after the lwip initialization functions have been called
and after the network interface has been brought up (i.e. netif_set_up).

The BasicWEB sys_thread is executing at tskIDLE_PRIORITY + 2, as is my UDP
task. Another trival task to simulate SPI I/O is creating data for the UDP
task and runs in a simple loop using vTaskDelay calls. It's also running
with a priority of tskIDLE_PRIORITY + 2. All tasks and the BasicWeb
sys_thread have default stack sizes of configMINIMAL_STACK_SIZE.

The UDP task sends relatively large packets (~1400+ bytes) via multicast and
sends packets almost continuously. I've inserted a 1 mSec delay after each
UDP packet is sent and a 10 mSec delay after every ten or so packets are
sent. The application is a phased array sonar device, hence the relatively
high data rate. I am running the ethernet at 100 Mb/sec.). I am using the
netconn API in lwip for the UDP application.

I've of course enabled udp in the lwipopts.h file and called udp_init()
right after ip_init() in the vlwIPInit funtion in BasicWEB.c. I've kept the
defaults in lwipopts.h. I've also kept:

        configTOTAL_HEAP_SIZE           ( ( size_t ) 22000 )

I've kept all the FreeRTOS demo tasks intact and alive as a sanity check
that I've not broken something in FreeRTOS as I add code to my applications.
Thus I see the LEDs flashing as usual on the AT91SAM7X-EK board until
something "bad" happens.

The UDP application runs very reliably and when executing by itself
seemingly will run forever. However, when I attempt to exercise the demo
webserver task, the software appears to "hang up" in one of several places
in the code. I won't elaborate on those before I ask the group some basic
questions.

1. Why is the demo web server app created as a sys_thread, not as a generic
FreeRTOS task?
2. Should additional tasks that require access to lwip functionality also be
implemented as sys_threads, not FreeRTOS tasks as I have done?
3. Would upgrading my lwip to version 1.2.0 be a good idea before worrying
further about my applications?
4. I also need to implement another tcp task to provide a control interface
for the sonar unit. So I need to get these issues straightened out before I
add additional code and confusion to the mix.

Any help or insight would be most appreciated.

Thanks,

Dave Squires

-----------------------------------
SQUIRES ENGINEERING, INC.
2604 Lowell Circle
Melbourne, FL 32935-2215
phone:  (321) 242-8611
fax:    (321) 242-0949
website: http://www.squires-eng.com
-----------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]