From 4c92df4926335c0ecf1a7a175bc88cd48fdc3005 Mon Sep 17 00:00:00 2001 From: Chen Jichang Date: Tue, 27 Jan 2026 15:05:35 +0800 Subject: [PATCH] fix(gdma): skip alignment check for AHBDMA version 1 when flash enc --- components/esp_driver_dma/src/gdma.c | 4 +++- components/esp_mm/heap_align_hw.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/esp_driver_dma/src/gdma.c b/components/esp_driver_dma/src/gdma.c index b73d5a5125..75d97bc8db 100644 --- a/components/esp_driver_dma/src/gdma.c +++ b/components/esp_driver_dma/src/gdma.c @@ -417,7 +417,9 @@ esp_err_t gdma_config_transfer(gdma_channel_handle_t dma_chan, const gdma_transf bool en_desc_burst = true; bool en_data_burst = max_data_burst_size > 0; -#if SOC_PSRAM_DMA_CAPABLE || SOC_DMA_CAN_ACCESS_FLASH + // There's auto alignment for AHB GDMA version 1, so we don't need to do anything here + // While, for AHB GDMA version 2 and AXI GDMA, we need to ensure the alignment by software +#if (SOC_PSRAM_DMA_CAPABLE || SOC_DMA_CAN_ACCESS_FLASH) && SOC_AHB_GDMA_VERSION != 1 // if MSPI encryption is enabled, and DMA wants to read/write external memory if (efuse_hal_flash_encryption_enabled() && config->access_ext_mem) { uint32_t enc_mem_alignment = GDMA_LL_GET(ACCESS_ENCRYPTION_MEM_ALIGNMENT); diff --git a/components/esp_mm/heap_align_hw.c b/components/esp_mm/heap_align_hw.c index 294fb5a2d7..bc0088b458 100644 --- a/components/esp_mm/heap_align_hw.c +++ b/components/esp_mm/heap_align_hw.c @@ -9,7 +9,6 @@ #include "sdkconfig.h" #include "esp_heap_caps.h" #include "esp_private/esp_cache_private.h" -#include "esp_private/gdma.h" #include "soc/soc_caps.h" #if SOC_HAS(GDMA) #include "hal/gdma_ll.h"