Skip to content

Commit 6bb7b99

Browse files
committed
sysbuild: Add non-secure flash sim overlay file
Adds an overlay which is used on non-secure nRF53 board targets as they do not use RAM at the beginning of the RAM start area, due to being offset for the TF-M secure image Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
1 parent 7552b40 commit 6bb7b99

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

modules/mcuboot/flash_sim.overlay

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
*/
1515

1616
/ {
17+
/*
18+
* Non-secure is excluded from changing the chosen SRAM node, as images specify a memory
19+
* region in RAM that is dedicated to the non-secure image, thus no offset is needed.
20+
*/
21+
#ifndef NS_PARTITION_LAYOUT
1722
chosen {
1823
zephyr,sram = &sram0_offset_for_dfu;
1924
};
25+
#endif
2026

2127
soc {
2228
/*
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define NS_PARTITION_LAYOUT
2+
#include "flash_sim.overlay"

sysbuild/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,17 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake)
807807
${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/flash_sim_mcuboot.overlay
808808
)
809809

810-
add_overlay_dts(
811-
${DEFAULT_IMAGE}
812-
${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/flash_sim.overlay
813-
)
810+
if(SB_CONFIG_BOARD_IS_NON_SECURE)
811+
add_overlay_dts(
812+
${DEFAULT_IMAGE}
813+
${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/flash_sim_ns.overlay
814+
)
815+
else()
816+
add_overlay_dts(
817+
${DEFAULT_IMAGE}
818+
${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/flash_sim.overlay
819+
)
820+
endif()
814821
endif()
815822
else()
816823
set_config_bool(mcuboot CONFIG_PCD_APP n)

0 commit comments

Comments
 (0)