This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DP83869HM: Ping test blink led but fail.

Part Number: DP83869HM
Other Parts Discussed in Thread: DP83869, DP83869EVM, LMR54406, TPS923650

Hello,

I have a STM32MP257 <> DP83869HM <> SFP 100Mbps <> OS1 fiber <> TPlink MC100CM converter <> ETH <> linux PC

DP83869 power rails are clean, bias is 1V and clean. CLKo is 25MHz and clean.

From the STM32 point of view, the IF is UP. I'm using 4 status led : Link up, Tx, Rx, TXRX fail

  • When the STM32 pings the computer, DP83869 Tx led blink, TPlink converter blink
  • When the computer pings the STM32, DP83869 Rx led blink, TPlink converter blink

But all ping fails.

Below is what I see with a scope

SFP.LOS = 0 => OK 
SFP.TxDIS = 0 => OK
SFP.TxFault = 0 => OK
SFP.DET = 0 => OK
SFP.RS =1 => OK

FX.nRST OK
FX.CLKo 25MHz
FX.TXCLK 2.5MHz (25MHz when link is up)
FX.RXCLK 2.5MHz (25MHz when link is up)
FX.nINT 0 =>>> is it normal that the nIRQ is stalled at 0 ?

Link LED ON
Tx/Rx Error LED OFF
Tx/Rx Active LED blink when pinging

MDIO reg reading:
0x11 = 0x0402
0x1DF = 0x0002
0xC00 = 0x2100
0xC01 = 0x614D

Following the troubleshootong guide, I tried a BIST test with a fiber looping the Tx/Rx slot of the SFP module. This test fails:

write Reg 0x0016 = 0xF000
read Reg 0x17 = 0x40, bit 11 is not set.

Sometimes, FX_INT_STS (0xC19 reg) is showing a FEF error (value 0x0210)

At this point, I really do not see what other test to do. Any help appreciated.

Thanks

(below is the device tree config, if it can help)

