From 6a9ce4f964b7e87e5f36a9a28737d3a4746501e2 Mon Sep 17 00:00:00 2001 From: RubenKelevra Date: Sun, 3 Aug 2025 02:10:19 +0200 Subject: [PATCH] cam_hal: psram: reset DMA and yield after NO-EOI to resume capture In PSRAM JPEG mode, a truncated frame (missing EOI) could leave GDMA in a bad state and cause subsequent captures to time out. Fix: - On the NO-EOI path, reset the DMA channel (`ll_cam_dma_reset(cam_obj)`). - Yield once (`vTaskDelay(1)`) to let the pipeline restart cleanly. Result: the driver recovers on the next frame instead of timing out, reducing spurious capture failures after truncated JPEGs. --- driver/cam_hal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver/cam_hal.c b/driver/cam_hal.c index 877971afc8..b238678cd7 100644 --- a/driver/cam_hal.c +++ b/driver/cam_hal.c @@ -597,7 +597,10 @@ camera_fb_t *cam_take(TickType_t timeout) CAM_WARN_THROTTLE(warn_eoi_miss_cnt, "NO-EOI - JPEG end marker missing"); + /* Reset DMA so capture can resume after a truncated frame */ + ll_cam_dma_reset(cam_obj); cam_give(dma_buffer); + vTaskDelay(1); continue; /* wait for another frame */ } else if (cam_obj->psram_mode && cam_obj->in_bytes_per_pixel != cam_obj->fb_bytes_per_pixel) {