RTEMS 5.3 libbsd, networking issue for 100mbps link (1Gbps is fine)

Chris Johns chrisj at rtems.org
Wed Jul 19 04:19:36 UTC 2023


On 18/7/2023 8:21 pm, Karol Gliwa wrote:
> Hi Guys,
> 
>  
> 
> I have following problem with networking on Zynq running RTEMS 5.3 + libbsd +
> BSP zynq_zedboard of according version.
> 
> I had to patch the libbsd to support some network PHY for the boards I use.
> 
>  
> 
> Whenever I connect the device to 1Gbit interface, and the link is negotiated to
> 1Gbit everything seems working just fine. I can PING the board and successfully
> connect to TCP/IP socket (custom test echo server basing on the examples int the
> rtems-libbsd repository + sockets).
> 
>  
> 
> When I connect the board to 100Mbit interface (another usb dongle) it seems to
> establish the link fine, but I cannot ping the board nor connect to the socket.
> I replicated this behavior with at least three different 1Gbit interfaces (works
> each time) and two 100Mbit dongles (not working). I confirmed that behavior
> using PYNQ Z1 board and also with our other custom device.
> 
>  
> 
> Additionally, I had an opportunity to test our custom board with another 'hello
> world' echo server that came from my colleges that use Xilin'x Vitis + LwIP
> (bare metal application) and that one has been working in every link speed
> configuration.
> 
>  
> 
> It seems to me that the problem my reside in the RTEMS software part or drivers
> (or my compilation or configuration) and not in the HW since I could confirm
> it's working with LwIP for all configs... Unfortunately, I have little
> experience with networking in general and was not able to solve that issue on my
> own.
> 
>  
> 
> I attach the RTEMS shell output of `ifconfig -a` executed on PYNQ Z1 when
> connected to 1Gbit eth device (PING working):
> 
>  
> 
> '''
> 
> SHLL [/] # ifconfig  cgem0 192.168.10.207 netmask 255.255.255.0
> 
> SHLL [/] # ifconfig -a                                                   
> 
> cgem0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 
>         options=80008<VLAN_MTU,LINKSTATE>
> 
>         ether 0e:b0:ba:5e:ba:11
> 
>         inet6 fe80::cb0:baff:fe5e:ba11%cgem0 prefixlen 64 scopeid 0x1
> 
>         inet 192.168.10.207 netmask 0xffffff00 broadcast 192.168.10.255
> 
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> 
>         media: Ethernet autoselect (1000baseT <full-duplex,master>)
> 
>         status: active
> 
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> 
>         options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
> 
>         inet 127.0.0.1 netmask 0xffffff00
> 
>         inet6 ::1 prefixlen 128
> 
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
> 
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> 
>         groups: lo
> 
> '''
> 
>  
> 
>  
> 
> Then hot switch to 100Mbit usb eth card (PING not working):
> 
> '''
> 
> SHLL [/] # info: cgem0: link state changed to DOWN
> 
> cgem0: cgem_mediachange: could not set ref clk0 to 25000000.
> 
> info: cgem0: link state changed to UP
> 
> SHLL [/] # ifconfig  cgem0 172.19.1.207 netmask 255.255.255.0 
> 
> SHLL [/] # ifconfig -a                                                 
> 
> cgem0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 
>         options=80008<VLAN_MTU,LINKSTATE>
> 
>         ether 0e:b0:ba:5e:ba:11
> 
>         inet6 fe80::cb0:baff:fe5e:ba11%cgem0 prefixlen 64 scopeid 0x1
> 
>         inet 172.19.1.207 netmask 0xffffff00 broadcast 172.19.1.255
> 
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> 
>         media: Ethernet autoselect (100baseTX <full-duplex>)
> 
>         status: active
> 
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> 
>         options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
> 
>         inet 127.0.0.1 netmask 0xffffff00
> 
>         inet6 ::1 prefixlen 128
> 
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
> 
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> 
>         groups: lo
> 
> '''
> 
>  
> 
>  
> 
>  
> 
> Do You have any idea of what may be causing the issue here? Thanks for all help
> in advance.

Are the clocks to the PHY being correctly set and the driver knows the frequency.

Chris


More information about the users mailing list