imxrt: make DTCM heap size configurable

By default, the full configured DTCM region is assigned to the heap for
dynamic allocation. In scenarios requiring deterministic memory regions
for static buffers or control structures, you can reduce the heap
allocation to reserve part of DTCM for manual/static use.
This kconfig symbol allows to limit the size.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
This commit is contained in:
Peter van der Perk
2025-10-29 15:07:38 +01:00
committed by Matteo Golin
parent 2ecd2722cd
commit e6c982892b
2 changed files with 12 additions and 2 deletions

View File

@@ -2633,7 +2633,17 @@ config IMXRT_DTCM_HEAP
bool "Add DTCM to heap"
depends on IMXRT_DTCM > 0
---help---
Select to add the entire DTCM to the heap
Select to add the DTCM to the heap
config IMXRT_DTCM_HEAP_SIZE
int "DTCM heap Size in K"
depends on IMXRT_DTCM_HEAP
default IMXRT_DTCM
---help---
By default, the full configured DTCM region is assigned to the heap for
dynamic allocation. In scenarios requiring deterministic memory regions
for static buffers or control structures, you can reduce the heap
allocation to reserve part of DTCM for manual/static use.
config IMXRT_BOOTLOADER_HEAP
bool "Add ROM bootloader 40Kib RAM to heap"

View File

@@ -203,7 +203,7 @@ extern const uint32_t _ram_size[]; /* See linker script */
# define IMXRT_OCRAM_ASSIGNED 1
#elif defined(CONFIG_IMXRT_DTCM_HEAP) && !defined(IMXRT_DCTM_ASSIGNED)
# define REGION1_RAM_START IMXRT_DTCM_BASE
# define REGION1_RAM_SIZE CONFIG_DTCM_USED
# define REGION1_RAM_SIZE (CONFIG_IMXRT_DTCM_HEAP_SIZE * 1024)
# define IMXRT_DCTM_ASSIGNED 1
#elif defined(CONFIG_IMXRT_SDRAM_HEAP) && !defined(IMXRT_SDRAM_ASSIGNED)
# define REGION1_RAM_START (CONFIG_IMXRT_SDRAM_START + CONFIG_IMXRT_SDRAM_HEAPOFFSET)