I'm trying to write a boot loader and a double application code through the following scatter file:
LR_ROM1 0x08000000 0x00005000 { ; load boot ABSOLUTE area ER_ROM1 0x08000000 0x00005000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) *armlib* (+RO) cortexm3_macro.o (+RO) STM32F10x.o (+RO) ... BOOT APPLICATION MODULES ... }
RW_IRAM1 0x20000000 0x00000800 { ; For the Interrupt Vector, function entries and STACK dummy.o (+RW +ZI) }
RW_IRAM3 0x20000800 0x00007800 { ; For all other variables .ANY (+RW +ZI) }
STACK 0x20000800 -0x200 { *.o (STACK, +First) } }
LR_IROM1 0x08005000 PI 0x00011000 { ER_IROM1 +0 { ; load address = execution APP1 *.o (HEADER_APP1, +First) APP1_INTERFACE.o (+RO) ... All Application1 modules ... } }
LR_IROM2 0x08016000 PI 0x00011000 { ER_IROM2 +0 { ; load address = execution APP2 *.o (HEADER_APP2, +First) APP2_INTERFACE.o (+RO) ... All Application2 modules ... } }
After several hours of work I succeded to allow PI pieces of code to call library functions and my functions (through the proper veneer code) in the ABSOLUTE area postioned in 0x8000000.
The remaining issue is to allow the ABSOLUTE area to address PI area functions. In particular through the APP1_INTERFACE.o and APP2_INTERFACE.o module I wanted to export information about the relative position of particular functions into the PI area, but it seems it's nearly impossible due to the fact that the linker is not able to provide such information.
Does anyone have a solution for this ?