[PATHv11 00/43] net/lwip: add lwip library for the network stack

Maxim Uvarov maxim.uvarov at linaro.org
Thu Jan 4 16:02:21 CET 2024


On Wed, 3 Jan 2024 at 20:30, Fabio Estevam <festevam at gmail.com> wrote:

> Hi Maxim,
>
> On Tue, Jan 2, 2024 at 2:31 PM Maxim Uvarov <maxim.uvarov at linaro.org>
> wrote:
> >
> > Small update here. I made changes without any board limit size changes.
> > Reordered patches to make them compile in sequence. I think I will do one
> > more clean up and more testing,
> > and after that will be able to send an updated version.
> > Working tree is here: https://github.com/u-boot/u-boot/pull/434
>
> In which boards have you tested the series?
>
>
CI tests this in all qemu emulated boards. I tested it locally on Raspberry
Pi - works well. This version did not
yet tested on imx8, but the previous version worked on eth0, did not work
on eth1.  So I plan to continue testing
these patches on different boards. But in general it's the upper layer then
drivers and theoretically has to work on any
board. But in fact different boards work in different ways and behaviour is
different with their qemu model. So I'm a little bit confused
how to test and debug these patches on board which I don't have physical
access...


> I built from https://github.com/muvarov/u-boot/tree/master_lwip_test_v10,
> but
> it does not work reliably on an imx8mn-evk board. (Actualy tftp worked
> only once):
>
> u-boot=> ping 192.168.0.16
> init already done for ethernet at 30be0000
> Using ethernet at 30be0000 device
> pinging addr: 192.168.0.16
> host 192.168.0.16 is alive
>  3 ms
>

It looks like it worked here.


> u-boot=> dhcp Image
>

and this command did not get a dhcp response and unset IP address.
Because there is no IP address then all tftp commands fail. The reasons
might be different:
- no MAC address
- device is not active
- remote DHCP server does not answer for this request

init already done for ethernet at 30be0000
> dhcp using: 0:ethernet at 30be0000
> dhcp_tmo 20/20
> dhcp_tmo 19/20
> dhcp_tmo 18/20
> dhcp_tmo 17/20
> dhcp_tmo 16/20
> dhcp_tmo 15/20
> dhcp_tmo 14/20
> dhcp_tmo 13/20
> dhcp_tmo 12/20
> dhcp_tmo 11/20
> dhcp_tmo 10/20
> dhcp_tmo 9/20
> dhcp_tmo 8/20
> dhcp_tmo 7/20
> dhcp_tmo 6/20
> dhcp_tmo 5/20
> dhcp_tmo 4/20
> dhcp_tmo 3/20
> dhcp_tmo 2/20
> dhcp_tmo 1/20
> dhcp_tmo 0/20
> DHCP client timeout
> u-boot=> tftp Image
> init already done for ethernet at 30be0000
> TFTP from server 192.168.0.16; our IP address is <NULL>
> Filename 'Image'.
> Load address: 0x42000000
> Loading:########################################################
> done
> Bytes transferred = 19808768 (0x12e4200 hex)
> u-boot=> tftp Image
> init already done for ethernet at 30be0000
> TFTP from server 192.168.0.16; our IP address is <NULL>
> Filename 'Image'.
> Load address: 0x42000000
> Loading:eth_send error -22
>

ok. eth_send() is a function which actually sends a packet. It checks if
the device is active or not.
        if (!eth_is_active(current))
                return -EINVAL;
I think eth_init() or something else is missing this specific board. But I
don't have any idea how to fix it
without physical access to this board or a way to reproduce it on some
other board.
'ethact' - is a variable to choose an active net device.


> tftp_get err=-13
> u-boot=> tftp Image
> init already done for ethernet at 30be0000
> TFTP from server 192.168.0.16; our IP address is <NULL>
> Filename 'Image'.
> Load address: 0x42000000
> Loading:eth_send error -22
> tftp_get err=-13
> u-boot=> tftp Image
> init already done for ethernet at 30be0000
> TFTP from server 192.168.0.16; our IP address is <NULL>
> Filename 'Image'.
> Load address: 0x42000000
> Loading:eth_send error -22
> tftp_get err=-13
>
> Rebooted the board and tried again:
>
> u-boot=> ping 192.168.0.16
>

that is really strange, after reboot you should get the initial stage.
You can type 'lwip list' and 'net list' to check if there is an IP address
for
active device set.

eth0: ethernet at 30be0000 00:04:9f:06:33:d3 active
> Using ethernet at 30be0000 device
> pinging addr: 192.168.0.16
> ping_tmo: ping failed; host 192.168.0.16 is not alive
> u-boot=>
>


More information about the U-Boot mailing list