From 44da7d27ef61033cc7c31c8a8e0fde79fd5ac000 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Mon, 27 Sep 2021 21:31:37 +0800 Subject: [PATCH] heap: add a new heap caps attribute for RTC fast memory --- components/heap/include/esp_heap_caps.h | 1 + components/heap/port/esp32s3/memory_layout.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/heap/include/esp_heap_caps.h b/components/heap/include/esp_heap_caps.h index bed3d710bf..9a9a94c88b 100644 --- a/components/heap/include/esp_heap_caps.h +++ b/components/heap/include/esp_heap_caps.h @@ -41,6 +41,7 @@ extern "C" { #define MALLOC_CAP_DEFAULT (1<<12) ///< Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call #define MALLOC_CAP_IRAM_8BIT (1<<13) ///< Memory must be in IRAM and allow unaligned access #define MALLOC_CAP_RETENTION (1<<14) +#define MALLOC_CAP_RTCRAM (1<<15) ///< Memory must be in RTC fast memory #define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker diff --git a/components/heap/port/esp32s3/memory_layout.c b/components/heap/port/esp32s3/memory_layout.c index 945a059f17..224a86eff1 100644 --- a/components/heap/port/esp32s3/memory_layout.c +++ b/components/heap/port/esp32s3/memory_layout.c @@ -47,7 +47,7 @@ const soc_memory_type_desc_t soc_memory_types[] = { // Type 5: DRAM which is not DMA accesible { "NON_DMA_DRAM", { MALLOC_CAP_8BIT | MALLOC_CAP_DEFAULT, MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT, 0 }, false, false}, // Type 6: RTC Fast RAM - { "RTCRAM", { MALLOC_CAP_8BIT | MALLOC_CAP_DEFAULT, MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT, 0 }, false, false}, + { "RTCRAM", { MALLOC_CAP_8BIT | MALLOC_CAP_DEFAULT, MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT, MALLOC_CAP_RTCRAM }, false, false}, }; const size_t soc_memory_type_count = sizeof(soc_memory_types) / sizeof(soc_memory_type_desc_t);