Hello,
i want to split a RAM into two different MemorySegment. On segment for .data_run and .bss and an extra segment for the stack.
The position of the RAM is: 0x2000 0000 and the size is 0x0004 0000
Used Linker: GCC
the following initual situation works fine:
(i know that i can place the stack to the end with place_from_segment_end)
The reason why i want to split the regions is i have two different applications, bootloader and firmware. In the bootloader project i want to specify the RAM to reservate RAM section for .data_run and .bss datas.
Bootloader RAM definition:
With this solution i would get an linker error if .data_run and .bss are bigger than 0x8000 because of set size of the RAM memory segment. And with the STACK MemorySegment i can move the Stack to the end of the phyiscal RAM memory!
Application RAM definition for example:
with this definition the first 0x8000 bytes of ram are reservated for the bootloader, because the application definition starts with offset of 0x8000.
And the Stackpointers of each bootloader and application are on the end of the RAM.
When i try to link the bootloader project with the two MemorySegments RAM and STACK i get the following linker error: (see attachment)
I have also tried to add the "keep" propertie to memorySegment.
when i look into the linker skript i can see that no region for stack will be created. (see linker skript attached).
for me it looks like that stack only can be in the memorysegment with the name "RAM".
Thank you for your support
Best Regards
Markus
i want to split a RAM into two different MemorySegment. On segment for .data_run and .bss and an extra segment for the stack.
The position of the RAM is: 0x2000 0000 and the size is 0x0004 0000
Used Linker: GCC
the following initual situation works fine:
(i know that i can place the stack to the end with place_from_segment_end)
XML Source Code
- <MemorySegment name="RAM" start="0x2000 0000" size="0x0004 0000">
- <ProgramSection alignment="0x4" load="No" name=".data_run"/>
- <ProgramSection alignment="0x4" load="No" name=".bss"/>
- <ProgramSection alignment="0x8" load="No" name=".stack" start="0x2000 0000 + 0x0004 0000 - __STACKSIZE__" size="__STACKSIZE__"/>
- </MemorySegment>
The reason why i want to split the regions is i have two different applications, bootloader and firmware. In the bootloader project i want to specify the RAM to reservate RAM section for .data_run and .bss datas.
Bootloader RAM definition:
XML Source Code
- <MemorySegment name="RAM" start="0x2000 0000" size="0x0000 8000">
- <ProgramSection alignment="0x4" load="No" name=".data_run"/>
- <ProgramSection alignment="0x4" load="No" name=".bss"/>
- </MemorySegment>
- <MemorySegment name="STACK" start="0x2000 0000" size="0x0004 0000">
- <ProgramSection alignment="0x8" load="No" name=".stack" start="0x2000 0000 + 0x0004 0000 - __STACKSIZE__" size="__STACKSIZE__"/>
- </MemorySegment>
With this solution i would get an linker error if .data_run and .bss are bigger than 0x8000 because of set size of the RAM memory segment. And with the STACK MemorySegment i can move the Stack to the end of the phyiscal RAM memory!
Application RAM definition for example:
XML Source Code
- <MemorySegment name="RAM" start="0x2000 8000" size="0x0003 8000">
- <ProgramSection alignment="0x4" load="No" name=".data_run"/>
- <ProgramSection alignment="0x4" load="No" name=".bss"/>
- </MemorySegment>
- <MemorySegment name="STACK" start="0x2000 0000" size="0x0004 0000">
- <ProgramSection alignment="0x8" load="No" name=".stack" start="0x2000 0000 + 0x0004 0000 - __STACKSIZE__" size="__STACKSIZE__"/>
- </MemorySegment>
And the Stackpointers of each bootloader and application are on the end of the RAM.
When i try to link the bootloader project with the two MemorySegments RAM and STACK i get the following linker error: (see attachment)
I have also tried to add the "keep" propertie to memorySegment.
when i look into the linker skript i can see that no region for stack will be created. (see linker skript attached).
for me it looks like that stack only can be in the memorysegment with the name "RAM".
Thank you for your support
Best Regards
Markus