← index #6503Issue #9025
Related · high · value 3.976
QUERY · ISSUE

ESP32 LAN8720 MDC/MDIO control only

openby emardopened 2020-10-01updated 2024-10-01
port-esp32needs-info

HI

Are ESP32 libraries that control ETH RMII PHY available
for direct use, I need to control LAN8720 MD interface
with 2 pins called MDC/MDIO, and I'd like some suggestion
how to do it from micropython.

I'd like to control only the PHY using this 2 pins and
II don't want to initialize ESP32 complete wired ethernet
with all of RMII pins, because those RMII pins are not
connected to ESP32.

CANDIDATE · ISSUE

LAN8720 ESP32 throwing error on new firmware

openby hetvishah08opened 2022-08-06updated 2022-08-06
bug

I have made a custom board and I referred to the documentation and tried to connect the LAN8720 with ESP32 and it gives an error as extra keywords given. Also, I feel the documentation of LAN network is incomplete.

It mentions phy_clock but on adding this key it provides error. The firmware used is v.19.1

phy

import network import machine import time from machine import Pin print("Initializing LAN") l = network.LAN(mdc = machine.Pin(23), mdio = machine.Pin(18), phy_type = network.PHY_LAN8720,phy_clock = False, phy_addr=1) P32 = Pin(32, Pin.OUT) P32(0) time.sleep_ms(500) P32(1) Initializing LAN Traceback (most recent call last): File "<stdin>", line 6, in <module> TypeError: extra keyword arguments given

If i remove the phy_clock key, I get the following error:

import network import machine import time from machine import Pin print("Initializing LAN") l = network.LAN(mdc = machine.Pin(23), mdio = machine.Pin(18), phy_type = network.PHY_LAN8720, phy_addr=1) P32 = Pin(32, Pin.OUT) P32(0) time.sleep_ms(500) P32(1) Initializing LAN E (210) emac_esp32: emac_esp32_init(308): reset timeout E (210) esp_eth: esp_eth_driver_install(198): init mac failed Traceback (most recent call last): File "<stdin>", line 6, in <module> OSError: esp_eth_driver_install failed

If I use an older firmware(v.13) version it detects lan but doesn't provide any IP Address. The older version had no field named phy_clock.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied