lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] lwIP & multitasking


From: bogdan rosandic
Subject: [lwip-users] lwIP & multitasking
Date: Mon, 20 Dec 2010 06:36:48 -0800 (PST)

HI all,

I am using Stellaris LM3S8962 evaluation board and I am trying out LwIP stack working on top of my own microkernel.
I have implemented sys_arch.c so I could use LwIP with netconn API. I built simple application which behaves like a simple web 
server which sends  page with dynamic content. I created html page in such a way that browser keep sending requests each second after 
first request is made. At the moment  everything worked fine. I have ISR which is called whenever ethernet controler receives or needs to send some data.
This ISR signals a semaphore, and then highest priority task which is blocked on that semaphore, is ready to run. I want to mention that I am using stellaris
driver, so  my highest priority task calls stellarisif_interrupt(&ntwrk_intrfc); function which is part of mentioned stellaris driver. As a result 
tcpip thread (lowest priority) is woken and then it wakes task with middle priority level which listens specified port for incoming connections. This tasks also
refreshes page and sends it to client. My stellaris works at 8Mhz....

Because everything seemed fine at the beginning, I tried to start my browser with lots of tabs, all requesting the same page from stellaris web server.
After a while program ended up in usage or hard fault. Then I figured maybe it was problem with stack sizes. So I allocated greater stacks for specific tasks
(I saw in debugger that tcpip task needs the biggest stack) and program executed well. Then I started more browser tabs, and after a while application stopped sending pages.
No fault, just  stopped sending pages. Now my stack sizes are 128 words except for tcpip stack which is greater.....

Now my application works for about an  hour, serving 25 tabs, and according to wireshark having about 0.45Mbit/s traffic. After that it just stops sending pages.
I searched for an error using debugger but it is very difficult since problem doesn't appear when I am using step by step debugging, or when program is running 
from breakpoint to breakpoint.   

So the question is, did someone have similar problem or can someone give me a hint how to solve this? Is it normal to have some limit of highest traffic allowed 
under this circumstances? I must say I am  beginner  when it comes to lwIP and setting its options. Maybe it's lwIP options, or maybe it's just my kernel .....

Please help, I am stuck for days.....

Thanks in advance!!!  


Bogdan


reply via email to

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