Hi markusransberger,
My recommendation is to start from the MATLAB linker command file and then to integrate your application sections into it.
Nonetheless, if you want to change your custom linker file then i would suggest to:
#1: create a new memory entry to hold all the data related with Flash Programming Algorithm
MEMORY {
rbf_section : org = 0x00FA0000, len = 0x0000001F
...
}
#2: Place the specific sections related with Flash Programming Algorithm into newly created memory region.
.rchw 0x00FA0000 :
{
KEEP(*(.rcw))
} > rbf_section
.appDelay 0x00FA0008:
{
KEEP(*(.appDelay))
} > rbf_section
.appKeyAddr 0x00FA000C :
{
KEEP(*(.appKeyAddr))
} > rbf_section
appDelay and appKeyAddr sections are generated from *.c file equivalent code
#pragma section USER ".appDelay" "" far-absolute R
#pragma use_section USER appDelay
const uint32_t appDelay = 5000000;
#pragma section USER2 ".appKeyAddr" "" far-absolute R
#pragma use_section USER2 appKeyAddr
const uint32_t appKeyAddr = ( uint32_t )&appKey;
rcw section is generated from *.s file equivalent code
;#************************** .rcw reset config section *************************/
.section .rcw, "a"
.LONG 0x005A0001 ;# BH conf: IOP Only - Can boot others via ME
The additional linker declaration from MATLAB default LCF must also be kept - especially the .appKey
The additional sections like .ctor and .dtor must also be kept in case you use the GCC compiler
Hope this help!
Daniel