cancel
Showing results for 
Search instead for 
Did you mean: 

updates on scatter file getting deleted after building code

vishwadn
Associate II

Hi,

 I tried adding APPKEY on the flash to read from bootloader to find if valid application there or not. I added as below in scatter file :

EXCLUDE app_key.o

APPKEY 0x08043FF8 FIXED { ; 0x08013FF0 = last 16 bytes of 64KB app
app_key.o (.app_key)
}

 

and in app_key.c, below lines are added:

__attribute__((used))
__attribute__((section(".app_key")))
const unsigned int APPKEY = 0xFEFFFEFF;

But once code is built, changes done in scatter file are disappearing and also when I check in map file, app_key is not getting allocated in specified location of flash

 

  

1 REPLY 1
Saket_Om
ST Employee

Hello @vishwadn 

It is possible that the IDE or build system is regenerating the scatter file automatically.

Please Check your project settings :

  • In Keil/MDK, go to Project > Options for Target > Linker and ensure "Use Memory Layout from Target Dialog" is unchecked.
  • Specify your custom scatter file in the linker settings.
To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om