From e5c8a38f944853f7ebba02e8ba3399f1aa9dcbe4 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 15 Jul 2026 01:29:33 +0200 Subject: [PATCH] Stability round 2: WIFI_PS_NONE + 10MHz SDIO 1-bit bus alone did not stop the sdio_write timeout wedge (recurred at ~5min uptime). Modem power save is the new prime suspect: the C6 napping mid-SDIO-transaction matches the minutes-scale periodicity. Always-powered appliance -> PS_NONE costs ~50mW and removes the entire failure class if correct. SDIO clock also halved to 10MHz. Co-Authored-By: Claude Fable 5 --- firmware/main/net.c | 2 ++ firmware/sdkconfig.defaults | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/main/net.c b/firmware/main/net.c index 7070da6..e9a8db2 100644 --- a/firmware/main/net.c +++ b/firmware/main/net.c @@ -83,6 +83,8 @@ static void wifi_event(void *arg, esp_event_base_t base, int32_t id, void *data) } else if (base == IP_EVENT && id == IP_EVENT_STA_GOT_IP) { ip_event_got_ip_t *ev = (ip_event_got_ip_t *)data; s_got_ip = true; + /* always-powered appliance: modem sleep wedges the hosted SDIO link */ + esp_wifi_set_ps(WIFI_PS_NONE); ESP_LOGI(TAG, "got ip " IPSTR, IP2STR(&ev->ip_info.ip)); setenv("TZ", "CET-1CEST,M3.5.0,M10.5.0/3", 1); tzset(); diff --git a/firmware/sdkconfig.defaults b/firmware/sdkconfig.defaults index 91f9d33..cd4da0d 100644 --- a/firmware/sdkconfig.defaults +++ b/firmware/sdkconfig.defaults @@ -51,7 +51,7 @@ CONFIG_ESP_HOSTED_DFLT_TASK_FROM_SPIRAM=n # hosted 2.x: keep internal RAM for task stacks; buffers go to PSRAM CONFIG_ESP_HOSTED_MEMPOOL_PREFER_SPIRAM=y # conservative SDIO clock for first data-path proof (raise after verification) -CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=20000 +CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=10000 # headroom for diag event handlers that touch LVGL CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096