change(memory): removed rtc related memory attrs on no-rtc-support chips

This commit is contained in:
armando
2025-09-23 11:21:13 +08:00
committed by Armando (Dou Yiwen)
parent f4e999fd3e
commit 0f6adbebed
3 changed files with 22 additions and 18 deletions
+10 -18
View File
@@ -12,6 +12,7 @@ extern "C" {
#endif
#include "sdkconfig.h"
#include "esp_assert.h"
#define ROMFN_ATTR
@@ -115,14 +116,15 @@ extern "C" {
// Allows to place data into RTC_FAST memory and map it to coredump
#define COREDUMP_RTC_FAST_ATTR _SECTION_ATTR_IMPL(".rtc.fast.coredump", __COUNTER__)
#else
#define RTC_DATA_ATTR
#define RTC_NOINIT_ATTR
#define RTC_RODATA_ATTR
#define COREDUMP_RTC_DATA_ATTR
#define RTC_SLOW_ATTR
#define RTC_IRAM_ATTR
#define RTC_FAST_ATTR
#define COREDUMP_RTC_FAST_ATTR
// RTC memory is not supported on these chips
#define RTC_DATA_ATTR ESP_STATIC_ASSERT(0, "RTC_DATA_ATTR is not supported on this chip. Use DRAM_ATTR instead.")
#define RTC_NOINIT_ATTR ESP_STATIC_ASSERT(0, "RTC_NOINIT_ATTR is not supported on this chip. Use DRAM_ATTR instead.")
#define RTC_RODATA_ATTR ESP_STATIC_ASSERT(0, "RTC_RODATA_ATTR is not supported on this chip. Use DRAM_ATTR instead.")
#define COREDUMP_RTC_DATA_ATTR ESP_STATIC_ASSERT(0, "COREDUMP_RTC_DATA_ATTR is not supported on this chip. Use COREDUMP_DRAM_ATTR instead.")
#define RTC_SLOW_ATTR ESP_STATIC_ASSERT(0, "RTC_SLOW_ATTR is not supported on this chip. Use DRAM_ATTR instead.")
#define RTC_IRAM_ATTR ESP_STATIC_ASSERT(0, "RTC_IRAM_ATTR is not supported on this chip. Use IRAM_ATTR instead.")
#define RTC_FAST_ATTR ESP_STATIC_ASSERT(0, "RTC_FAST_ATTR is not supported on this chip. Use DRAM_ATTR instead.")
#define COREDUMP_RTC_FAST_ATTR ESP_STATIC_ASSERT(0, "COREDUMP_RTC_FAST_ATTR is not supported on this chip. Use COREDUMP_DRAM_ATTR instead.")
#endif
#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
@@ -132,16 +134,6 @@ extern "C" {
#define EXT_RAM_BSS_ATTR
#endif
/**
* Deprecated Macro for putting .bss on PSRAM
*/
#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
// Forces bss variable into external memory. "
#define EXT_RAM_ATTR _SECTION_ATTR_IMPL(".ext_ram.bss", __COUNTER__) _Pragma ("GCC warning \"'EXT_RAM_ATTR' macro is deprecated, please use `EXT_RAM_BSS_ATTR`\"")
#else
#define EXT_RAM_ATTR _Pragma ("GCC warning \"'EXT_RAM_ATTR' macro is deprecated, please use `EXT_RAM_BSS_ATTR`\"")
#endif
// Forces data into noinit section to avoid initialization after restart.
#define __NOINIT_ATTR _SECTION_ATTR_IMPL(".noinit", __COUNTER__)
@@ -253,3 +253,9 @@ Heap
In previous versions of ESP-IDF, the capability MALLOC_CAP_EXEC would be available regardless of the memory protection configuration state. This implied that a call to e.g., :cpp:func:`heap_caps_malloc` with MALLOC_CAP_EXEC would return NULL when CONFIG_ESP_SYSTEM_MEMPROT_FEATURE or CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT are enabled.
Since ESP-IDF v6.0, the definition of MALLOC_CAP_EXEC is conditional, meaning that if CONFIG_ESP_SYSTEM_MEMPROT is enabled, MALLOC_CAP_EXEC will not be defined. Therefore, using it will generate a compile time error.
``esp_common``
--------------
- ``EXT_RAM_ATTR`` was deprecated since v5.0, Now it has been removed. Please use the macro ``EXT_RAM_BSS_ATTR`` to put ``.bss`` on PSRAM.
- RTC related memory attributes (``RTC_x_ATTR``) have been removed on those chips without RTC memory.
@@ -246,3 +246,9 @@ ULP
---
LP-Core 在深度睡眠期间遇到异常时,将唤醒主 CPU。此功能默认启用,若不需要此行为,可以通过 :ref:`CONFIG_ULP_TRAP_WAKEUP` Kconfig 配置选项禁用。
``esp_common``
----------------
- ``EXT_RAM_ATTR`` 自 v5.0 已弃用,现已移除。请使用 ``EXT_RAM_BSS_ATTR`` 宏将 ``.bss`` 放在 PSRAM 上。
- RTC 相关内存属性 (``RTC_x_ATTR``) 已从没有 RTC 存储的芯片中移除。