1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/esp32: fix ld scripts for heap

For ESP32-S2 and ESP32-S3 the symbol `_heap_end` must not be used as `_eheap` for dynamic memory allocation, because it points to the highest possible address that could be used for the heap, but not to the top address of the unused SRAM area. Instead, the origin and length of `dram0_0_seg` must be used to calculate the end of the heap.
This commit is contained in:
Gunar Schorcht 2023-09-27 15:31:50 +02:00
parent 4669ee6693
commit 3a40e20452
2 changed files with 6 additions and 2 deletions

View File

@ -590,9 +590,11 @@ SECTIONS
_sheap = ABSOLUTE(.);
} > dram0_0_seg
. = _heap_end;
. = ORIGIN(dram0_0_seg) + LENGTH(dram0_0_seg);
_eheap = ABSOLUTE(.);
. = _heap_end;
#ifdef MODULE_PERIPH_FLASHPAGE
.flash_writable (NOLOAD) : ALIGN(65536)
{

View File

@ -617,9 +617,11 @@ SECTIONS
_sheap = ABSOLUTE(.);
} > dram0_0_seg
. = _heap_end;
. = ORIGIN(dram0_0_seg) + LENGTH(dram0_0_seg);
_eheap = ABSOLUTE(.);
. = _heap_end;
#ifdef MODULE_PERIPH_FLASHPAGE
.flash_writable (NOLOAD) : ALIGN(65536)
{