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

Karol Gliwa kgliwa at gmv.com
Wed Jul 19 10:16:07 UTC 2023


Hi Chris,

Thanks for this quick clue. I actually managed to run the rtems-libbsd on another device that is Picozed+fmc_carrier_board which I believe is very close in the HW configuration to the zynq_zedboard.. and my problem does not happen anymore with that board. I have successful PING+socket communication with 100Mbps dongle as well as with 1Gbps link.  What I also noticed is I don’t get following messages anymore:  "cgem0: cgem_mediachange: could not set ref clk0 to 25000000." which I've kept ignoring until now.

But regarding the other boards I have problem with. I struggle now with where to put the correct configuration. Should that be enough to provide correct parms during BSP configure/build or some sources need to be modified? 

I tried to play around with the BSP build config but with no success. I paste the BSP build configuration for PYNQ-Z1 board which I currently use:

"""
RUN cd build-bsp-xilinx_zynq_zedboard && PATH="/rtems/5/bin:$PATH"  ../rtems/configure  \
        --target=arm-rtems5 \
    	--enable-tests \	 
        --enable-rtemsbsp=xilinx_zynq_zedboard \	 
        --disable-networking \	 
        --enable-posix \	  
        --enable-smp \	 
        --prefix=/rtems/5 \	 
        --enable-maintainer-mode \	 
        --disable-rtems-debug \	 
        BSP_ARM_A9MPCORE_PERIPHCLK=650000000U \
	    BSP_CONSOLE_MINOR=0 \
	    ZYNQ_CLOCK_CPU_1X=108333333U \
	    ZYNQ_CLOCK_UART=100000000
"""


Thanks for all Help!
Karol Gliwa


-----Original Message-----
From: Chris Johns <chrisj at rtems.org> 
Sent: Wednesday, July 19, 2023 6:20 AM
To: Karol Gliwa <kgliwa at gmv.com>; users at rtems.org
Subject: Re: RTEMS 5.3 libbsd, networking issue for 100mbps link (1Gbps is fine)

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

P Please consider the environment before printing this e-mail.


More information about the users mailing list