From fbc19fad703aa867b2a9d4d62da86b28fd529282 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Mon, 18 Jul 2022 11:38:05 +0800 Subject: [PATCH] memory_utils: Modify esp_ptr_in_diram_iram to be compatible with esp32c6 --- .../bootloader_support/include/bootloader_memory_utils.h | 5 +++++ components/esp_hw_support/include/esp_memory_utils.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/bootloader_support/include/bootloader_memory_utils.h b/components/bootloader_support/include/bootloader_memory_utils.h index f2df0ed227..988749593c 100644 --- a/components/bootloader_support/include/bootloader_memory_utils.h +++ b/components/bootloader_support/include/bootloader_memory_utils.h @@ -69,7 +69,12 @@ inline static bool esp_ptr_in_diram_dram(const void *p) { */ __attribute__((always_inline)) inline static bool esp_ptr_in_diram_iram(const void *p) { +// TODO: IDF-5980 esp32c6 D/I RAM share the same address +#if SOC_DIRAM_IRAM_LOW == SOC_DIRAM_DRAM_LOW + return false; +#else return ((intptr_t)p >= SOC_DIRAM_IRAM_LOW && (intptr_t)p < SOC_DIRAM_IRAM_HIGH); +#endif } /** diff --git a/components/esp_hw_support/include/esp_memory_utils.h b/components/esp_hw_support/include/esp_memory_utils.h index e66e917b87..330fc114bf 100644 --- a/components/esp_hw_support/include/esp_memory_utils.h +++ b/components/esp_hw_support/include/esp_memory_utils.h @@ -69,7 +69,12 @@ inline static bool esp_ptr_in_diram_dram(const void *p) { */ __attribute__((always_inline)) inline static bool esp_ptr_in_diram_iram(const void *p) { +// TODO: IDF-5980 esp32c6 D/I RAM share the same address +#if SOC_DIRAM_IRAM_LOW == SOC_DIRAM_DRAM_LOW + return false; +#else return ((intptr_t)p >= SOC_DIRAM_IRAM_LOW && (intptr_t)p < SOC_DIRAM_IRAM_HIGH); +#endif } /**