Question
Can I use preprocessor commands in linker script and how ?
Hey,
Is it possible to use preprocessor commands in linker script file (***.ld) and how it can be done if possible. I want to have diffrent memory definitions depending on the macro.
I tried this but it's not working:
/* Memories definition */
MEMORY
{
/* IF BOATLOADER IS ENABLED USE THIS MEMORY CONFIG*/
#ifdef ENABLE_BOOTLOADER
SHARED (xrw) : ORIGIN =0x20000000 , LENGTH = 64K
RAM (xrw) : ORIGIN =0x20000040 , LENGTH = (512K - 64K)
FLASH (rx) : ORIGIN =0x08008000 , LENGTH = (2048K-32K)*/
#else
/* IF BOATLOADER IS DISABLED USE THIS MEMORY CONFIG*/
RAM (xrw) : ORIGIN =0x20000000 , LENGTH = 512K
FLASH (rx) : ORIGIN =0x08000000 , LENGTH = 2048K
#endif
QUADSPI (r) : ORIGIN =0x90000000 , LENGTH = 16M
}