Locate Constant Data in Flash at Fixed Address
Yet another question on locating data, this time fixed in flash. I want to place some main application attributes at a fixed flash location so that my bootloader can learn about the installed app. I have had partial success. (For now this is for an STM32F103, but I'm just learning so that's not for sure.)
With STM32CubeIde I have this in my main.c application code:
uint32_t const Version __attribute__((section(".AppInfo"))) = 0x12345678UL;
uint32_t const Features __attribute__((section(".AppInfo"))) = 0xDEADC0DEUL;And in the .ld file I have added this (between .isr_vector (0x08002000) and .text:
.AppInfo 0X08003000 :
{
. = ALIGN(4);
KEEP(*(.AppInfo))
. = ALIGN(4);
} >FLASHNow, while this works (I checked the .map file), I get a giant hole in my Flash usage between the vectors and where my AppInfo goes. Then of course the .text begins after.
There is no way to have the linker mix this into the .text area? I would like to have control over where the AppInfo goes, so any suggestions? Should I just pick the next boundary after the ISR Vectors and hope that table never grows? (seems like not a brilliant idea!)
