mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-10 06:31:24 +00:00
esp32: Add support for noinit variables in SPIRAM
Add Kconfig option SPIRAM_ALLOW_NOINIT_EXTERNAL_MEMORY When enabled, a new linker script rule (from esp32.extram.noinit.ld) places any variables in the .ext_ram.noinit section in SPIRAM. This section is exempted from the startup SPIRAM memory test and is not zero-initialized or added to the malloc pool, making it usable for noinit variables that persist across reset. The EXT_RAM_NOINIT_ATTR macro places variables in this section.
This commit is contained in:

committed by
Armando (Dou Yiwen)

parent
47e1b41563
commit
b85011c15f
14
components/esp_system/ld/esp32/esp32.extram.noinit.ld
Normal file
14
components/esp_system/ld/esp32/esp32.extram.noinit.ld
Normal file
@@ -0,0 +1,14 @@
|
||||
/* This section is only included if CONFIG_SPIRAM_ALLOW_NOINIT_EXTERNAL_MEMORY
|
||||
is set, to link some NOINIT sections in PSRAM */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* external memory bss, from any global variable with EXT_RAM_NOINIT_ATTR attribute*/
|
||||
.ext_ram.noinit (NOLOAD) :
|
||||
{
|
||||
_ext_ram_noinit_start = ABSOLUTE(.);
|
||||
*(.ext_ram.noinit*)
|
||||
. = ALIGN(4);
|
||||
_ext_ram_noinit_end = ABSOLUTE(.);
|
||||
} > extern_ram_seg
|
||||
}
|
Reference in New Issue
Block a user