Basic Design Question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Basic Design Question

Spies, Dominik
Hi!

I have some basic questions about the software design with the lwIP stack.
Currently I'm using a port of FreeRTOS with lwIP. This port uses lwIP with NO_SYS true and calling it in one single task in a infinite loop.

Every cycle ethernetif_handlepackets is called, and after that depending on some timing things the tmr functions.

So, I do not think this is a good solution. My first idea is:

Two Tasks, on handling the incoming packets, blocked via queue. An ISR handles incoming packets and write it to the queue.

The second tasks executes all tmr functions.

Because a preemptive scheduler is used, the lwip stack stuff has to be protected via mutexes.

Two tasks for recieving/tmr processing is overhead. So how could I do that in one task? I can either wait for a specified time (tmr stuff) OR for an event (incoming packet) but not both (This is by design of FreeRTOS I think). Suggestions?

Or is it in my case generally better to use the socket api, especially regarding to RAM consumption? I did'nt spent any time on considering to use it because rawapi.txt says it uses much more ram, and I do not have unlimited amount (40kb total) of ram. I do not know how much more ram the socket api needs, but maybe it is not much more or even less than with my "two tasks and queue... " solution.

I hope this is not to basic for this list, but I'm no expert in realtime kernels or embedded systems design, so I hope some of you experts can spend some time helping a beginner ;)

Thanks.

_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: Basic Design Question

FreeRTOS info
> I have some basic questions about the software design with
> the lwIP stack.
> Currently I'm using a port of FreeRTOS with lwIP. This port
> uses lwIP with NO_SYS true and calling it in one single task
> in a infinite loop.


I would be interested others comments on this too - but also be aware that
there are some nice lwIP demos for FreeRTOS.org already that do not use
NO_SYS.  You can use these as a reference.  The most recent in the AVR32
demo.  There is also an ARM7 demo.  These are available in the download.

Regards,
Richard.

+ http://www.FreeRTOS.org
A free real time kernel for 8, 16 and 32bit systems.

+ http://www.SafeRTOS.com
An IEC 61508 certified real time kernel for safety related systems.







_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: Basic Design Question

Spies, Dominik
Richard,

This didn't answer my questions, but thanks for your hint on that, the
AVR32 example is nice. One question regarding the socket api:
Where is the timeout, icmp and other stuff processed?

Dominik



-----Original Message-----
From: lwip-users-bounces+dominik.spies=[hidden email]
[mailto:lwip-users-bounces+dominik.spies=[hidden email]] On
Behalf Of FreeRTOS.org Info
Sent: Freitag, 25. Mai 2007 11:27
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] Basic Design Question

> I have some basic questions about the software design with
> the lwIP stack.
> Currently I'm using a port of FreeRTOS with lwIP. This port
> uses lwIP with NO_SYS true and calling it in one single task
> in a infinite loop.


I would be interested others comments on this too - but also be aware
that
there are some nice lwIP demos for FreeRTOS.org already that do not use
NO_SYS.  You can use these as a reference.  The most recent in the AVR32
demo.  There is also an ARM7 demo.  These are available in the download.

Regards,
Richard.

+ http://www.FreeRTOS.org
A free real time kernel for 8, 16 and 32bit systems.

+ http://www.SafeRTOS.com
An IEC 61508 certified real time kernel for safety related systems.







_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users