lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Receving file from web server using raw TCP


From: Andy Pont
Subject: Re: [lwip-users] Receving file from web server using raw TCP
Date: Wed, 20 Jan 2016 14:01:32 -0000

Hello Sergio,

> You may or may not receive a single pbuf, it depends on memory
> conditions when the stack puts a received frame to memory, and that is
> the job of the layer-2 driver, which you should validate by running
> known to work applications and a known to work lwip port for your
> hardware.

Unfortunately I am not aware of there being a known to work lwip port for an
x86 platform running as bare metal code directly from firmware in 16bit real
mode i.e. no operating system services.

The lwip code was pulled from git around October 2015 so I assume is
reasonably stable but I think I am in the situation where I am debugging the
network hardware interface code and the application at the same time.

> Going back to TCP, a typical receive callback is something like this:

I have modified my receive callback to look like the example that you gave
but I am not a great deal further forward in resolving the issues that I
have.  The myclose() function I have implemented is based on one of the
contributed samples and just looks like:

static void tcp_close_connection(struct tcp_pcb *tpcb)
{
        tcp_arg(tpcb, NULL);
        tcp_sent(tpcb, NULL);
        tcp_recv(tpcb, NULL);
        tcp_close(tpcb);
}

I will take another look at it to resolve what happens if tcp_close() fails.

At the moment though I get assert messages as:

Assertion "pbuf_free: p->ref > 0" failed at line 691 in
net/lwIP/src/core/pbuf.c

I haven't figured out what is causing these but they appear to occur
randomly in that during some tests there aren't any and in other identical
tests there can be as many as 3 or 4 generated.

Andy.





reply via email to

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