cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157C-DK2 Ethernet network is not working

JSomi
Associate II

We brought stm32Mp157C-DK2 board for our prototype testing. I can able to work on the A7 and M4 also ran examples. After 3 days of our work the Ethernet communication is not working. The LED's on the connector is not glowing. I check in Linux terminal with dmesg there is no controller detection . When I reboot the system and check the initial dmesg the output is like this on my linux host sytem using minicom:

root@stm32mp1:~# dmesg | grep eth

[  0.000000] psci: probing for conduit method from DT.

[  1.575436] stm32-dwmac 5800a000.ethernet: PTP uses main clock

[  1.579819] stm32-dwmac 5800a000.ethernet: no reset control found

[  1.586023] stm32-dwmac 5800a000.ethernet: No phy clock provided...

[  1.601232] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42

[  1.606799] stm32-dwmac 5800a000.ethernet:  DWMAC4/5

[  1.611707] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported

[  1.619050] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported

[  1.626354] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported

[  1.633237] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported

[  1.639476] stm32-dwmac 5800a000.ethernet: TSO supported

[  1.644814] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer

[  1.652625] stm32-dwmac 5800a000.ethernet: TSO feature enabled

[  1.692950] usbcore: registered new interface driver cdc_ether

[  2.186587] optee: probing for conduit method from DT.

[  8.406969] stm32-dwmac 5800a000.ethernet eth0: Could not attach to PHY

[  8.441252] stm32-dwmac 5800a000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)

[  9.402998] using random self ethernet address

[  9.404040] using random host ethernet address

I tried of changing cable and checked switch everything is ok. Please suggest how to debug in this case to resolve the issue.

9 REPLIES 9
PatrickF
ST Employee

Hello,

did you use started package or your own SW?

Maybe it is a good idea to Flash SD-Card with latest STM32MP15 ecosystem release v1.1.0

See https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157C-DK2/Let%27s_start/Populate_the_target_and_boot_the_image

If still not working, I suspect a faulty board.

Note that Ethernet LEDs behavior is the PHY (RTL8211F) default one:

0690X00000ArpIbQAJ.jpg

Here is my log, connected to a 100M network:

root@stm32mp1:~# dmesg | grep eth

[   0.000000] psci: probing for conduit method from DT.

[   1.521047] stm32-dwmac 5800a000.ethernet: PTP uses main clock

[   1.525439] stm32-dwmac 5800a000.ethernet: no reset control found

[   1.531693] stm32-dwmac 5800a000.ethernet: No phy clock provided...

[   1.548969] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42

[   1.554493] stm32-dwmac 5800a000.ethernet:  DWMAC4/5

[   1.559548] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported

[   1.566776] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported

[   1.574129] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported

[   1.581016] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported

[   1.587283] stm32-dwmac 5800a000.ethernet: TSO supported

[   1.592580] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer

[   1.600449] stm32-dwmac 5800a000.ethernet: TSO feature enabled

[   1.635628] usbcore: registered new interface driver cdc_ether

[   2.133548] optee: probing for conduit method from DT.

[   8.637902] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found

[   8.698158] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported

[   8.760343] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock

[   8.792495] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

[   9.604900] using random self ethernet address

[   9.623627] using random host ethernet address

[  11.938258] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off

[  11.945364] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thanks Patrick for your reply.

I used starter package and flashed. Starting the board is working fine I can able to connect to network. But after three days of working on the board, when I connect my Ethernet cable none of the LED's are blinking and no communication. Again I re-flashed the starter package but the issue remains unsolved.

How come Ethernet damages if its working already? I checked with multi-meter all the voltages and connections on the Ethernet controller and connector. But nothing seems to be faulty.

I don't know how it could occur, could be a board manufacturing issue (weak solder joint) or a short circuit somewhere during your tests.

As far as I know, we did not experience any reliability issues with this board. I think you were unlucky.

I suggest you to ask your reseller if he could manage a product exchange.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

@PatrickF​ ,

Is there any way to redefine which LEDs are used by RTL8211F PHY? For instance, I use a STM32MP157C-DK2 board on 1Gbit network and I would like to have the LEDs on RJ45 connector to illuminate instead which is not the default configuration. How can I do it? Which software is controlling these LEDs? Can you point me to the right direction?

-albertr

The LED are fully handled by the PHY in HW, currently, the DK1/DK2 board uses default RTL8211F LED configuration which is the following:

LED	polarity	position	color	signification par default
------------------------------------------------------------------------
LED0	active low	RJ45		Green	Blink on TX/RX 10M	       
LED1	active high	RJ45		Yellow	Blink on TX/RX 100M	
LED2	active high	board (LD3)	Green	Blink on TX/RX 1000M	

There is way to change the configuration by playing with RTL8211F internal registers.

I found some DK2 patch example which could help you (I'm not expert):

  • in uBoot add CONFIG_PHY_REALTEK=y in configs/stm32mp15_trusted_defconfig
  • For kernel driver, add the following lines in drivers/net/phy/realtek.c at beginning of rtl8211f_config_init() module
	/* Set green LED for Link, yellow LED for Active */
	phy_write(phydev, RTL821x_PAGE_SELECT, 0xd04);
	phy_write(phydev, 0x10, 0x617f);
	phy_write(phydev, RTL821x_PAGE_SELECT, 0x0);

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

@PatrickF​ , thanks!

I don't need these activity LEDs in u-boot, so I only had to modify realtek PHY code in Linux, here's the patch I ended up with:

http://www.iral.com/~albertr/linux/stm32mp1/0032-RealtekPHY-LEDs.patch

Looks like it's working as intended, although I didn't spend much time in testing. The only weird behavior left-over is that the activity LED is always ON and goes OFF very briefly on TX/RX activity. I would prefer it to be opposite - always OFF and go ON on TX/RX activity. Not sure if it's something that can be controlled via Realtek's registers... If you have any ideas, let me know. Thank you for your help!

Thanks,

-albertr

Good to see it is working.

I think it is on purpose that activity led are always ON and go OFF briefly, just to show that the link is present. Please refer to RTL8211F Datasheet to see if other settings could fit your need.

Otherwise, external glue (e.g. transistor) could be used to 'invert' LED activity (notice that LED polarity is detected using pull-up and pull-down, which are also used to define some PHY configuration, so I guess it is not as simple as wiring led differently).

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

@PatrickF​ , thanks again! Can you share the RTL8211F Datasheet you are referencing above?

-albertr

Sorry, we can't share documents which are under NDA. But if you search on the web, you can probably find some on distributors websites (maybe not the very latest one). You can also ask Realtek support.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.