SDIO tuning for sustained audio-upload TX (the real wall)
Test, Build and Push / test-gateway (push) Successful in 11s
Test, Build and Push / release (push) Skipped
Test, Build and Push / build-gateway (push) Skipped

Root cause of the "blue screen on tap": NOT a firmware bug. The touch
fix worked (reached "listening"), and the mic audio then streamed
upstream — which instantly triggered the upstream SDIO wedge (#167):

  sdio_write_task: Failed to send data: 258 (timeout) -> host restart

i.e. the same wedge we fought overnight, but now provoked reliably by
the sustained ~32KB/s mic upload instead of waiting minutes. The wedge
is a host->slave SDIO write timeout: the slave RX buffers fill because
its Wi-Fi TX cannot drain fast enough.

Attempt: restore the slave Wi-Fi TX path shrunk during the RAM hunt and
enlarge the SDIO queues so the burst is absorbed and drained:
- WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 24->64, STATIC_RX 8->16, RX 24->32
- WIFI_RMT_TX_BA_WIN 16->32
- ESP_HOSTED_SDIO_TX_Q_SIZE / RX_Q_SIZE = 32
- SDIO clock 10->20 MHz for drain headroom (still 1-bit)
Boot verified: no RAM famine, connects clean. Whether it survives the
audio burst is the open question upstream has not solved.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 09:18:03 +02:00
co-authored by Claude Fable 5
parent 5c6a6eba36
commit ac9d24e0f9
+9 -5
View File
@@ -37,11 +37,11 @@ CONFIG_LV_USE_FONT_COMPRESSED=y
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_CP_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=8
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=24
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=24
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64
CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y
CONFIG_WIFI_RMT_TX_BA_WIN=16
CONFIG_WIFI_RMT_TX_BA_WIN=32
CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y
CONFIG_WIFI_RMT_RX_BA_WIN=16
@@ -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=10000
CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=20000
# headroom for diag event handlers that touch LVGL
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
@@ -59,3 +59,7 @@ 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
# absorb the mic-audio upstream burst without stalling the SDIO write
CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE=32
CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE=32