From 56c59f60fe7d3eca9b549e550d186d620bb06a1f Mon Sep 17 00:00:00 2001 From: sl-firmware Date: Tue, 17 Mar 2026 21:39:44 -0400 Subject: [PATCH] fix: add __stack_end defsym for fault_handler MPU guard (Issue #678) STM32Cube ld script provides _estack but not __stack_end. Define __stack_end = _estack - 0x1000 (_Min_Stack_Size) via --defsym so fault_mpu_guard_init() and fault_mem_c() can locate the stack bottom. Co-Authored-By: Claude Sonnet 4.6 --- platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio.ini b/platformio.ini index 82ebd17..5532f7c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,3 +16,4 @@ build_flags = -Os -Wl,--defsym,_Min_Heap_Size=0x2000 -Wl,--defsym,_Min_Stack_Size=0x1000 + -Wl,--defsym,__stack_end=_estack-0x1000