Files
MeshCoreTel-firmware/src/helpers/web
Valentin V. Bartenev 4d404f5301 Web: align page chunk size to MBEDTLS_SSL_OUT_CONTENT_LEN to fix WDT reboot
The hardcoded kWebPageChunkSize of 768 bytes caused the task watchdog
to trigger when serving the web panel over HTTPS.  Each call to
httpd_resp_send_chunk() results in a separate TLS record encryption
via mbedTLS, which on ESP32-S3 uses DMA-backed AES-GCM (esp_aes_process_dma).

The gdma_disconnect() call inside that path enters a critical section,
blocking the IDLE0 task.  With 768-byte chunks, a large page response
requires many such DMA operations in tight succession, starving the IDLE
task long enough to trip the watchdog.

Replacing the hardcoded value with MBEDTLS_SSL_OUT_CONTENT_LEN aligns the
chunk size to the TLS output record buffer, minimising the number of TLS
records (and thus DMA encryption operations) needed to send a full page,
and keeping the httpd task within the watchdog timeout.

Fixes: task_wdt abort in sendProgmemChunked() -> httpd_ssl_send() ->
       esp_aes_process_dma() -> gdma_disconnect() on ESP32-S3.
2026-05-06 21:58:57 +03:00
..