WDT activated after LAN init
Port, board and/or hardware
ESP32 - FREENOVE - ESP32-WROVER--DEV
MicroPython version
Test done with MP 1.25.0
Reproduction
- Paste this code in the MP console
import network
lan = network.LAN(mdc=8, mdio=7, phy_type=network.PHY_LAN8720, phy_addr=0,power=None)
Expected behaviour
Expected: To see an ethernet init error since there is no ETH hardware in the device.
Works fine when the ETH hardware is present.
Observed behaviour
MicroPython v1.25.0 on 2025-04-15; Generic ESP32 module with SPIRAM with ESP32
Type "help()" for more information.
import network
lan = network.LAN(mdc=8, mdio=7, phy_type=network.PHY_LAN8720, phy_addr=0,power=None)
ets Jun 8 2016 00:22:57
rst:0x8 (TG1WDT_SYS_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4892
ho 0 tail 12 room 4
load:0x40078000,len:14896
load:0x40080400,len:4
load:0x40080404,len:3372
entry 0x400805b0
W (184) boot.esp32: PRO CPU has been reset by WDT.
W (184) boot.esp32: WDT reset info: PRO CPU PC=0x400814f1
W (185) boot.esp32: WDT reset info: APP CPU PC=0x400814f1
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
Reinitializing network.LAN with W5500 Causes Connection Loss Until Hard Reset
Port, board and/or hardware
esp32 port
MicroPython version
All Versions
MicroPython v1.25.0-preview.283.g11c9656fa on 2025-02-10; Generic ESP32 module with SPIRAM with ESP32
Reproduction
Issue Description:
When running the following MicroPython script on an ESP32 with a W5500 Ethernet module, the connection works correctly on the first run after powering up the board. However, if the script is executed again without a full power cycle or machine.reset(), the device loses network connectivity (cannot be pinged).
- Power on the ESP32 with the W5500 module connected.
- Run the following MicroPython script:
import network
import time
from machine import Pin, SPI, reset
rst = Pin(15, Pin.OUT)
rst.value(0)
time.sleep(0.1)
rst.value(1)
time.sleep(0.5)
spi_nic = SPI(1, baudrate=26000000, sck=Pin(18), mosi=Pin(21), miso=Pin(19))
nic = network.LAN(phy_type=network.PHY_W5500, spi=spi_nic, phy_addr=1, cs=Pin(5), int=Pin(4))
config = ('192.168.1.120', '255.255.255.0', '192.168.1.1', '8.8.8.8')
nic.ifconfig(config)
nic.config(mac=b'\x02\xAB\xCD\xEF\x01\x02')
nic.active(True)
time.sleep(0.5)
while not nic.isconnected():
print(".", end="")
time.sleep(0.25)
print("\r\nip=", nic.ifconfig())
- Confirm that the device is reachable via ping.
- Run the script again without resetting the board.
- Observe that the device no longer responds to ping, and the network connection is lost.
- If machine.reset() is executed before re-running the script, the connection works fine again.
Expected behaviour
Re-running the script should properly reset the W5500 and establish a new network connection without requiring a full board reset.
Observed behaviour
After executing the script multiple times without a full reset, the ESP32 loses network connectivity. The W5500 module does not seem to reinitialize correctly unless a full machine.reset() is performed.
Additional Information
Workarounds Tried:
Explicitly deactivating nic before reinitializing:
try:
nic.active(False)
del nic
except:
pass
→ Did not solve the issue.
Resetting the W5500 before reinitialization using rst pin:
→ No effect; issue persists.
Performing machine.reset() before re-running the script:
→ Works, but not an ideal solution
Code of Conduct
Yes, I agree