[lwip-users] PBUFS + MEMP + LWIP 1.3.0

31 views
Skip to first unread message

Sirjee Rooplall

unread,
Feb 10, 2010, 3:57:24 AM2/10/10
to Mailing list for lwIP users
In LWIP 1.3.0 MEMP memory uses static memory, I have external SDRAM and wish for MEMP to allocate memory in the external memory which is managed by the the heap.
 
I am using the UC3A device, external SDRAM, heap is in external SDRAM. I use the heap_3.c file in my project.
 
How do I get MEMP to use this memory for its memory pools, I cannot see how this can be done in the current implementation of memp.
 
I found a website which talks about lwipopts, and one of the options, it talks about to force memp and mem to use the standard library malloc for all its memory allocation is:
 
#define MEMP_MEM_MALLOC 1
#define MEM_LIBC_MALLOC 1
 
seen in website:
 
However I cannot see where these difnes will be used in LWIP port 1.3.0.
 
Please can someone help understand this better and tell me how I can make LWIP use malloc from the standard C implementation, so that I can free up some of my static memory. I can get MEM to use libc malloc, by second definition above, but I cannot get memp to do the same.
 
Please help, Thanks in advance.
 
 
Kind Regards,
 
Sirjee Rooplall
Figment Design laboratories (Pty) Ltd
mailto:
sir...@figment.co.za
Mobile: +27 (0)83 230 8466
signature.jpg

Simon Goldschmidt

unread,
Feb 10, 2010, 5:17:58 AM2/10/10
to Mailing list for lwIP users

"Sirjee Rooplall" wrote:
> seen in website:
> http://lwip.wikia.com/wiki/Lwipopts.h#Memory_management_.28RAM_usage.29
>
> However I cannot see where these difnes will be used in LWIP port 1.3.0.

There have been a lot of changes since 1.3.0, one of them is moving heap and memp-pools to user-defined sections. Like others, I'd suggest moving to 1.3.2.

PS: is there any specific reason you mark your emails as "high priority"?

Simon
--
NEU: Mit GMX DSL �ber 1000,- � sparen!
http://portal.gmx.net/de/go/dsl02


_______________________________________________
lwip-users mailing list
lwip-...@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users

Sirjee Rooplall

unread,
Feb 10, 2010, 5:42:42 AM2/10/10
to Mailing list for lwIP users
Hi,

Is there a port of 1.3.2 for the ATMEL UC3A0512 device?

If no where can I get the 1.3.2 LWIP stack.

I am using PPP, and at the moment I am trying to track a bug that causes my
system to crash, and when I stop me debugger it points to the
PPPthreadHandle. The failure seems to occur in the function pppInProc()
everytime.

The change log, does not show any changes to the PPP code, so I am just
worried that I am going to waste alot more time to get the port done and
face the same problems.

I have seen in a website that when physical layer is not present i.e modem
in my case that the pppThread must be removed.
And that implementation of the thread remove used a function called
sys_arch_thread_remove, which does not appear in the LWIP 1.3.0, sys_arch.c
file.

Is there an example of proper use of the LWIP PPP stack that I can look at
to get some pointers.

The reason I started looking at the memory, is beacuse normally these kind
of system crashes is related to memory mismanagement or messed up pointers.

Please bear with me, as I may ask some question which may seem dumb, but I
am fairly new to LWIP stack, and I am trying to get my head around its
workings.

The only reason my emails are marked High Priority is because when I send
emails, I want the server to send them immediately without any delays, and
it has no relevance to your response time, however I thank you for you promt
response.


Kind Regards, Sirjee Rooplall Figment Design laboratories (Pty) Ltd mailto:
sir...@figment.co.za Mobile: +27 (0)83 230 8466

Boulanger, Cyrille

unread,
Feb 10, 2010, 5:57:43 AM2/10/10
to Mailing list for lwIP users, sir...@figment.co.za
Hi Sirjee,

> Is there a port of 1.3.2 for the ATMEL UC3A0512 device?

