soc: esp32c6: Add runtime heap symbols

Update the linker scripts to provide necessary symbols.
Fix static allocation size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This commit is contained in:
Marek Matej 2024-09-12 13:47:20 +02:00 committed by Henrik Brix Andersen
commit a1c4552ea9
2 changed files with 9 additions and 4 deletions

View file

@ -93,6 +93,8 @@ REGION_ALIAS("rtc_reserved_seg", lp_reserved_seg );
/* Default entry point: */ /* Default entry point: */
ENTRY(CONFIG_KERNEL_ENTRY) ENTRY(CONFIG_KERNEL_ENTRY)
_heap_sentry = DRAM_RESERVED_START;
SECTIONS SECTIONS
{ {
#ifdef CONFIG_BOOTLOADER_MCUBOOT #ifdef CONFIG_BOOTLOADER_MCUBOOT
@ -651,7 +653,7 @@ SECTIONS
_image_ram_start = _iram_start; _image_ram_start = _iram_start;
#include <zephyr/linker/ram-end.ld> #include <zephyr/linker/ram-end.ld>
ASSERT(((__bss_end - ORIGIN(sram0_0_seg)) <= LENGTH(sram0_0_seg)), "DRAM segment data does not fit.") ASSERT(((_end - ORIGIN(sram0_0_seg)) <= LENGTH(sram0_0_seg)), "SRAM code/data does not fit.")
/* --- END OF DRAM --- */ /* --- END OF DRAM --- */

View file

@ -28,9 +28,13 @@
*/ */
#define DRAM_BUFFERS_START 0x4086ad08 #define DRAM_BUFFERS_START 0x4086ad08
#define DRAM_STACK_START 0x4087c610 #define DRAM_BUFFERS_END 0x4087c610
#define DRAM_STACK_START DRAM_BUFFERS_END
#define DRAM_ROM_BSS_DATA_START 0x4087e610 #define DRAM_ROM_BSS_DATA_START 0x4087e610
/* Set the limit for the application runtime dynamic allocations */
#define DRAM_RESERVED_START DRAM_BUFFERS_END
/* For safety margin between bootloader data section and startup stacks */ /* For safety margin between bootloader data section and startup stacks */
#define BOOTLOADER_STACK_OVERHEAD 0x0 #define BOOTLOADER_STACK_OVERHEAD 0x0
/* These lengths can be adjusted, if necessary: FIXME: optimize ram usage */ /* These lengths can be adjusted, if necessary: FIXME: optimize ram usage */
@ -44,8 +48,7 @@
#define BOOTLOADER_USER_SRAM_END (DRAM_BUFFERS_START - BOOTLOADER_STACK_OVERHEAD) #define BOOTLOADER_USER_SRAM_END (DRAM_BUFFERS_START - BOOTLOADER_STACK_OVERHEAD)
/* Start of the lower region is determined by region size and the end of the higher region */ /* Start of the lower region is determined by region size and the end of the higher region */
#define BOOTLOADER_IRAM_LOADER_SEG_START \ #define BOOTLOADER_IRAM_LOADER_SEG_START (BOOTLOADER_USER_SRAM_END - BOOTLOADER_IRAM_LOADER_SEG_LEN)
(BOOTLOADER_USER_SRAM_END - BOOTLOADER_IRAM_LOADER_SEG_LEN)
#define BOOTLOADER_IRAM_SEG_START (BOOTLOADER_IRAM_LOADER_SEG_START - BOOTLOADER_IRAM_SEG_LEN) #define BOOTLOADER_IRAM_SEG_START (BOOTLOADER_IRAM_LOADER_SEG_START - BOOTLOADER_IRAM_SEG_LEN)
#define BOOTLOADER_DRAM_SEG_START (BOOTLOADER_IRAM_SEG_START - BOOTLOADER_DRAM_SEG_LEN) #define BOOTLOADER_DRAM_SEG_START (BOOTLOADER_IRAM_SEG_START - BOOTLOADER_DRAM_SEG_LEN)