How to initialize a constant inside the DATAEEPROM of a STM32L053 MCU.
I'm trying to use this lines of code:
#define DATA_EEPROM_BASE_ADDRESS = 0x08080000;
const calibration_param_t parameters __attribute__((at(DATA_EEPROM_BASE_ADDRESS)));
but if I check in debug, the constant structure parameters is allocated inside the code flash (at the address 0x0800d4f8).
Should I add something to the linker script for example? in my .ld file I have this memory definition:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
}
Flash ends at 0x08010000, that is lower than 0x08080000..could that be the problem? if yes, how to modify the script?
thank you
Cristiano
