From 024d2583f079410398237e6d58df3bc3e4d32403 Mon Sep 17 00:00:00 2001 From: ruv Date: Sun, 15 Mar 2026 12:06:54 -0400 Subject: [PATCH] fix(firmware): edge_dsp task watchdog starvation on Core 1 (#266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit process_frame() is CPU-intensive (biquad filters, Welford stats, BPM estimation, multi-person vitals) and can run for several ms. At priority 5, edge_dsp starves IDLE1 (priority 0) on Core 1, triggering the task watchdog every 5 seconds. Fix: vTaskDelay(1) after every frame to let IDLE1 reset the watchdog. At 20 Hz CSI rate this adds ~1 ms per frame — negligible for vitals extraction. Verified on real ESP32-S3 with live WiFi CSI: 0 watchdog triggers in 60 seconds (was triggering every 5s before fix). Co-Authored-By: claude-flow --- firmware/esp32-csi-node/main/edge_processing.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/esp32-csi-node/main/edge_processing.c b/firmware/esp32-csi-node/main/edge_processing.c index 6c4e2d39..86db1b86 100644 --- a/firmware/esp32-csi-node/main/edge_processing.c +++ b/firmware/esp32-csi-node/main/edge_processing.c @@ -787,6 +787,12 @@ static void edge_task(void *arg) while (1) { if (ring_pop(&slot)) { process_frame(&slot); + /* Yield after every frame to feed the Core 1 watchdog. + * process_frame() is CPU-intensive (biquad filters, Welford stats, + * BPM estimation, multi-person vitals) and can take several ms. + * Without this yield, edge_dsp at priority 5 starves IDLE1 at + * priority 0, triggering the task watchdog. See issue #266. */ + vTaskDelay(1); } else { /* No frames available — yield briefly. */ vTaskDelay(pdMS_TO_TICKS(1));