Skip to content

Commit 500fa72

Browse files
lemreycarlescufi
authored andcommitted
boards: arm: nrf52840_pca10059: correctly set FLASH_LOAD_OFFSET
Set FLASH_LOAD_OFFSET correctly (accounting for Nordic MBR) when BOARD_HAS_NRF5_BOOTLOADER is defined and we're not compiling MCUboot. MCUboot will select USE_CODE_PARTITION, which will make it link correctly regardless of which board DTS is used (stock/debugger). Signed-off-by: Emanuele Di Santo <[email protected]>
1 parent 0e8e92c commit 500fa72

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

boards/arm/nrf52840_pca10059/Kconfig.defconfig

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@ if BOARD_NRF52840_PCA10059
99
config BOARD
1010
default "nrf52840_pca10059"
1111

12-
if BOARD_HAS_NRF5_BOOTLOADER && !BOOTLOADER_MCUBOOT
12+
if BOARD_HAS_NRF5_BOOTLOADER && !USE_CODE_PARTITION
1313

14-
# Link the application after Nordic MBR.
15-
# When flashing MCUBoot, leave unchanged to link it in its correct partition.
14+
# To let the nRF5 bootloader load an application, the application
15+
# must be linked after Nordic MBR, that is factory-programmed on the board.
1616

17-
config TEXT_SECTION_OFFSET
18-
default 0x1000
17+
# Nordic nRF5 booatloader exists outside of the partitions specified in the
18+
# DTS file, so we manually override FLASH_LOAD_OFFEST to link the application
19+
# correctly, after Nordic MBR.
1920

20-
endif # BOARD_HAS_NRF5_BOOTLOADER && !BOOTLOADER_MCUBOOT
21+
# When building MCUBoot, MCUBoot itself will select USE_CODE_PARTITION
22+
# which will make it link into the correct partition specified in DTS file,
23+
# so no override is necessary.
24+
25+
config FLASH_LOAD_OFFSET
26+
default 0x1000
27+
28+
endif # BOARD_HAS_NRF5_BOOTLOADER && !USE_CODE_PARTITION
2129

2230
if ADC
2331

0 commit comments

Comments
 (0)