
Choose a route, find the fault
Three ESP32 routes to a cable compared, then the order to look in when a box does not answer. The physical link first, then the PHY and the driver, then IP, and only then the application.
Three routes to a jack
The classic ESP32 has an Ethernet MAC inside, with its own DMA, and needs a PHY outside. ESP-IDF drives it over RMII only, and the six data pins are fixed: GPIO19, 21 and 22 send, 25, 26 and 27 receive. The clock is the part to plan. It comes in on GPIO0 or goes out on GPIO0, 16 or 17, and GPIO0 is a strapping pin, so a clock on it at power-up can start download mode.
The ESP32-S3 has no MAC. In ESP-IDF, Ethernet reaches it only as an SPI controller, a W5500, DM9051 or KSZ8851SNL, that holds the MAC and the PHY together. It needs an SPI bus, a chip select and usually an interrupt line, on pins you choose.
The ESP32-P4 has a MAC inside and a PHY outside, like the classic chip, but each RMII signal picks from two or three GPIOs, and each frame sent or received gets a 64-bit time stamp for IEEE 1588 clock sync. It has no Wi-Fi radio of its own; a board that needs Wi-Fi adds a second ESP chip for it.
Find the fault from the bottom
A box that does not answer can fail at four layers, and each one rests on the one below. Check them in that order.
The physical link: a link light, and in ESP-IDF an ETHERNET_EVENT_CONNECTED. Without it nothing above can work.
The PHY and the driver: the driver must find the PHY at the address it was given, and the PHY and the MAC must agree where the 50 MHz clock comes from. A wrong address looks to the driver like no PHY at all.
IP: IP_EVENT_ETH_GOT_IP means the stack has an address. A link with no address carries nothing an application can use.
The application: the other end must be listening at the address and port the box sends to. That is where the TCP and UDP course takes over.
A check above a broken layer proves nothing, so the first check that fails is the fault. And a working link is still not Internet access: that needs IP routing beyond the switch.
The board side, with its wiring and its code, is Ethernet instead of Wi-Fi in the ESP32 book.
Common mistakes
- Starting with the application. Code that cannot connect is the last thing to suspect. Look for the link, the PHY and the address first.
- Taking a link light for a working network. The light proves the cable and the two PHYs. The driver, the address and the other end are still unproven.
- Choosing a chip before the route. The classic ESP32 fixes its pins and needs a clock plan; the S3 needs an SPI controller; the P4 needs a second chip for Wi-Fi.
Edit this page — content/fundamentals/ethernet/choose-a-route-find-the-fault.mdx
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.