how to store a variable at a particular location in flash?
Hello!
I'm starting to work on a project and it is built on the IAR IDe (the controller is stm32f103rct6). My task is to change the IDe (to Keil) of this existing project. After reviewing the existing code, I noticed, few configurational structures are getting stored in the Internal-Flash. The base address of these configurational structures is present in the ".icf" file (check the code snippet below).
/**ICF file**/
place at address mem: 0x08006400 { readonly section ConfigParSection };
place at address mem: 0x08006800 { readonly section ConstSection1 };In the "main.c" file he was defining the location of these structures using #pragma.
/********************struct definition**********************/
#pragma pack(push,1) // for remove padding
typedef struct
{
int a; float f; char c [10];
}TsAFMConfig_StructTypeDef;
#pragma pack(pop)
/********************struct variable**********************/
#pragma location = "ConfigParSection"
__root const TsAFMConfig_StructTypeDef AFMMCUFlashConfig =
{
56, 3.14, "1.1.0", }
#pragma location = "ConfigParSection"
__root const char Fake[0x400 - sizeof(AFMMCUFlashConfig)]; //400Now, I want to do the same thing in the Keil IDe without making any big changes, but unfortunately, I can't find the linking of ".icf" file and the Keil compiler doesn't know the meaning of "__root". can someone help me with this?
