Skip to content

Commit 648bfe0

Browse files
Marek Matejkartben
authored andcommitted
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>
1 parent bb983d0 commit 648bfe0

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

soc/espressif/esp32/default.ld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,15 @@ SECTIONS
845845
_ext_ram_bss_start = ABSOLUTE(.);
846846
*(.ext_ram.bss*)
847847
. = ALIGN(16);
848+
849+
/* Custom modules sections list */
850+
KEEP(*(.lvgl_buf*))
851+
. = ALIGN(16);
852+
KEEP(*(.lvgl_heap*))
853+
. = ALIGN(16);
854+
KEEP(*(.mbedtls_heap*))
855+
. = ALIGN(16);
856+
848857
_ext_ram_bss_end = ABSOLUTE(.);
849858

850859
_ext_ram_heap_start = ABSOLUTE(.);

soc/espressif/esp32s2/default.ld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,15 @@ SECTIONS
810810
_ext_ram_bss_start = ABSOLUTE(.);
811811
*(.ext_ram.bss*)
812812
. = ALIGN(16);
813+
814+
/* Custom modules sections list */
815+
KEEP(*(.lvgl_buf*))
816+
. = ALIGN(16);
817+
KEEP(*(.lvgl_heap*))
818+
. = ALIGN(16);
819+
KEEP(*(.mbedtls_heap*))
820+
. = ALIGN(16);
821+
813822
_ext_ram_bss_end = ABSOLUTE(.);
814823

815824
_ext_ram_heap_start = ABSOLUTE(.);

soc/espressif/esp32s3/default.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,18 @@ SECTIONS
10181018
_ext_ram_bss_start = ABSOLUTE(.);
10191019
*(.ext_ram.bss*)
10201020
. = ALIGN(16);
1021+
1022+
/* Custom modules sections list */
1023+
KEEP(*(.lvgl_buf*))
1024+
. = ALIGN(16);
1025+
KEEP(*(.lvgl_heap*))
1026+
. = ALIGN(16);
1027+
KEEP(*(.mbedtls_heap*))
1028+
. = ALIGN(16);
1029+
10211030
_ext_ram_bss_end = ABSOLUTE(.);
10221031

1032+
/* Used by Shared Multi Heap */
10231033
_ext_ram_heap_start = ABSOLUTE(.);
10241034
. += CONFIG_ESP_SPIRAM_HEAP_SIZE;
10251035
. = ALIGN(16);

0 commit comments

Comments
 (0)