Esp32 for WT32-ETH01 compilation crashes with "unreachable code"

I am trying to compile a firmware for a WT32-ETH01 device. Flashed it using UART (no USB port) using web flash without problems. The initial yaml included

esp32:
  board: esp32dev
  framework:
    type: esp-idf

Which did not compile. In another thread here there was a solution to it by changing esp-idf to “arduino”, which fixed the compilation error, but it introduced another:

Compiling .pioenvs/esphome-web-b38560/lib4c5/Network/NetworkClient.cpp.o
execv errno (13)
thread 'main' panicked at 'internal error: entered unreachable code', main.rs:223:5

Full log attached.

Has anyone got an idea on how to compile a firmware for this device?
BTW, I am still using wifi, as the old recommended setup for this device on many tutorials (How I installed ESPHome on the wt32-eth01) does not work:

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16

as clk_mode is deprecated.
Wifi works for now anyway after initializing the device - I just can’t compile a firmware with the current (2025.8.1) ESPHome build.

INFO ESPHome 2025.8.1
INFO Reading configuration /config/esphome/esphome-web-b38560.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esphome-web-b38560 (board: esp32dev; framework: arduino; platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip)
--------------------------------------------------------------------------------
INFO Package configuration completed successfully
Library Manager: Installing ESP32Async/AsyncTCP @ 3.4.5
INFO Installing ESP32Async/AsyncTCP @ 3.4.5
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Installing ESP32Async/ESPAsyncWebServer @ 3.7.10
INFO Installing ESP32Async/ESPAsyncWebServer @ 3.7.10
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
INFO Package configuration completed successfully
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-arduinoespressif32 @ 3.2.1 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.858a988d6e 
 - tool-esptoolpy @ 5.0.2 
 - tool-mklittlefs @ 3.2.0 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
Dependency Graph
|-- Networking @ 3.2.1
|-- AsyncTCP @ 3.4.5
|-- WiFi @ 3.2.1
|-- FS @ 3.2.1
|-- Update @ 3.2.1
|-- ESPAsyncWebServer @ 3.7.10
|-- ESP32 Async UDP @ 3.2.1
|-- DNSServer @ 3.2.1
|-- ESPmDNS @ 3.2.1
Compiling .pioenvs/esphome-web-b38560/lib4c5/Network/NetworkClient.cpp.o
execv errno (13)
thread 'main' panicked at 'internal error: entered unreachable code', main.rs:223:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Compiling .pioenvs/esphome-web-b38560/lib4c5/Network/NetworkEvents.cpp.o
*** [.pioenvs/esphome-web-b38560/lib4c5/Network/NetworkClient.cpp.o] Error 101
execv errno (13)
thread 'main' panicked at 'internal error: entered unreachable code', main.rs:223:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
*** [.pioenvs/esphome-web-b38560/lib4c5/Network/NetworkEvents.cpp.o] Error 101
========================== [FAILED] Took 9.59 seconds ==========================

Any hints?

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk:
    pin: GPIO0
    mode: CLK_EXT_IN
  phy_addr: 1
  power_pin: GPIO16

Thanks, yes, I tried this as well - clk: is the recommended predecessor for clk_mode - but this does not solve the problem I have with the thread 'main' panicked at 'internal error: entered unreachable code', main.rs:223:5

IMHO an unreachable code should never be, especially not in Rust.

So I can’t even test the ethernet module, as I don’t get it compiling.

I think now this is a bug in esphome 2025.8.1 - my other wt32-eth01 that runs with esphome2023 does not compile with an unchanged .yaml file. I can’t update it any more. the clk/clk_mode does not matter, the compiling error seems to have another cause. Maybe later esphome updates “fix” that problem?

Thanks for this thread. I have the same prob with all of my esp32 devices since update to 2025.8.1.