 scatter file causes linker error chris bauch Hello, I'm trying to create a elf file with the help of a scatter file. I'm using the RVCT 2.2. This is my scatter file:
LOAD_FLASH 0x100000 0x80000 ; defines begin and size of the load region
{
FLASH 0x100000 0x80000 ; defines begin and size of the int. Flash execute region
{
* (Reset, +FIRST) ; interrupt vector has this 'Reset' attribute
* (+RO) ; places all remaining Read Only CODE and DATA in this section
}
IRAM_CODE 0x200000 ; defines begin of the int. Ram region
{
* (IntCode, +FIRST) ; places code with 'IntCode' attribute exactly at IRAM_BASE
* (IntData) ; places data with 'IntData' attribute here
}
XRAM_CODE 0x20000000 ; defines begin of the ext. Ram execute region
{
* (ExtCode) ; places code with 'ExtCode' attribute exactly at XRAM_BASE
* (ExtData) ; places data with 'ExtData' attribute here
* (+RW) ; places all remaining Read/Write Code and Data in this section
}
XRAM_HEAP +0x0 UNINIT
{
* (ExtHeap) ; this heap size is defined implicitly via defined variables
* (+ZI)
}
XRAM_STACK 0x21000000 UNINIT ; stack is located on top of memory and grows downward
{
* (ExtStack) ; this stack size is defined implicitly via defined stack areas in startup code
}
}
I've also reimplemented the __user_initial_stackheap function (as recommended in linker user guide):
__value_in_regs struct __initial_stackheap __user_initial_stackheap(
unsigned R0, unsigned SP, unsigned R2, unsigned SL)
{
struct __initial_stackheap config;
config.heap_base = (unsigned int)&Image$XRAM_HEAP$Base;
config.heap_limit = (unsigned int)&Image$XRAM_HEAP$Limit;
config.stack_base = (unsigned int)&Image$XRAM_STACK$Base;
config.stack_limit = (unsigned int)&Image$XRAM_STACK$Limit;
return config;
}
The linker returns following error: Error: L6788E: Scatter-loading of execution region IRAM_CODE will cause the contents of execution region XRAM_HEAP to be corrupted at run-time. Error: L6788E: Scatter-loading of execution region IRAM_CODE will cause the contents of execution region XRAM_HEAP to be corrupted at run-time. I've no idea what this error causes. Can anyone say what is going wrong here? Thanks in advance, Greetings Christian |