Skip to content

Commit f79f0bd

Browse files
committed
QEMU: manually init ethernet and DHCP via esp-idf
1 parent b99ebed commit f79f0bd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

wled00/wled.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,18 @@ bool WLED::initEthernet()
10761076
#ifdef WLED_QEMU
10771077
// QEMU: Skip hardware initialization - QEMU's open_eth doesn't fully emulate MAC registers
10781078
// The ethernet hardware init crashes with LoadStorePIFAddrError in emac_ll_clock_enable_rmii_output
1079+
1080+
// Don't call ETH.begin() - avoids MAC register crash
1081+
// But manually initialize lwIP and DHCP for QEMU
1082+
tcpip_adapter_init();
1083+
tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_ETH);
1084+
// Or set static IP:
1085+
// tcpip_adapter_ip_info_t ip_info;
1086+
// IP4_ADDR(&ip_info.ip, 10, 0, 2, 15);
1087+
// IP4_ADDR(&ip_info.gw, 10, 0, 2, 2);
1088+
// IP4_ADDR(&ip_info.netmask, 255, 255, 255, 0);
1089+
// tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_ETH, &ip_info);
1090+
10791091
// Network stack will still work via QEMU's user-mode networking (slirp)
10801092
DEBUG_PRINTLN(F("initC: QEMU mode - skipping ETH.begin() hardware initialization"));
10811093
successfullyConfiguredEthernet = true;

0 commit comments

Comments
 (0)