From cc137456dc1b37e44afe852a62ff0654ee0e461b Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Thu, 14 Aug 2025 19:06:43 -0700 Subject: [PATCH] ports/stm32: Only enable frame int manually in jpeg mode. The frame interrupt was being enabled for non-JPEG transfers, causing massive image corruption and out-of-sync issues on the M4 and M7. This interrupt only needs to be enabled for JPEG mode where the size of the image is not known. --- ports/stm32/omv_csi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32/omv_csi.c b/ports/stm32/omv_csi.c index 822311e89..4fc9410fb 100644 --- a/ports/stm32/omv_csi.c +++ b/ports/stm32/omv_csi.c @@ -626,7 +626,7 @@ static int stm_csi_snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) { } // In JPEG mode, enable the end of frame interrupt. - if (!csi->mipi_if && csi->pixformat != PIXFORMAT_JPEG) { + if (!csi->mipi_if && csi->pixformat == PIXFORMAT_JPEG) { __HAL_DCMI_ENABLE_IT(&csi->dcmi, DCMI_IT_FRAME); }