From c4bb06cbd37e269aa333cb14244217b244af5d78 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 12 Oct 2023 16:27:31 +0200 Subject: [PATCH] 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 --- cmake/sysbuild/tfm_signing.cmake | 5 ++--- sysbuild/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/sysbuild/tfm_signing.cmake b/cmake/sysbuild/tfm_signing.cmake index 2040bc483630..553cb6b370a1 100644 --- a/cmake/sysbuild/tfm_signing.cmake +++ b/cmake/sysbuild/tfm_signing.cmake @@ -87,9 +87,8 @@ function(zephyr_mcuboot_tasks) #endforeach() # set(west_sign imgtool sign --version 0.0.0+0 --align 4 --slot-size 262144 --pad-header --header-size 0x200) - string(TOUPPER "${DEFAULT_IMAGE}" application_uppercase) -# set(west_sign imgtool sign --version 0.0.0+0 --align 4 --slot-size $ --pad-header --header-size ${SB_CONFIG_PM_MCUBOOT_PAD}) - 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}) + set(west_sign imgtool sign --version 0.0.0+0 --align 4 --slot-size @PM_APP_SIZE@ CACHE STRING "west sign command") +# 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}) # Arguments to imgtool. if(NOT CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS STREQUAL "") diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 32356d653886..82b5de1a36e9 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -200,6 +200,9 @@ include_packaging() include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/partition_manager.cmake OPTIONAL) endif() + # temp hack, load the specifically needed PM setting into a CMake current scope var. + get_property(PM_APP_SIZE TARGET partition_manager PROPERTY PM_APP_SIZE) + get_property(PM_MCUBOOT_PAD TARGET partition_manager PROPERTY PM_MCUBOOT_PAD) foreach(image ${IMAGES}) configure_cache(IMAGE ${image}) endforeach()