[Top][All Lists]

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

Re: [lwip-users] esp32 and atsame

From: Sergio R. Caprile
Subject: Re: [lwip-users] esp32 and atsame
Date: Fri, 6 Jul 2018 11:33:43 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.9.0

So you have a perfectly working Ethernet host and you want WiFi. So you
plan to use another lwIP host as a module.
What I would do is to delegate the netif to the module, so basically the
netif running in the host will take care of delivering via the UART and
receiving from the UART.
However, you have to consider memory and the fact that now your netif on
the send side works in an asynchronous mode: when the send function
returns, data has not been sent, so you have to either copy data to your
send buffer and free or reference the pbuf and free it when it's done.
Plus, you will probably need to queue somewhere and pace your
application so it does not send more than what the UART can carry.
On the receiving side, you put in a pbuf what you get from the UART, and
deliver to lwIP.

On the module... you collect from the UART, put in a pbuf, and send to
the netif. When the netif has data, it will deliver to lwIP, so you will
get it from there, in a pbuf, so you wait until the UART sends it to the
host, and you free the pbuf (or you copy it to the send buffer and free
it immediately).
Plus, you will probably need to queue somewhere, as you will surely get
more than what can be sent to the host via the UART.

So, basically, you need a netif on the host and "an lwIP" on the module.
A netif is a driver, and it depends entirely on what you do. There is a
skeleton you can modify for your needs, and by checking other drivers
you will get it in a short time. Search the net as there are a number of
drivers to learn from, I did.

Bear in mind that Espressif likes to modify lwIP with their own
proprietary changes and we don't know what to expect. I guess the netifs
have not been changed, but I don't really know.

reply via email to

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