lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Free LwIP resources


From: FreeRTOS Info
Subject: Re: [lwip-users] Free LwIP resources
Date: Thu, 08 Sep 2011 08:53:08 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2



On 08/09/2011 07:34, AMSN wrote:
> 
> Hi all,
> 
> I am using lwIP v1.3.2 with FreeRTOS v6.1.0. My application is a web server
> based on netconn API.
> I have four tasks: tcpip, Ethernet interface, http and dhcp.
> 
> I am looking for a method that allow the following:
> - delete all threads
> - free LwIP resources
> - set down and remove the netif
> Since I need to re-start the application again.
> 
> Please give me some comments.
> Thank you very much !


First - I don't know exactly what you are doing, so this suggestion
might not be appropriate, but if you are truly restarting the entire
application, then the simplest thing to do would reset the
microcontroller (either hard reset using the watchdog, or a soft reset
in software).

Second - I don't want to get into FreeRTOS support here.  This is an
lwIP list and FreeRTOS has its own support forum.  Superficially though,
as far as deleting FreeRTOS tasks go, then when you create a task using
xTaskCreate() you have the option of obtaining a handle to the task,
that can then be used to delete the task.  You must do that with care
though, if the task is blocked on a queue or such like.  You might also
want to delete the queues, etc.  So you don't get into memory
fragmentation problems though, it might be better to design your tasks
such that they can go back to their start rather than deleting them then
recreating them.

Restarting the lwIP tasks will cause the lwIP init and MAC driver
functions to be called again, on the assumption they are not called from
main() before the scheduler is started.  The effect will probably be
different depending on the type of memory management you are using (for
example, you don't want malloc() memory leaks if malloc() is used).  I
will let the lwIP experts answer that fully though.


Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.
More than 7000 downloads per month.







reply via email to

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