Yes, it's available in a pre-release of the AVR UC3 Software Framework 1.7 here: http://www.atmel.no/beta_ware/

Regards,

Cyrille.
.

> > NEU: Mit GMX DSL über 1000,- ¿ sparen!

Sirjee Rooplall

unread,
Feb 10, 2010, 6:07:43 AM2/10/10
to Mailing list for lwIP users
Thanks,

Are there any good LWIP PPP implementation example software?


Hi Sirjee,

Regards,

Cyrille.
.

> > NEU: Mit GMX DSL �ber 1000,- � sparen!

Simon Goldschmidt

unread,
Feb 10, 2010, 6:41:51 AM2/10/10
to Mailing list for lwIP users

"Sirjee Rooplall" wrote

> I am using PPP, and at the moment I am trying to track a bug that causes
> my
> system to crash, and when I stop me debugger it points to the
> PPPthreadHandle. The failure seems to occur in the function pppInProc()
> everytime.
>
> The change log, does not show any changes to the PPP code, so I am just
> worried that I am going to waste alot more time to get the port done and
> face the same problems.

There were some problems fixed with PPP with 1.3.1 or 1.3.2, but I only started to work on PPP after the 1.3.2 release (available in CVS HEAD - however there are too many changes there to use it right now).

> I have seen in a website that when physical layer is not present i.e modem
> in my case that the pppThread must be removed.
> And that implementation of the thread remove used a function called
> sys_arch_thread_remove, which does not appear in the LWIP 1.3.0,
> sys_arch.c file.

That isn't really necessary. Calling pppHup (I think it was) should make the pppMain thread end itself. Your port only has to cope with thread functions returning, that should be all.

> Is there an example of proper use of the LWIP PPP stack that I can look at
> to get some pointers.

I'm afraid there isn't, currently. I do use it in the example win32 port, but that doesn't really help since it's based on CVS HEAD.

But even if there haven't been that many changes for PPP, it's still worth upgrading to 1.3.2 for the rest of the fixes.

Simon
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser

Sirjee Rooplall

unread,
Feb 10, 2010, 7:04:52 AM2/10/10
to Mailing list for lwIP users
Hi,

The pppMain thread is created as a sys_thread_new in sys_arch.c, from the
ATMEL UC3A port of LWIP.

So I am not sure how the thread will end bby itself.

At the moment sys_threads cannot be ended, because of how they are created.

I do call pppSigHUP when I lose GPRS(physical layer).

But talk me through this senario,

From startup, once I get GPRS connection, I then call pppInit, then
pppOverSerialOpen.
pppOverSerialOpen creates the pppMain thread using sy_thread_new.

Now when I lose GPRS connection, i.e NO CARRIER.

I then try to re-establish GPRS and I can, what do I do to startup PPP stack
for the second time, and what should I have done when I lost CARRIER to
bring PPP down safely then UP again safely, without breaking any stack
rules.


Kind Regards, Sirjee Rooplall Figment Design laboratories (Pty) Ltd mailto:
sir...@figment.co.za Mobile: +27 (0)83 230 8466
----- Original Message -----
From: "Simon Goldschmidt" <gold...@gmx.de>
To: "Mailing list for lwIP users" <lwip-...@nongnu.org>
Sent: Wednesday, February 10, 2010 1:41 PM
Subject: Re: [lwip-users] PBUFS + MEMP + LWIP 1.3.0


>

Simon Goldschmidt

unread,
Feb 10, 2010, 7:33:33 AM2/10/10
to Mailing list for lwIP users

"Sirjee Rooplall" wrote:
> Hi,
>
> The pppMain thread is created as a sys_thread_new in sys_arch.c, from the
> ATMEL UC3A port of LWIP.
>
> So I am not sure how the thread will end bby itself.

Normally, a thread function loops endlessly. If such a function returns, the thread should be terminated automatically.

I'm afraid I can't help you much with your problem at the moment as it would require me going through this myself, and I don't quite have that time currently. I didn't play around with stopping and restarting ppp links, yet.

Simon
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -

sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

Reply all
Reply to author
Forward
0 new messages