Add linker scripts

This commit is contained in:
Szczepan Zalega
2019-08-06 16:45:12 +02:00
parent d618081dd0
commit beb5a5892c
2 changed files with 33 additions and 3 deletions

View File

@@ -14,13 +14,23 @@ _MIN_STACK_SIZE = 0x400;
/*
Memory layout of device:
20 KB 198KB-8 38 KB
| bootloader | application | secrets/data |
20+2 KB 198KB-2KB -8 38 KB
| 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
{
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
sram2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
}
@@ -47,6 +57,13 @@ SECTIONS
_sidata = LOADADDR(.data);
.flag _version_start :
{
KEEP(*(.flag)) ;
} > flash_v
.data :
{
. = ALIGN(8);