Add linker scripts
This commit is contained in:
parent
d618081dd0
commit
beb5a5892c
@ -12,9 +12,17 @@ _estack = 0x2000c000;
|
|||||||
|
|
||||||
_MIN_STACK_SIZE = 0x400;
|
_MIN_STACK_SIZE = 0x400;
|
||||||
|
|
||||||
|
/*
|
||||||
|
flash2 is for storing bootloader data, like last used firmware version.
|
||||||
|
_bconfig_start should be equal to (APPLICATION_START_PAGE-1) page address, from targets/stm32l432/src/memory_layout.h:30; and equal to flash2 origin
|
||||||
|
*/
|
||||||
|
|
||||||
|
_bconfig_start = 0x08000000 + 10*2048;
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
flash (rx) : ORIGIN = 0x08000000, LENGTH = 20K
|
flash (rx) : ORIGIN = 0x08000000, LENGTH = 20K
|
||||||
|
flash2 (rx) : ORIGIN = 0x08000000 + 10*2048, LENGTH = 2K
|
||||||
ram (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
|
ram (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
|
||||||
sram2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
|
sram2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
|
||||||
}
|
}
|
||||||
@ -39,6 +47,11 @@ SECTIONS
|
|||||||
_etext = .;
|
_etext = .;
|
||||||
} >flash
|
} >flash
|
||||||
|
|
||||||
|
.flag2 _bconfig_start :
|
||||||
|
{
|
||||||
|
KEEP(*(.flag2)) ;
|
||||||
|
} > flash2
|
||||||
|
|
||||||
_sidata = LOADADDR(.data);
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
.data :
|
.data :
|
||||||
|
@ -14,13 +14,23 @@ _MIN_STACK_SIZE = 0x400;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Memory layout of device:
|
Memory layout of device:
|
||||||
20 KB 198KB-8 38 KB
|
20+2 KB 198KB-2KB -8 38 KB
|
||||||
| bootloader | application | secrets/data |
|
| bootloader | application | secrets/data |
|
||||||
|
|
||||||
|
Last 8 bytes in application space are occupied by bootloader flags - app
|
||||||
|
authorization and bootloader activation flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Current firmware version number
|
||||||
|
Should be equal to (APPLICATION_END_ADDR-8) from targets/stm32l432/src/memory_layout.h:40 */
|
||||||
|
_version_start = 0x08000000 + (128-19)*2048-8-8;
|
||||||
|
|
||||||
|
/* flash length is (APPLICATION_END_PAGE-20*1024), where 20K is bootloader */
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
flash (rx) : ORIGIN = 0x08005000, LENGTH = 198K - 8
|
flash (rx) : ORIGIN = 0x08005000 + 2K, LENGTH = 198K - 8 - 8 - 2K
|
||||||
|
flash_v (rx) : ORIGIN = 0x08000000 + (128-19)*2048 - 8 - 8, LENGTH = 8
|
||||||
ram (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
|
ram (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
|
||||||
sram2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
|
sram2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
|
||||||
}
|
}
|
||||||
@ -47,6 +57,13 @@ SECTIONS
|
|||||||
|
|
||||||
_sidata = LOADADDR(.data);
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
|
|
||||||
|
.flag _version_start :
|
||||||
|
{
|
||||||
|
KEEP(*(.flag)) ;
|
||||||
|
} > flash_v
|
||||||
|
|
||||||
|
|
||||||
.data :
|
.data :
|
||||||
{
|
{
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user