Loading...
 
Skip to main content

System Workbench for STM32


Conditional Linker script

Tunisia

as far as I know gcc linker cannot read defines made in header, but you can add symbol definition to you linker using defsym

example :

in you project properties > C/C++ Build > Settings > Tools Sttings (tab) > MCU GCC Linker > Miscellaneous > Linker flags add

Copy to clipboard
-Wl,--defsym,stack_size=0x2000


and in my linker I add this

Copy to clipboard
stack_size = DEFINED(stack_size) ? stack_size : 0x400 ;