From cab68008a3ade880f6e78b65cd0c4fa401ced0a9 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 25 Sep 2025 16:11:59 +0200 Subject: [PATCH] [nrf noup] boot: Skip override in merged slot In merged slot approach, mcuboot should not automatically set the ROM_END_OFFSET as it is not obvious, which image includes the (merged) MCUboot trailer. Ref: NCSDK-35612 Signed-off-by: Tomasz Chyrowicz --- boot/zephyr/sysbuild/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boot/zephyr/sysbuild/CMakeLists.txt b/boot/zephyr/sysbuild/CMakeLists.txt index 5a2a881b7..800d11bce 100644 --- a/boot/zephyr/sysbuild/CMakeLists.txt +++ b/boot/zephyr/sysbuild/CMakeLists.txt @@ -35,7 +35,11 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_image_cmake) math(EXPR mcuboot_image_footer_size "${mcuboot_image_footer_size}" OUTPUT_FORMAT HEXADECIMAL) math(EXPR mcuboot_image_upgrade_footer_size "${mcuboot_image_upgrade_footer_size}" OUTPUT_FORMAT HEXADECIMAL) - set_property(TARGET ${image} APPEND_STRING PROPERTY CONFIG "CONFIG_ROM_END_OFFSET=${mcuboot_image_footer_size}\n") + # When merged binary is generated, the checks for header and trailer + # offsets are implemented in CMake, instead of linker scripts. + if(NOT SB_CONFIG_MCUBOOT_SIGN_MERGED_BINARY) + set_property(TARGET ${image} APPEND_STRING PROPERTY CONFIG "CONFIG_ROM_END_OFFSET=${mcuboot_image_footer_size}\n") + endif() set_property(TARGET ${image} APPEND_STRING PROPERTY CONFIG "CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE=${mcuboot_image_upgrade_footer_size}\n") return() endif()