Weird behaviour with data in flash ( STM32F412RE)
Hello,
I have some application parameters stored in flash area, declared like this :
__attribute__((__section__(".storageFlash"))) const parametersTable_t flashParameters;
The linker script has been modified as follow:
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 384K
PARAMETERS_STORAGE (rx) : ORIGIN = 0x08060000, LENGTH = 64K
CALIBRATION_STORAGE (rx) : ORIGIN = 0x08068000, LENGTH = 64K
}
....
.storageFlash (NOLOAD) :
{
. = ALIGN(4);
*(storageFlash)
. = ALIGN(4);
} >PARAMETERS_STORAGE
In my program I do a simple copy on a local data or make a comparaison with Ram data like this : temp = flashParameters.version;
With Atollic , I can read that flashParameters.version = 12 but temp = 0!!
If I read the raw memory I can also find 12.
I don't understand why the programm read always 0 instead of 12.
Thanks for your help
Bertrand
