ESP32 LAN8720 MDC/MDIO control only
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.
LAN8720 ESP32 throwing error on new firmware
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
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.