From 7943e0e72abac552dba95326385b998520eb3f1d Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 15 Jul 2026 01:19:52 +0200 Subject: [PATCH] 1-bit SDIO to kill the wedge-reboot loop; gong on cold boot only Night-watch caught the instability in the act at 7min uptime: E H_SDIO_DRV: sdio_write_task: Failed to send data: 258 (timeout) E H_SDIO_DRV: Unrecoverable host sdio state -> SW_CPU_RESET i.e. esp-hosted-mcu#167. Known mitigation: 1-bit SDIO bus (#148), still ~80x voice bandwidth. Also: recovery reboots no longer ring the gong (esp_reset_reason gate) - a butler doesn't bong at 3am. Co-Authored-By: Claude Fable 5 --- firmware/main/desklock_main.c | 5 ++++- firmware/sdkconfig.defaults | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/firmware/main/desklock_main.c b/firmware/main/desklock_main.c index 006bd84..750f5bf 100644 --- a/firmware/main/desklock_main.c +++ b/firmware/main/desklock_main.c @@ -5,6 +5,7 @@ */ #include "esp_log.h" +#include "esp_system.h" #include "bsp/esp-bsp.h" #include "desklock.h" @@ -57,7 +58,9 @@ void app_main(void) face_init(); audio_init(); - audio_play_gong(); + if (esp_reset_reason() == ESP_RST_POWERON) { + audio_play_gong(); /* cold boot only — recovery reboots stay silent */ + } #if WIFI_DIAG_MODE wifi_diag_start(); diff --git a/firmware/sdkconfig.defaults b/firmware/sdkconfig.defaults index 5ff2cc5..91f9d33 100644 --- a/firmware/sdkconfig.defaults +++ b/firmware/sdkconfig.defaults @@ -55,3 +55,7 @@ CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=20000 # headroom for diag event handlers that touch LVGL CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 + +# 1-bit SDIO: fixes the "Unrecoverable host sdio state" wedge family +# (esp-hosted-mcu #167/#148); 2.5MB/s is ~80x what voice needs +CONFIG_ESP_HOSTED_SDIO_1_BIT_BUS=y