Page 1 of 1

LAN8720A not stable for industrial

Posted: Mon Dec 06, 2021 6:13 pm
by mohasrj
I'm trying to run the ethernet example with my esp32, using a custom breakout board based on the schematic for the Waveshare LAN8720 ETH board : https://www.waveshare.com/LAN8720-ETH-Board.htm.

so if i use Waveshare LAN8720 ETH board with esp32 kit its works fine all time but when i use my custom board its work for around 3 month without reboot.
when i reboot board sometimes PHY LAN cant connect to the network and get the ip adress

output log when its work fine :

I (1165) esp_eth.netif.glue: ethernet attached to netif
I (1177) eth_example: Ethernet Started
I (5177) eth_example: Ethernet Link Up
I (5177) eth_example: Ethernet HW Addr 7c:9e:bd:e1:39:23
I (6104) esp_netif_handlers: eth ip: 192.168.0.168, mask: 255.255.255.0, gw: 192.168.0.254
I (6105) eth_example: Ethernet Got IP Address
I (6108) eth_example: ~~~~~~~~~~~
I (6112) eth_example: ETHIP:192.168.0.168
I (6116) eth_example: ETHMASK:255.255.255.0
I (6121) eth_example: ETHGW:192.168.0.254
I (6126) eth_example: ~~~~~~~~~~~
I (6130) eth_example: exturn derived_ip_addr_string from Ethernet = 192.168.0.168

output log when LAN cant connect correctly :

I (1129) system_api: Base MAC address is not set
I (1129) system_api: read default base MAC address from EFUSE
I (1151) esp_eth.netif.glue: 24:62:ab:f3:20:73
I (1151) esp_eth.netif.glue: ethernet attached to netif
I (1163) eth_example: Ethernet Started



I'm trying to run the ethernet example with my esp32, using a custom breakout board based on the schematic for the Waveshare LAN8720 ETH board : https://www.waveshare.com/LAN8720-ETH-Board.htm.

so if i use Waveshare LAN8720 ETH board with esp32 kit its works fine all time but when i use my custom board its work for around 3 month without reboot.
when i reboot board sometimes PHY LAN cant connect to the network and get the ip adress

output log when its work fine :

I (1165) esp_eth.netif.glue: ethernet attached to netif
I (1177) eth_example: Ethernet Started
I (5177) eth_example: Ethernet Link Up
I (5177) eth_example: Ethernet HW Addr 7c:9e:bd:e1:39:23
I (6104) esp_netif_handlers: eth ip: 192.168.0.168, mask: 255.255.255.0, gw: 192.168.0.254
I (6105) eth_example: Ethernet Got IP Address
I (6108) eth_example: ~~~~~~~~~~~
I (6112) eth_example: ETHIP:192.168.0.168
I (6116) eth_example: ETHMASK:255.255.255.0
I (6121) eth_example: ETHGW:192.168.0.254
I (6126) eth_example: ~~~~~~~~~~~
I (6130) eth_example: exturn derived_ip_addr_string from Ethernet = 192.168.0.168

output log when LAN cant connect correctly :

I (1129) system_api: Base MAC address is not set
I (1129) system_api: read default base MAC address from EFUSE
I (1151) esp_eth.netif.glue: 24:62:ab:f3:20:73
I (1151) esp_eth.netif.glue: ethernet attached to netif
I (1163) eth_example: Ethernet Started

Re: LAN8720A not stable for industrial

Posted: Tue Dec 07, 2021 8:58 am
by silardgal_dotlab
I have had my fair share of trouble with the LAN8720.

The layout of your boards looks okay, but why is the clock so far away?

What I would recommend is to try:
- analyse your clock and check for noise
- get the clock from the ESP32
- try adding hardware reset (not sure if you have it on the board). The driver will reset the LAN when hardware reset is present if not it will use software reset. I had a couple of boards that got fixed by adding hardware reset.

Re: LAN8720A not stable for industrial

Posted: Tue Dec 07, 2021 2:28 pm
by mohasrj
hi, thanks for ur reply,

-as u can see R23 drive clk from oscillator to lan8720a XTAL1 with length 48 mm and R24 drive it from oscillator to esp32 and in esp32 board i have piste length of 45 mm. that why i use zigzag to route this piste.

- i use hadrware rest i connect nRST pin to GPIO (low for 100us)

-i dont know how to choose termination/ adaptation resistors for now i use 10 ohms for RMII ligne and 33R for clk

Re: LAN8720A not stable for industrial

Posted: Wed Dec 08, 2021 8:27 am
by mohasrj
i think its warm reboot , bcs simply pulling nRST pin (PHY LAN8720A) high permanently will not work ....

https://www.eevblog.com/forum/microcont ... -wroom/25/