Skip to content

Commit c4bb06c

Browse files
committed
cmake: store a variable reference in cache for TF-M signing code
This commit stores a partition manager variable reference in the CMake cache, so that sysbuild can update with correct value after partition manager has completed. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent e13551e commit c4bb06c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmake/sysbuild/tfm_signing.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ function(zephyr_mcuboot_tasks)
8787
#endforeach()
8888

8989
# set(west_sign imgtool sign --version 0.0.0+0 --align 4 --slot-size 262144 --pad-header --header-size 0x200)
90-
string(TOUPPER "${DEFAULT_IMAGE}" application_uppercase)
91-
# set(west_sign imgtool sign --version 0.0.0+0 --align 4 --slot-size $<TARGET_PROPERTY:partition_manager,PM_${application_uppercase}_SIZE> --pad-header --header-size ${SB_CONFIG_PM_MCUBOOT_PAD})
92-
set(west_sign imgtool sign --version ${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION} --align 4 --slot-size 0xa8000) #--pad-header --header-size ${SB_CONFIG_PM_MCUBOOT_PAD})
90+
set(west_sign imgtool sign --version 0.0.0+0 --align 4 --slot-size @PM_APP_SIZE@ CACHE STRING "west sign command")
91+
# set(west_sign imgtool sign --version ${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION} --align 4 --slot-size 0xa8000) #--pad-header --header-size ${SB_CONFIG_PM_MCUBOOT_PAD})
9392

9493
# Arguments to imgtool.
9594
if(NOT CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS STREQUAL "")

sysbuild/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ include_packaging()
200200
include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/partition_manager.cmake OPTIONAL)
201201
endif()
202202

203+
# temp hack, load the specifically needed PM setting into a CMake current scope var.
204+
get_property(PM_APP_SIZE TARGET partition_manager PROPERTY PM_APP_SIZE)
205+
get_property(PM_MCUBOOT_PAD TARGET partition_manager PROPERTY PM_MCUBOOT_PAD)
203206
foreach(image ${IMAGES})
204207
configure_cache(IMAGE ${image})
205208
endforeach()

0 commit comments

Comments
 (0)