fix(firmware): edge_dsp task watchdog starvation on Core 1 (#266)

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 <ruv@ruv.net>
This commit is contained in:
ruv 2026-03-15 12:06:54 -04:00
parent 5b2aacd923
commit 024d2583f0

View file

@ -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));