forked from adafruit/Adafruit_nRF52_Bootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add debug linker when building with DEBUG=1
extend bootloader start to reserved app for debug build
- Loading branch information
Showing
5 changed files
with
311 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* Linker script to configure memory regions. */ | ||
|
||
SEARCH_DIR(.) | ||
GROUP(-lgcc -lc -lnosys) | ||
|
||
MEMORY | ||
{ | ||
/** Flash start address for the bootloader. This setting will also be stored in UICR to allow the | ||
* MBR to init the bootloader when starting the system. This value must correspond to | ||
* BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if | ||
* those values do not match. The check is performed in main.c, see | ||
* APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); | ||
*/ | ||
/* due to lack of flash for debug, we will use reserved app to extend bootloader size */ | ||
FLASH (rx) : ORIGIN = 0x74000-28K, LENGTH = 0x7E000-0x74000-2K + 28K | ||
|
||
BOOTLOADER_CONFIG (r): ORIGIN = 0x7E000 - 2K, LENGTH = 2K | ||
|
||
/** Location of mbr params page in flash. */ | ||
MBR_PARAMS_PAGE (rw) : ORIGIN = 0x0007E000, LENGTH = 0x1000 | ||
|
||
/** Location of bootloader setting in flash. */ | ||
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0007F000, LENGTH = 0x1000 | ||
|
||
|
||
|
||
/** RAM Region for bootloader. */ | ||
/* Avoid conflict with NOINIT for OTA bond sharing */ | ||
RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20020000-0x20008000 | ||
|
||
/* Location for double reset detection, no init */ | ||
DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04 | ||
|
||
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information | ||
* from application to bootloader when using buttonless DFU OTA. */ | ||
NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80 | ||
|
||
|
||
|
||
/** Location in UICR where bootloader start address is stored. */ | ||
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04 | ||
|
||
/** Location in UICR where mbr params page address is stored. */ | ||
UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04 | ||
} | ||
|
||
SECTIONS | ||
{ | ||
.fs_data_out ALIGN(4): | ||
{ | ||
PROVIDE( __start_fs_data = .); | ||
KEEP(*(fs_data)) | ||
PROVIDE( __stop_fs_data = .); | ||
} = 0 | ||
|
||
.bootloaderConfig : | ||
{ | ||
KEEP(*(.bootloaderConfig)) | ||
} > BOOTLOADER_CONFIG | ||
|
||
/* Place the bootloader settings page in flash. */ | ||
.bootloaderSettings(NOLOAD) : | ||
{ | ||
|
||
} > BOOTLOADER_SETTINGS | ||
|
||
/* Write the bootloader address in UICR. */ | ||
.uicrBootStartAddress : | ||
{ | ||
KEEP(*(.uicrBootStartAddress)) | ||
} > UICR_BOOTLOADER | ||
|
||
/* Place the mbr params page in flash. */ | ||
.mbrParamsPage(NOLOAD) : | ||
{ | ||
|
||
} > MBR_PARAMS_PAGE | ||
|
||
/* Write the bootloader address in UICR. */ | ||
.uicrMbrParamsPageAddress : | ||
{ | ||
KEEP(*(.uicrMbrParamsPageAddress)) | ||
} > UICR_MBR_PARAM_PAGE | ||
|
||
.dbl_reset(NOLOAD) : | ||
{ | ||
|
||
} > DBL_RESET | ||
|
||
/* No init RAM section in bootloader. Used for bond information exchange. */ | ||
.noinit(NOLOAD) : | ||
{ | ||
|
||
} > NOINIT | ||
|
||
/* other placements follow here... */ | ||
} | ||
|
||
INCLUDE "nrf_common.ld" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* Linker script to configure memory regions. */ | ||
|
||
SEARCH_DIR(.) | ||
GROUP(-lgcc -lc -lnosys) | ||
|
||
MEMORY | ||
{ | ||
/** Flash start address for the bootloader. This setting will also be stored in UICR to allow the | ||
* MBR to init the bootloader when starting the system. This value must correspond to | ||
* BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if | ||
* those values do not match. The check is performed in main.c, see | ||
* APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); | ||
*/ | ||
/* due to lack of flash for debug, we will use reserved app to extend bootloader size */ | ||
FLASH (rx) : ORIGIN = 0xF4000-28K, LENGTH = 0xFE000-0xF4000 - 2K + 28K /* 38 KB */ | ||
|
||
BOOTLOADER_CONFIG (r): ORIGIN = 0xFE000 - 2K, LENGTH = 2K | ||
|
||
/** Location of mbr params page in flash. */ | ||
MBR_PARAMS_PAGE (rw) : ORIGIN = 0xFE000, LENGTH = 0x1000 | ||
|
||
/** Location of bootloader setting in flash. */ | ||
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0xFF000, LENGTH = 0x1000 | ||
|
||
|
||
|
||
/** RAM Region for bootloader. */ | ||
/* Avoid conflict with NOINIT for OTA bond sharing */ | ||
RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20040000-0x20008000 | ||
|
||
/* Location for double reset detection, no init */ | ||
DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04 | ||
|
||
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information | ||
* from application to bootloader when using buttonless DFU OTA. */ | ||
NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80 | ||
|
||
|
||
|
||
/** Location in UICR where bootloader start address is stored. */ | ||
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04 | ||
|
||
/** Location in UICR where mbr params page address is stored. */ | ||
UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04 | ||
} | ||
|
||
SECTIONS | ||
{ | ||
.fs_data_out ALIGN(4): | ||
{ | ||
PROVIDE( __start_fs_data = .); | ||
KEEP(*(fs_data)) | ||
PROVIDE( __stop_fs_data = .); | ||
} = 0 | ||
|
||
.bootloaderConfig : | ||
{ | ||
KEEP(*(.bootloaderConfig)) | ||
} > BOOTLOADER_CONFIG | ||
|
||
/* Place the bootloader settings page in flash. */ | ||
.bootloaderSettings(NOLOAD) : | ||
{ | ||
|
||
} > BOOTLOADER_SETTINGS | ||
|
||
/* Write the bootloader address in UICR. */ | ||
.uicrBootStartAddress : | ||
{ | ||
KEEP(*(.uicrBootStartAddress)) | ||
} > UICR_BOOTLOADER | ||
|
||
/* Place the mbr params page in flash. */ | ||
.mbrParamsPage(NOLOAD) : | ||
{ | ||
|
||
} > MBR_PARAMS_PAGE | ||
|
||
/* Write the bootloader address in UICR. */ | ||
.uicrMbrParamsPageAddress : | ||
{ | ||
KEEP(*(.uicrMbrParamsPageAddress)) | ||
} > UICR_MBR_PARAM_PAGE | ||
|
||
.dbl_reset(NOLOAD) : | ||
{ | ||
|
||
} > DBL_RESET | ||
|
||
/* No init RAM section in bootloader. Used for bond information exchange. */ | ||
.noinit(NOLOAD) : | ||
{ | ||
|
||
} > NOINIT | ||
|
||
/* other placements follow here... */ | ||
} | ||
|
||
INCLUDE "nrf_common.ld" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* Linker script to configure memory regions. */ | ||
|
||
SEARCH_DIR(.) | ||
GROUP(-lgcc -lc -lnosys) | ||
|
||
MEMORY | ||
{ | ||
/** Flash start address for the bootloader. This setting will also be stored in UICR to allow the | ||
* MBR to init the bootloader when starting the system. This value must correspond to | ||
* BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if | ||
* those values do not match. The check is performed in main.c, see | ||
* APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); | ||
*/ | ||
FLASH (rx) : ORIGIN = 0x74000-28K, LENGTH = 0x7E000-0x74000+28K /* 40 KB */ | ||
|
||
/** Location of mbr params page in flash. */ | ||
MBR_PARAMS_PAGE (rw) : ORIGIN = 0x7E000, LENGTH = 0x1000 | ||
|
||
/** Location of bootloader setting in flash. */ | ||
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x7F000, LENGTH = 0x1000 | ||
|
||
|
||
|
||
/** RAM Region for bootloader. */ | ||
RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20010000-0x20008000 | ||
|
||
/* Location for double reset detection, no init */ | ||
DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04 | ||
|
||
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information | ||
* from application to bootloader when using buttonless DFU OTA. */ | ||
NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80 | ||
|
||
|
||
|
||
/** Location in UICR where bootloader start address is stored. */ | ||
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04 | ||
|
||
/** Location in UICR where mbr params page address is stored. */ | ||
UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04 | ||
} | ||
|
||
SECTIONS | ||
{ | ||
.fs_data_out ALIGN(4): | ||
{ | ||
PROVIDE( __start_fs_data = .); | ||
KEEP(*(fs_data)) | ||
PROVIDE( __stop_fs_data = .); | ||
} = 0 | ||
|
||
/* Place the bootloader settings page in flash. */ | ||
.bootloaderSettings(NOLOAD) : | ||
{ | ||
|
||
} > BOOTLOADER_SETTINGS | ||
|
||
/* Write the bootloader address in UICR. */ | ||
.uicrBootStartAddress : | ||
{ | ||
KEEP(*(.uicrBootStartAddress)) | ||
} > UICR_BOOTLOADER | ||
|
||
/* Place the mbr params page in flash. */ | ||
.mbrParamsPage(NOLOAD) : | ||
{ | ||
|
||
} > MBR_PARAMS_PAGE | ||
|
||
/* Write the bootloader address in UICR. */ | ||
.uicrMbrParamsPageAddress : | ||
{ | ||
KEEP(*(.uicrMbrParamsPageAddress)) | ||
} > UICR_MBR_PARAM_PAGE | ||
|
||
.dbl_reset(NOLOAD) : | ||
{ | ||
|
||
} > DBL_RESET | ||
|
||
/* No init RAM section in bootloader. Used for bond information exchange. */ | ||
.noinit(NOLOAD) : | ||
{ | ||
|
||
} > NOINIT | ||
/* other placements follow here... */ | ||
} | ||
|
||
INCLUDE "nrf_common.ld" |