soc: espressif: Support large buffers in custom PSRAM sections

Several subsystems have configuration options that allow large buffers
to be placed in specialized memory sections. When PSRAM is enabled, the
MBEDTLS heap and LVGL heap and buffer can be relocated to custom sections
within the PSRAM segment.

Enabling `CONFIG_ESP_SPIRAM` together with any of the following options:
* `CONFIG_MBEDTLS_HEAP_CUSTOM_SECTION`
* `CONFIG_LV_Z_MEMORY_POOL_CUSTOM_SECTION`
* `CONFIG_LV_Z_VDB_CUSTOM_SECTION`

will place the corresponding buffers into the `.mbedtls_heap`,
`.lvgl_heap`, and `.lvgl_buf` sections, respectively.
If none of these custom section options are enabled, the buffers will
fall back to the `.ext_ram.bss` section.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This commit is contained in:
Marek Matej 2025-06-05 15:42:03 +02:00 committed by Benjamin Cabé
commit 648bfe090c
3 changed files with 28 additions and 0 deletions

View file

@ -845,6 +845,15 @@ SECTIONS
_ext_ram_bss_start = ABSOLUTE(.); _ext_ram_bss_start = ABSOLUTE(.);
*(.ext_ram.bss*) *(.ext_ram.bss*)
. = ALIGN(16); . = ALIGN(16);
/* Custom modules sections list */
KEEP(*(.lvgl_buf*))
. = ALIGN(16);
KEEP(*(.lvgl_heap*))
. = ALIGN(16);
KEEP(*(.mbedtls_heap*))
. = ALIGN(16);
_ext_ram_bss_end = ABSOLUTE(.); _ext_ram_bss_end = ABSOLUTE(.);
_ext_ram_heap_start = ABSOLUTE(.); _ext_ram_heap_start = ABSOLUTE(.);

View file

@ -810,6 +810,15 @@ SECTIONS
_ext_ram_bss_start = ABSOLUTE(.); _ext_ram_bss_start = ABSOLUTE(.);
*(.ext_ram.bss*) *(.ext_ram.bss*)
. = ALIGN(16); . = ALIGN(16);
/* Custom modules sections list */
KEEP(*(.lvgl_buf*))
. = ALIGN(16);
KEEP(*(.lvgl_heap*))
. = ALIGN(16);
KEEP(*(.mbedtls_heap*))
. = ALIGN(16);
_ext_ram_bss_end = ABSOLUTE(.); _ext_ram_bss_end = ABSOLUTE(.);
_ext_ram_heap_start = ABSOLUTE(.); _ext_ram_heap_start = ABSOLUTE(.);

View file

@ -1018,8 +1018,18 @@ SECTIONS
_ext_ram_bss_start = ABSOLUTE(.); _ext_ram_bss_start = ABSOLUTE(.);
*(.ext_ram.bss*) *(.ext_ram.bss*)
. = ALIGN(16); . = ALIGN(16);
/* Custom modules sections list */
KEEP(*(.lvgl_buf*))
. = ALIGN(16);
KEEP(*(.lvgl_heap*))
. = ALIGN(16);
KEEP(*(.mbedtls_heap*))
. = ALIGN(16);
_ext_ram_bss_end = ABSOLUTE(.); _ext_ram_bss_end = ABSOLUTE(.);
/* Used by Shared Multi Heap */
_ext_ram_heap_start = ABSOLUTE(.); _ext_ram_heap_start = ABSOLUTE(.);
. += CONFIG_ESP_SPIRAM_HEAP_SIZE; . += CONFIG_ESP_SPIRAM_HEAP_SIZE;
. = ALIGN(16); . = ALIGN(16);