From fd55fe5b2797da041110e3b4cf1ccb459f9e4dfe Mon Sep 17 00:00:00 2001 From: Christopher Nadler Date: Tue, 30 Sep 2025 21:42:40 +0200 Subject: [PATCH] Fix gdma: gdma_disconnect(309): no peripheral is connected to the channel --- target/esp32s3/ll_cam.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/esp32s3/ll_cam.c b/target/esp32s3/ll_cam.c index b54445521b..73e8caf661 100644 --- a/target/esp32s3/ll_cam.c +++ b/target/esp32s3/ll_cam.c @@ -186,11 +186,12 @@ esp_err_t ll_cam_deinit(cam_obj_t *cam) esp_intr_free(cam->dma_intr_handle); cam->dma_intr_handle = NULL; } - gdma_disconnect(cam->dma_channel_handle); - gdma_del_channel(cam->dma_channel_handle); - cam->dma_channel_handle = NULL; - // GDMA.channel[cam->dma_num].in.link.addr = 0x0; - + if (cam->dma_channel_handle) { + // gdma_disconnect(cam->dma_channel_handle); // not needed since code never calls gdma_connect() to connect channel to peripheral + gdma_del_channel(cam->dma_channel_handle); + cam->dma_channel_handle = NULL; + // GDMA.channel[cam->dma_num].in.link.addr = 0x0; + } LCD_CAM.cam_ctrl1.cam_start = 0; LCD_CAM.cam_ctrl1.cam_reset = 1; LCD_CAM.cam_ctrl1.cam_reset = 0;