|
| 1 | +/* Linker script to configure memory regions. */ |
| 2 | + |
| 3 | +SEARCH_DIR(.) |
| 4 | +GROUP(-lgcc -lc -lnosys) |
| 5 | + |
| 6 | +MEMORY |
| 7 | +{ |
| 8 | + /** Flash start address for the bootloader. This setting will also be stored in UICR to allow the |
| 9 | + * MBR to init the bootloader when starting the system. This value must correspond to |
| 10 | + * BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if |
| 11 | + * those values do not match. The check is performed in main.c, see |
| 12 | + * APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); |
| 13 | + */ |
| 14 | + /* due to lack of flash for debug, we will use reserved app to extend bootloader size */ |
| 15 | + FLASH (rx) : ORIGIN = 0xF4000-28K, LENGTH = 0xFE000-0xF4000 - 2K + 28K /* 38 KB */ |
| 16 | + |
| 17 | + BOOTLOADER_CONFIG (r): ORIGIN = 0xFE000 - 2K, LENGTH = 2K |
| 18 | + |
| 19 | + /** Location of mbr params page in flash. */ |
| 20 | + MBR_PARAMS_PAGE (rw) : ORIGIN = 0xFE000, LENGTH = 0x1000 |
| 21 | + |
| 22 | + /** Location of bootloader setting in flash. */ |
| 23 | + BOOTLOADER_SETTINGS (rw) : ORIGIN = 0xFF000, LENGTH = 0x1000 |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + /** RAM Region for bootloader. */ |
| 28 | + /* Avoid conflict with NOINIT for OTA bond sharing */ |
| 29 | + RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20040000-0x20008000 |
| 30 | + |
| 31 | + /* Location for double reset detection, no init */ |
| 32 | + DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04 |
| 33 | + |
| 34 | + /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information |
| 35 | + * from application to bootloader when using buttonless DFU OTA. */ |
| 36 | + NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80 |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + /** Location in UICR where bootloader start address is stored. */ |
| 41 | + UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04 |
| 42 | + |
| 43 | + /** Location in UICR where mbr params page address is stored. */ |
| 44 | + UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04 |
| 45 | +} |
| 46 | + |
| 47 | +SECTIONS |
| 48 | +{ |
| 49 | + .fs_data_out ALIGN(4): |
| 50 | + { |
| 51 | + PROVIDE( __start_fs_data = .); |
| 52 | + KEEP(*(fs_data)) |
| 53 | + PROVIDE( __stop_fs_data = .); |
| 54 | + } = 0 |
| 55 | + |
| 56 | + .bootloaderConfig : |
| 57 | + { |
| 58 | + KEEP(*(.bootloaderConfig)) |
| 59 | + } > BOOTLOADER_CONFIG |
| 60 | + |
| 61 | + /* Place the bootloader settings page in flash. */ |
| 62 | + .bootloaderSettings(NOLOAD) : |
| 63 | + { |
| 64 | + |
| 65 | + } > BOOTLOADER_SETTINGS |
| 66 | + |
| 67 | + /* Write the bootloader address in UICR. */ |
| 68 | + .uicrBootStartAddress : |
| 69 | + { |
| 70 | + KEEP(*(.uicrBootStartAddress)) |
| 71 | + } > UICR_BOOTLOADER |
| 72 | + |
| 73 | + /* Place the mbr params page in flash. */ |
| 74 | + .mbrParamsPage(NOLOAD) : |
| 75 | + { |
| 76 | + |
| 77 | + } > MBR_PARAMS_PAGE |
| 78 | + |
| 79 | + /* Write the bootloader address in UICR. */ |
| 80 | + .uicrMbrParamsPageAddress : |
| 81 | + { |
| 82 | + KEEP(*(.uicrMbrParamsPageAddress)) |
| 83 | + } > UICR_MBR_PARAM_PAGE |
| 84 | + |
| 85 | + .dbl_reset(NOLOAD) : |
| 86 | + { |
| 87 | + |
| 88 | + } > DBL_RESET |
| 89 | + |
| 90 | + /* No init RAM section in bootloader. Used for bond information exchange. */ |
| 91 | + .noinit(NOLOAD) : |
| 92 | + { |
| 93 | + |
| 94 | + } > NOINIT |
| 95 | + |
| 96 | + /* other placements follow here... */ |
| 97 | +} |
| 98 | + |
| 99 | +INCLUDE "nrf_common.ld" |
0 commit comments