esp-rs / esp-idf-svc

Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.)
https://docs.esp-rs.org/esp-idf-svc/
Apache License 2.0
330 stars 183 forks source link

eth_phy_802_3: esp_eth_phy_802_3_reset(140): reset timeout #493

Closed Graceful-Massana closed 1 month ago

Graceful-Massana commented 1 month ago

I'm trying to connect an ESP32-PoE-ISO-WROVER using ethernet with a fixed IP following the examples.

I'm getting this error:

E (624) eth_phy_802_3: esp_eth_phy_802_3_reset(140): reset timeout
E (624) eth_phy_802_3: esp_eth_phy_802_3_basic_phy_init(435): reset failed
E (624) lan87xx: lan87xx_init(341): failed to init PHY
E (624) esp_eth: esp_eth_driver_install(229): init phy failed

Esp-idf version: v5.1-beta1-378-gea5e0ff298-dirt

esp-idf-svc = { version = "0.49", default-features = false } sdkconfig:

# Ethernet
#
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ETH_PHY_INTERFACE_RMII=y
# CONFIG_ETH_RMII_CLK_INPUT is not set
CONFIG_ETH_RMII_CLK_OUTPUT=y
# CONFIG_ETH_RMII_CLK_OUTPUT_GPIO0 is not set
CONFIG_ETH_RMII_CLK_OUT_GPIO=17
CONFIG_ETH_DMA_BUFFER_SIZE=512
CONFIG_ETH_DMA_RX_BUFFER_NUM=10
CONFIG_ETH_DMA_TX_BUFFER_NUM=10
CONFIG_ETH_USE_SPI_ETHERNET=y
# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set
CONFIG_ETH_SPI_ETHERNET_W5500=y
# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set
# CONFIG_ETH_USE_OPENETH is not set
# end of Ethernet
ivmarkov commented 1 month ago

Can't say much without also looking at your program. Some things to check is whether you are providing the correct pins. Those which are hard-coded you cannot get wrong, but for example rmii_mdio and rst are NOT hard-coded. Are you configuring those correctly, according to this schematics?

ivmarkov commented 1 month ago

Copy-paste from here as to what you need to use.

Graceful-Massana commented 1 month ago

Just uploaded my code here .

I sent an email to Olimex and they advised to not use gpio12 as reset because it's meant to power PHY, but I'm still getting similar errors:

image

ivmarkov commented 1 month ago

Did you read my two previous comments? Did you check- in their own C example - what pin they use for "reset"? Did you also check this in the schematics?

I hope you understand, that you can't just pick a free pin for "reset"? You have to use as a reset pin the exact pin, which - on their schematics - is connected to the reset pin of the phy.

ivmarkov commented 1 month ago

Ditto for rmii_mdio.

ivmarkov commented 1 month ago

No feedback, closing.