lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwip on freertos


From: Jesper Vestergaard
Subject: Re: [lwip-users] lwip on freertos
Date: Mon, 15 Jun 2009 15:12:38 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Jesper Vestergaard wrote:
Jesper Vestergaard wrote:
address@hidden wrote:
On Tue, 2009-06-09 at 17:12 +0200, Jesper Vestergaard wrote:
I have found the problem. ip_output_if generates a header for the packet but there's not enough room for it and pbuf_header(p, IP_HLEN)) fails.
To be more precise it is the if ((u8_t *)p->payload < (u8_t *)p +
SIZEOF_STRUCT_PBUF) check in pbuf_header which fails.

What can i do to fix this problem?

That is a very strange problem, the pbuf should have been allocated with
enough space to contain the IP header.

Unfortunately, this code has changed a lot recently (since 1.3.0) so
it's hard to diagnose using the current CVS head, or even establish if
the problem still exists.

To investigate, look for where the pbuf is allocated (should be in
tcp_enqueue() I think), and see what value is given for the first
argument "pbuf_layer layer".  It is this that should control the
additional space allocated for lower layer headers.

Kieran



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


Thanks

I will look into the allocation in tcp_enqueue() and also get the CVS
version for comparison.



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


I finally figured out the probem. The ethernetif driver i am using is designed for an earlier version of lwip and it seems that lwip changed the argument order in etharp_output() in version 1.3.0 so instead of putting the header in the pbuffer, lwip tried to put it in ipaddr. So it was a quick fix after i figured it out.


Now i have run into a problem with a mailbox in lwip or a queue in FreeRTOS. I have a printf in netcom accept just after the creation of the newconn pointer and after the sys_arch_mbox_fetch and they prints:
"newconn 0x2af6"
and
"mbox fetch: 0x10013540 conn: 0x2af6 recmbox: 0xf01f0046"
In accept_function i have a printf just before the data is added to the mailbox and looks like this:
"mailbox: 0x10013540 conn 0x10002600 recvmbox: 0x100136b0"
Why isn't the data properly sent through the mailbox or queue?


Nevermind. I found the problem.
When a new mailbox is created i had changed the size from sizeof( void * ) to a dynamic size. This is not a good idea when queues in FreeRTOS use void pointers.




reply via email to

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