Assert the STM32H5 secure link leaves room for the stack

pull/898/merge
Aidan Garske 2026-09-15 10:55:20 -07:00 committed by Daniele Lacamera
parent 8b3e843495
commit 670280e5b3
1 changed files with 5 additions and 0 deletions

View File

@ -59,6 +59,11 @@ SECTIONS
END_STACK = ORIGIN(RAM) + LENGTH(RAM);
/* The stack grows down from END_STACK into .bss with nothing reserved, so a
* large .bss (the fwTPM context) silently corrupts under deep call chains. */
_min_stack = 0x8000;
ASSERT(_end + _min_stack <= END_STACK, "stm32h5 secure RAM: .bss leaves less than _min_stack for the stack (fwTPM context too large)")
_flash_keyvault = ORIGIN(FLASH_KEYVAULT);
_flash_keyvault_size = LENGTH(FLASH_KEYVAULT);