Skip to content

Commit 451103e

Browse files
committed
next try
1 parent 6f7138a commit 451103e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ build_flags = ${esp32_4MB_V4_M_base.build_flags}
18651865
-D WLED_DISABLE_BROWNOUT_DET -D WLED_WATCHDOG_TIMEOUT=0
18661866
-D WLED_USE_ETHERNET
18671867
-D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only
1868-
-D CONFIG_ETH_USE_OPENETH ;; enable open_eth support
1868+
-D CONFIG_ETH_USE_OPENETH=y ;; enable open_eth support
18691869
-D WLED_ETH_DEFAULT=2 ;; ESP32-POE board configuration (works with QEMU open_eth)
18701870
-D WLED_QEMU ;; Skip ethernet hardware initialization for QEMU compatibility
18711871
;; Static IP for QEMU testing - user-mode networking provides DHCP at 10.0.2.0/24

wled00/wled.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,19 +1076,22 @@ 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-
// espresiv ecample on how to init open_eth:
1079+
// espresif ecample on how to init open_eth:
10801080
// https://github.com/espressif/esp-afr-sdk/blob/release/v4.4/examples/common_components/protocol_examples_common/connect.c - look for esp_eth_mac_new_openeth()
10811081

10821082
// Don't call ETH.begin() - avoids MAC register crash
10831083
// But manually initialize lwIP and DHCP for QEMU
10841084
tcpip_adapter_init();
1085+
#if !defined(WLED_STATIC_IP_DEFAULT_1)
10851086
tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_ETH);
1087+
#else
10861088
// Or set static IP:
1087-
// tcpip_adapter_ip_info_t ip_info;
1088-
// IP4_ADDR(&ip_info.ip, 10, 0, 2, 15);
1089-
// IP4_ADDR(&ip_info.gw, 10, 0, 2, 2);
1090-
// IP4_ADDR(&ip_info.netmask, 255, 255, 255, 0);
1091-
// tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_ETH, &ip_info);
1089+
tcpip_adapter_ip_info_t ip_info;
1090+
IP4_ADDR(&ip_info.ip, 10, 0, 2, 15);
1091+
IP4_ADDR(&ip_info.gw, 10, 0, 2, 2);
1092+
IP4_ADDR(&ip_info.netmask, 255, 255, 255, 0);
1093+
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_ETH, &ip_info);
1094+
#endif // hack
10921095

10931096
// Network stack will still work via QEMU's user-mode networking (slirp)
10941097
DEBUG_PRINTLN(F("initC: QEMU mode - skipping ETH.begin() hardware initialization"));

0 commit comments

Comments
 (0)