soc: espressif: esp32c3: improve memory utilization

Change the MCUboot segments layout to incread the memory
available in the application.
Add missing symbols to mcuboot.ld

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This commit is contained in:
Marek Matej 2024-05-25 12:07:08 +02:00 committed by Anas Nashif
commit 7bf47f8e8f
2 changed files with 11 additions and 7 deletions

View file

@ -87,6 +87,7 @@ SECTIONS
/* Vectors go to IRAM */ /* Vectors go to IRAM */
_iram_start = ABSOLUTE(.); _iram_start = ABSOLUTE(.);
_init_start = ABSOLUTE(.); _init_start = ABSOLUTE(.);
__text_region_start = ABSOLUTE(.);
KEEP(*(.exception_vectors.text)); KEEP(*(.exception_vectors.text));
. = ALIGN(256); . = ALIGN(256);
@ -133,6 +134,7 @@ SECTIONS
. += 16; . += 16;
_text_end = ABSOLUTE(.); _text_end = ABSOLUTE(.);
__text_region_end = ABSOLUTE(.);
_etext = .; _etext = .;
/* Similar to _iram_start, this symbol goes here so it is /* Similar to _iram_start, this symbol goes here so it is

View file

@ -36,21 +36,23 @@
/* Base address used for calculating memory layout /* Base address used for calculating memory layout
* counted from Dbus backwards and back to the Ibus * counted from Dbus backwards and back to the Ibus
*/ */
#define BOOTLOADER_USABLE_DRAM_END DRAM_BUFFERS_START #define BOOTLOADER_USER_DRAM_END DRAM_BUFFERS_START
/* 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: */ /* These lengths can be adjusted, if necessary: */
#define BOOTLOADER_DRAM_SEG_LEN 0x9000 #define BOOTLOADER_DRAM_SEG_LEN 0x9000
#define BOOTLOADER_IRAM_LOADER_SEG_LEN 0x3000 #define BOOTLOADER_IRAM_SEG_LEN 0x9000
#define BOOTLOADER_IRAM_SEG_LEN 0x8000 #define BOOTLOADER_IRAM_LOADER_SEG_LEN 0x1400
/* 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_DRAM_SEG_END (BOOTLOADER_USABLE_DRAM_END + BOOTLOADER_STACK_OVERHEAD) #define BOOTLOADER_IRAM_LOADER_SEG_END (BOOTLOADER_USER_DRAM_END + \
#define BOOTLOADER_DRAM_SEG_START (BOOTLOADER_DRAM_SEG_END - BOOTLOADER_DRAM_SEG_LEN) BOOTLOADER_STACK_OVERHEAD + IRAM_DRAM_OFFSET)
#define BOOTLOADER_IRAM_LOADER_SEG_START (BOOTLOADER_DRAM_SEG_START - \ #define BOOTLOADER_IRAM_LOADER_SEG_START (BOOTLOADER_IRAM_LOADER_SEG_END - \
BOOTLOADER_IRAM_LOADER_SEG_LEN + IRAM_DRAM_OFFSET) 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 - IRAM_DRAM_OFFSET - \
BOOTLOADER_DRAM_SEG_LEN)
/* Flash */ /* Flash */
#ifdef CONFIG_FLASH_SIZE #ifdef CONFIG_FLASH_SIZE