Skip to content

Commit

Permalink
cmake: store a variable reference in cache for TF-M signing code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tejlmand committed Oct 13, 2023
1 parent e13551e commit c4bb06c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmake/sysbuild/tfm_signing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_PROPERTY:partition_manager,PM_${application_uppercase}_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 "")
Expand Down
3 changes: 3 additions & 0 deletions sysbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c4bb06c

Please sign in to comment.