&eth2 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&eth2_rgmii_pins_b>;
	pinctrl-1 = <&eth2_rgmii_sleep_pins_b>;
	phy-mode = "rgmii-txid";
	max-speed = <100>;
	phy-handle = <&eth2_phy>;
	st,ext-phyclk;
	status = "okay";

	sfp0: sfp {
		compatible = "sff,sfp";
		i2c-bus = <&i2c6>;
		mod-def0-gpios = <&gpioh 10 GPIO_ACTIVE_LOW>;
		los-gpios = <&gpioe 1 GPIO_ACTIVE_LOW>;
		tx-fault-gpios = <&gpioe 3 GPIO_ACTIVE_LOW>;
		tx-disable-gpios = <&gpioe 2 GPIO_ACTIVE_LOW>;
		rate-select0-gpios = <&gpioe 5 GPIO_ACTIVE_LOW>;
	};

	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		eth2_phy: ethernet-phy@0 {
			/* compatible = "ethernet-phy-id2000.a0f3"; */
			reg = <0>;

			clocks = <&rcc CK_KER_ETH2>;
			interrupt-parent = <&gpiog>;
			interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
			reset-gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
			reset-assert-us = <50000>;
			reset-deassert-us = <500000>;
			ti,op-mode = <DP83869_RGMII_100_BASE>;
			max-speed = <100>;
			sfp = <&sfp0>;
			modif,quirk-disable-clk-125;
                        modif,quirk-leds-cfg1 = <0xd230>;
                        modif,quirk-gpio-mux-ctrl = <0x00ba>;
		};
    	};
};
  • Hi Nicolas,

    I have a couple questions:

    1. We have a fiber debug guide that I recommend reading through. The FEF error suggests some issue with the fiber interface, however I am interested in how the BIST test was performed. By 'looping the TX/RX slot of the SFP module' do you mean the SFP module has a loopback mode that connects these paths together, or are you soldering the lines together with a wire?

    2. Do you have a DP83869EVM to test with? This is a known-good platform that can be placed into reverse loopback to perform BIST PRBS testing over the MDI. 

    3. When you ping, are you seeing a refusal to identify the host (host unreachable) or are you able to ping the host but with packet loss?

    4. Have you performed any uni-directional testing? Ping testing will use both the TX and RX path on the interface, but there are throughput tests (like iperf3) that can send data one way or the other. Can you try sending data from the STM32 to the linux PC and see if you can get packets through, then reverse the direction by sending from the linux PC to the STM32? This would tell us if one path or the other specifically is failing.

    To answer your question

    is it normal that the nIRQ is stalled at 0 ?

    If the INT_N pin is constantly low, make sure there is an external pullup on this line and that the MAC is not holding this line low. If these are not the case and it is still held low, the PHY is sending an interrupt on the pin due to one of the enabled interrupt conditions. The interrupt register needs to be read in order to clear this condition.

    Best,

    Shane

  • 1/ the loopback test was done simply using a fiber between Tx and Rx.

    We solved this issue adding some delays on tx/rx clock, with this line on the device tree :

    phy-mode = "rgmii-id"

    ping works, and iperf3 report a bitrate around 95Mbps.

  • Finally, no, my issue is not resolved...

    I also have a LVDS screen on the PCB: the link is OK only when the screen is not plugged. I'm working on it since 3 days... The screen itself is not the responsible, but the DC/DC powering the screen is involved. There is a dedicated 2.7V buck for display logic (LMR54406) and a +16V boost for backlight (TPS923650)

    The following tests are without the screen, with the MP2 and PC continuously pinging themselves.

    - 2.7V DC/DC unloaded: link OK

    - DC/DC slighly loaded : link OK

    - DC/DC with nominal load (300..400mA) : link KO (but the Tx activity LED is still blinking)

    Removing the load makes the link instantly OK

    When loading the LMR54406, there is some spikes on the power line when its internal MOS switches ON and OFF. Theses spikes are polluting all the board. Applying the same load on any other DC/DC does not generate any particular noise (I have 3 others regs : 3.3V, 3.7V, 1.7V, based on LMR64410/LMR43606 devices). Same power decoupling and routing techniques are applied for all DC/DC). I'm not able to simulate the LMR54406 : webench simulation is failing. Same with LTspice.

    Using a differential probe, I can see a clean signal on the SFP output, independently of the DC/DC load, so, no, the SFP module seems to not be perturbed by the DC/DC noise (and its LOS output is still 0 - yes there is a pull-up, the signal goes to 1 when disconnecting the fiber).  

    The 25MHz clock is still fine.

    ...But the DP83869 loose the signal.

    An important note is that the SFP output signal is 62.5MHz (125Mbps ?), I don't know what type of modulation is used but I was expecting a multiple of 100MHz (the DP SOP signal is also 62.5MHz so this is probably fine).

    "If the INT_N pin is constantly low, make sure there is an external pullup on this line and that the MAC is not holding this line low. If these are not the case and it is still held low, the PHY is sending an interrupt on the pin due to one of the enabled interrupt conditions. The interrupt register needs to be read in order to clear this condition."
    => Yes, there is a RPU (signal is sometime high when linux is booting), but no, even when manually reading the IRQ reg, IRQ line is still 0:

    mdio st* mmd-c22 0:31 raw 0xC19

  • About the INT_N pin, I found why it is stucked at 0

    I have a bug in my driver, it does not read FX_INT_STS @ 0xC19, and it does not read INTERRUPT_STATUS @ 0x13, explaining 2 issues:

    FX_INT_STS was not 0 when reading it manually (because the driver did never read it)

    - INT_N does not goes back to 1 after a manual read of FX_INT_STS (because it is also associated to INTERRUPT_STATUS)

    Writing 0 to INTERRUPT_MASK and reading FX_INT_STS  when the INT_N fall to 0 make the interrupt scheme working normally. 

    According to my understanding, INTERRUPT_STATUS is only reporting things about ETH. In fiber mode, it does not give any more useful information than FX_INT_STS and can be masked/ignored. Do you confirm?

  • Hi Nicolas,

    As noted in the datasheet, both interrupt registers must be read to clear pending interrupts:

    If you don't need any interrupts from the INTERRUPT_STATUS register you can disable these interrupts via masking, however the register may still need to be read to clear an active interrupt.

    For the power network it seems like the DC/DC is generating noise on the power line that interferes with the devices on your board. Improving the power decoupling/damping network or swapping to a less noisy source would be my recommendation

    Best,

    Shane

  • The power source is a battery. The noise source is clearly the LMR that is generating definitely more noise than expected.

    About the interrupt cleaning... We are using the official driver 

    https://github.com/torvalds/linux/blob/master/drivers/net/phy/dp83869.c

    (written by Dan Murphy from ti ;)

    The interrupt handling function is only reading one register (INTERRUPT_STATUS).  FX_INT_STS is symply ignored. This tends to suggest that the driver has not been tested in fiber mode.

  • Hi Nicolas,

    Our current PHY drivers can be found at this link: https://github.com/TexasInstruments/ti-ethernet-software/blob/main/linux_drivers/dp83869.c

    I'll check with my team to see if interrupts are handled appropriately in fiber mode through the driver.

    Best,

    Shane

  • The feedback I'm getting is that the driver does not check for fiber interrupts, and it seems like you are able to see this as well. The 0x13 interrupt status register should be read through the driver, though let me know if this is not working.

    Best,

    Shane

  • We modified dp83869_handle_interrupt() to read both IRQ regs (0x13 + 0xC19). Now all IRQ flags are cleared, the nINT line goes back to 1 and things are working as expected.