STM32CubeIDE: Linker Settings by Build spec
I'm currently tinkering with the BLE_Ota example for the P-NUCLEO-WB55.Nucleo and created a debug build spec for it. The default linker script is
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 28K
RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
}but the image built with the debug build spec is larger, so the length of the flash area to use must be adjusted:
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K
RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
}
that made me wonder, is it possible to define constants in the build specs such that conditional statements (e.g using the DEFINED statement) inside the .ld file can be used? something like
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = DEFINED(DEBUG) ? 32K : 28K 