Skip to main content
Visitor II
March 11, 2022
Solved

Regarding Ethernet Ping Issue in stm32mp157a

  • March 11, 2022
  • 5 replies
  • 3671 views

Hi

We are using stm32mp157a processor in our custom board.we have an 3 port Ethernet switch(KSZ9893RNXIA) with spi interface to processor.We enable Ethernet switch using spi.Read and write to switch is working properly.But we when we connect Ethernet cable to board we have set ipaddr and try to ping the pc in Uboot. But It is not pinging and it is showing phy_conncet() failed.

We are configuring switch in rmii mode with 100mbps speed.

Processor specific dtsi file :

ethernet0: ethernet@5800a000 {

                       compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a";

                       reg = <0x5800a000 0x2000>;

                       reg-names = "stmmaceth";

                       interrupts-extended = <&intc GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,

                                             <&intc GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>,

                                             <&exti 70 1>;

                       interrupt-names = "macirq",

                                         "eth_wake_irq",

                                         "stm32_pwr_wakeup";

                       clock-names = "stmmaceth",

                                     "mac-clk-tx",

                                     "mac-clk-rx",

                                     "ethstp";

                       clocks = <&rcc ETHMAC>,

                                <&rcc ETHTX>,

                                <&rcc ETHRX>,

                                <&rcc ETHSTP>;

                       st,syscon = <&syscfg 0x4>;

                       snps,mixed-burst;

                       snps,pbl = <2>;

                       snps,en-tx-lpi-clockgating;

                       snps,axi-config = <&stmmac_axi_config_0>;

                       snps,tso;

                       power-domains = <&pd_core>;

                       status = "disabled";

               };

Board specific dts file:

&ethernet0 {

       status = "okay";

       pinctrl-0 = <&ethernet0_rmii_pins_a>;

       pinctrl-1 = <&ethernet0_rmii_pins_sleep_a>;

       pinctrl-names = "default", "sleep";

       //phy-mode = "rgmii";

       phy-mode = "rmii";

       max-speed = <100>;

       phy-handle = <&phy0>;

       mdio0 {

               #address-cells = <1>;

               #size-cells = <0>;

               compatible = "snps,dwmac-mdio";

               phy0: ethernet-phy@0 {

                       reg = <0>;

               };

       };

};

    This topic has been closed for replies.
    Best answer by OlivierK

    Hello Sindhu Vadde (Community Member)

    Are you in U-boot? which version?

    you said you are using SPI but in the DT you use mdio driver to connect to the phy?, I guess autonegociation is not possible so have you set the ipconfig manually? Do you see any activity on TX/RX lines?

    Do you use an external crystal to feed the 25/50MHz or from the RCC?

    Could be worth a try with fixed link at 100M.

    https://github.com/ARM-software/u-boot/blob/master/doc/device-tree-bindings/net/fixed-link.txt

    you may set your uboot config.

    CONFIG_PHY_FIXED=y

    Rgds,

    Olivier

    5 replies

    OlivierKAnswer
    Technical Moderator
    March 11, 2022

    Hello Sindhu Vadde (Community Member)

    Are you in U-boot? which version?

    you said you are using SPI but in the DT you use mdio driver to connect to the phy?, I guess autonegociation is not possible so have you set the ipconfig manually? Do you see any activity on TX/RX lines?

    Do you use an external crystal to feed the 25/50MHz or from the RCC?

    Could be worth a try with fixed link at 100M.

    https://github.com/ARM-software/u-boot/blob/master/doc/device-tree-bindings/net/fixed-link.txt

    you may set your uboot config.

    CONFIG_PHY_FIXED=y

    Rgds,

    Olivier

    Visitor II
    March 12, 2022

    Hi

    Thanks for the reply,

    yes i am u boot and version is 2018.11.

    how to use spi driver to connect to the phy?

    I am setting ipconfig manually.

    yes we have seen the clock on RX line.

    We are using external crystal to feed the 50MHz to Ethernet switch and switch gives the 50MHz clk.

    Technical Moderator
    March 14, 2022

    Hi,

    You need to refer to this wiki article for configuring the DT (I did not see any discrepancies with your configuration).

    https://wiki.st.com/stm32mpu-ecosystem-v1/wiki/Ethernet_device_tree_configuration

    I don't know about the SPI driver to connect the phy. Why don't you use mdio which is meant for that purpose? also did you try "fixed-link" as suggested above? Is the phy reset connected?

    Depending of the phy, you may need to adapt the patches found in linux driver to U-boot.

    Regarding activity on the lines, are the RJ45 leds toggling? any RX/TX data activity?

    Log file, maybe adding trace and schematics might help.

    Visitor II
    March 15, 2022

    Hi,

    Thanks for the reply I have tried with fixed-link.

    when we give ping command from board to pc it is working. but,when we give ping cmd from pc to board board is not responding.

    Technical Moderator
    March 16, 2022

    Hi,

    It seems it is the normal behaviour of U-boot:

    extract from Denx post:

    https://lists.denx.de/pipermail/u-boot/2016-September/265408.html

    > Basically, the network works fine. u-boot can send ping to other device, do the tftp boot as well.

    >

    > But, I just realized that u-boot never respond on ping command from external device.

    > Only the exception is that while u-boot is trying to communicate to other device via network

    > (sending a ping command to others, or doing tftp boot, etc)

    >

    > I'm not dug into detail yet.

    > But before doing so, I would like to confirm if this is a intentional behavior or not.

    Yes this is intentional. u-boot only starts the network driver when it

    needs to use it (i.e. to send a ping or download something over tftp).

    After it has finished the network driver is stopped. Any traffic on

    the network will be ignored if u-boot isn't actively trying to perform

    a network operation, even if it is addressed to the device.

    Visitor II
    March 23, 2022

    Hi,

    ping is working in Rmii mode. Now we switched to RGMII mode.but ping is not working.

    we attached one document below for your reference.

    Technical Moderator
    March 24, 2022

    Hi Sindhu,

    I can't see well your schematics, it is a screen capture with the console in the middle.

    but do could you monitor the 125MHz clock?

    what if you do: mii dump 0 1 ?

    MAC address has been provided?

    Regards,

    Olivier

    Visitor II
    March 25, 2022

    Hi

    yes i am monitring 125Mhz clock.

    when i gave mii dump 0 1 i didnot seen any response(i.e,blank screen).

    yes i have given MAC address as 12:34:56:78:9a:bc.

    Visitor II
    March 25, 2022

    Hi @MStev.6​ ,

    Thanks for the reply. But ping is working in rmii mode.But its not working in rgmii mode.

    How can i overcome this ping issue.