I've found ESP32-DevKitC always boots up correctly when powered via its micro USB connector but as soon as I tried to power it from the 3V3 pin on the module it would consistently power up in a hung state. I was confident that my TL2575HV-33IKV based power supply circuit was solid as I've used it many times before.
The solution was to add a 1 µF capacitor between ground and the EN pin on the module to hold it down long enough for the 3.3V power rail to fully energize.
The oscilloscope trace shows that it takes about 2ms for the 3.3V power rail (yellow) to come up and with the capacitor in place it takes more than 3ms for nRST (blue) to reach 0.8V.
While the ESP32 has WiFi builtin, it also has support for wired Ethernet using the LAN8720 chip. I've had success with the Waveshare module.
This module is a little bit tricky to use with an ESP32. Luckily Frank Sautter has a page that documents a workaround: Ethernet on ESP32 Using LAN8720. He explains that GPIO0 cannot be pulled low during boot or else the ESP32 enters bootloader serial programming mode. Unfortunately the Ethernet 50 MHz clock oscillator drives this pin (EMAC_TX_CLK) which interferes with booting. His solution was to convert the (unused) NC header pin on the module into ETH_PHY_POWER, tie it to the enable pin on the oscillator, and add a pulldown resistor to prevent it from running until the ETH driver enables ETH_PHY_POWER. But I found is that this configuration did not always work, sometimes the Ethernet chip would wedge on a cold boot.
My solution was to remove the 4.7K resistor that is used to pull
up nRST to VCC (R16) and wire nRST to ETH_PHY_POWER. During boot
before ETH_PHY_POWER is configured the pulldown resistor prevents
the 50 MHz oscillator from driving GPIO0 low. Once the sketch is
running the Ethernet chip can be reset by driving PHY_POW low; when
driven high it enables both the Ethernet chip and the 50 MHz
Here's how I initialize the Ethernet:
/* Insure a reset */ pinMode(ETH_PHY_POWER, OUTPUT); digitalWrite(ETH_PHY_POWER, LOW); delay(10); ETH.begin();
It's necessary to set the pin mode before driving ETH_PHY_POWER low and the delay of 10 ms gives the 3.3V power rail ample time to come up to full voltage before attempting to start the Ethernet.
Here's a description of how I wired Waveshare module:
Waveshare ESP32 Description Pin PIO Description MDC 5 IO14 ETH_PHY_MDC MDIO 6 IO13 ETH_PHY_MDIO CRS 7 IO27 EMAC_RX_DV nINT/RETCLK 8 IO0 EMAC_TX_CLK RX1 9 IO26 EMAC_RXD1 RX0 10 IO25 EMAC_RXD0 TX0 11 IO19 EMAC_TXD0 TX_EN 12 IO21 EMAC_TX_EN (PHY_POW) 13 IO12 ETH_PHY_POWER TX1 14 IO22 EMAC_TXD1
Note that the EMAC pins are fixed and cannot be moved; only ETH_PHY_MDC, ETH_PHY_MDIO, and ETH_PHY_POWER can be assigned to arbitrary GPIO pins.
And as pointed out Frank Sautter's page the Waveshare module is configured to use PHY_ADDR 1 so you need to #define ETH_PHY_ADDR to 1 before including ETH.h.
|16||SD2||d9||RXD1||flash D2 (do not use)|
|17||SD3||d10||TXD1||flash D3 (do not use)|
|18||CMD||d11||RTS1||flash CMD (do not use)|
|20||CLK||d6||CTS1||flash SCK (do not use)|
|21||SD0||d7||RTS2||flash D0 (do not use)|
|22||SD1||d8||CTS2||flash D1 (do not use)|
Copyright © 2018, 2021