diff options
| author | Jean-François Milants <jf@codingfield.com> | 2023-01-29 12:47:12 +0100 |
|---|---|---|
| committer | Jean-François Milants <jf@codingfield.com> | 2023-01-29 12:47:12 +0100 |
| commit | 9b2e1b3250e12440ca259c8e814c0aac3ec9fd3c (patch) | |
| tree | 30518324058c46608e810dffc657043168f397f9 /gcc_nrf52-mcuboot.ld | |
| parent | 97123d99c940b0cb347454d6741859f62a203d5c (diff) | |
| parent | 98d1de070a316a8714b32c42fa35084bc8e0431f (diff) | |
Merge branch 'aleexxzeero-proper-mcuboot-app-size' into develop
Diffstat (limited to 'gcc_nrf52-mcuboot.ld')
| -rw-r--r-- | gcc_nrf52-mcuboot.ld | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc_nrf52-mcuboot.ld b/gcc_nrf52-mcuboot.ld index 81b318c5..6c3a769b 100644 --- a/gcc_nrf52-mcuboot.ld +++ b/gcc_nrf52-mcuboot.ld @@ -1,11 +1,41 @@ -/* Linker script to configure memory regions. */ +/**************************************************************** + * Memory map configuration for using application with MCU-boot * + ****************************************************************/ +/* + * Internal nRF52 flash memory: + * 0x00000000: MCUBoot(28 kB) + * 0x00007000: Reboot logs (4 kB) + * 0x00008000: MCUBoot header (32 bytes) + * 0x00008020: Application (463+ kB) + * 0x0007be50: MCUBoot image trailer (432 bytes) + * 0x0007c000: MCUBoot Scratch partition (4 kB) + * 0x0007d000: unused (12 kB) + * + * SPI flash: + * 0x00000000: Bootloader Assets, like Boot Graphic (256 kB) + * 0x00040000: Application 2 (including MCUBoot header) (464 kB) + * 0x000b4000: User files - littlefs (3376 kB) + */ SEARCH_DIR(.) GROUP(-lgcc -lc -lnosys) +MCUBOOT_SIZE = 0x8000; +SCRATCH_SIZE = 0x1000; +TLV_SIZE = 0x28; /* Metadata added by imgtool at the end of the image */ +SCRATCH_OFFSET = 0x7c000; +MCUBOOT_APP_IMAGE_HEADER_SIZE = 0x20; +MCUBOOT_APP_IMAGE_TRAILER_SIZE = 0x1b0; +APP_OFFSET = MCUBOOT_SIZE + MCUBOOT_APP_IMAGE_HEADER_SIZE; +APP_SIZE = SCRATCH_OFFSET - MCUBOOT_SIZE - MCUBOOT_APP_IMAGE_HEADER_SIZE - MCUBOOT_APP_IMAGE_TRAILER_SIZE - TLV_SIZE; + + MEMORY { - FLASH (rx) : ORIGIN = 0x08020, LENGTH = 0x78000 + /* MCUBOOT (r) : ORIGIN = 0x0, LENGTH = MCUBOOT_SIZE */ + FLASH (rx) : ORIGIN = APP_OFFSET, LENGTH = APP_SIZE + /* SCRATCH (r) : ORIGIN = SCRATCH_OFFSET, LENGTH = SCRATCH_SIZE */ + SPARE_SPACE (r) : ORIGIN = SCRATCH_OFFSET + SCRATCH_SIZE, LENGTH = 12K RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K } |
