soc: esp32c3: ESP WiFi heap

Provide symbols for the creation of dynamic memory pool.
Fix static allocations size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This commit is contained in:
Marek Matej 2024-08-31 00:33:59 +02:00 committed by Henrik Brix Andersen
commit 2683774265
2 changed files with 17 additions and 8 deletions

View file

@ -93,6 +93,9 @@ _rom_store_table = 0;
_iram_dram_offset = IRAM_DRAM_OFFSET;
/* Stack sentry */
_heap_sentry = DRAM_RESERVED_START;
SECTIONS
{
#ifdef CONFIG_BOOTLOADER_MCUBOOT
@ -651,7 +654,7 @@ SECTIONS
_image_ram_start = _iram_start - IRAM_DRAM_OFFSET;
#include <zephyr/linker/ram-end.ld>
ASSERT(((__bss_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)), "DRAM segment data does not fit.")
ASSERT(((_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)), "SRAM instruction/data does not fit.")
/* --- END OF DRAM --- */

View file

@ -10,6 +10,7 @@
/* SRAM1 (384kB) memory */
#define SRAM1_DRAM_START 0x3fc80000
#define SRAM1_IRAM_START 0x40380000
#define SRAM1_SIZE 0x60000
/* ICache size is fixed to 16KB on ESP32-C3 */
#define ICACHE_SIZE SRAM0_SIZE
@ -30,9 +31,13 @@
*/
#define IRAM_DRAM_OFFSET 0x700000
#define DRAM_BUFFERS_START 0x3fccae00
#define DRAM_BUFFERS_END 0x3fccc000
#define DRAM_STACK_START 0x3fcdc710
#define DRAM_ROM_BSS_DATA_START 0x3fcde710
/* Set the limit for the application runtime dynamic allocations */
#define DRAM_RESERVED_START DRAM_BUFFERS_END
/* Base address used for calculating memory layout
* counted from Dbus backwards and back to the Ibus
*/
@ -46,13 +51,14 @@
#define BOOTLOADER_IRAM_LOADER_SEG_LEN 0x1400
/* Start of the lower region is determined by region size and the end of the higher region */
#define BOOTLOADER_IRAM_LOADER_SEG_END (BOOTLOADER_USER_DRAM_END + \
BOOTLOADER_STACK_OVERHEAD + IRAM_DRAM_OFFSET)
#define BOOTLOADER_IRAM_LOADER_SEG_START (BOOTLOADER_IRAM_LOADER_SEG_END - \
BOOTLOADER_IRAM_LOADER_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)
#define BOOTLOADER_IRAM_LOADER_SEG_END \
(BOOTLOADER_USER_DRAM_END + BOOTLOADER_STACK_OVERHEAD + IRAM_DRAM_OFFSET)
#define BOOTLOADER_IRAM_LOADER_SEG_START \
(BOOTLOADER_IRAM_LOADER_SEG_END - BOOTLOADER_IRAM_LOADER_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 */
#ifdef CONFIG_FLASH_SIZE