Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmake/sysbuild/image_signing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function(zephyr_mcuboot_tasks)
dt_chosen(flash_node PROPERTY "zephyr,flash")
dt_nodelabel(slot0_flash NODELABEL "slot0_partition" REQUIRED)
dt_reg_size(slot_size PATH "${slot0_flash}" REQUIRED)
# Absolute slot0 address is used to set ih_load_addr in the image header so
# that the MCUBOOT_CHECK_HEADER_LOAD_ADDRESS feature can verify the
# secondary-slot image is intended for the primary slot.
dt_partition_addr(slot0_partition_address PATH "${slot0_flash}" REQUIRED ABSOLUTE)
dt_prop(write_block_size PATH "${flash_node}" PROPERTY "write-block-size")

if(NOT write_block_size)
Expand Down Expand Up @@ -90,7 +94,7 @@ function(zephyr_mcuboot_tasks)
set(imgtool_rom_command)
if(CONFIG_MCUBOOT_IMGTOOL_OVERWRITE_ONLY)
# Use overwrite-only instead of swap upgrades.
set(imgtool_rom_command --overwrite-only --align 1)
set(imgtool_rom_command --overwrite-only --align 1 --rom-fixed ${slot0_partition_address})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done with zephyr,code-partition as few deozen line bellow.

elseif(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD OR
CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT)
# RAM load requires setting the location of where to load the image to
Expand Down Expand Up @@ -124,7 +128,7 @@ function(zephyr_mcuboot_tasks)
dt_reg_size(slot_size PATH "${code_partition}" REQUIRED)
set(imgtool_rom_command --rom-fixed ${code_partition_offset} --align ${write_block_size})
else()
set(imgtool_rom_command --align ${write_block_size})
set(imgtool_rom_command --align ${write_block_size} --rom-fixed ${slot0_partition_address})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(imgtool_rom_command --align ${write_block_size} --rom-fixed ${slot0_partition_address})
dt_chosen(code_partition PROPERTY "zephyr,code-partition")
dt_partition_addr(code_partition_offset PATH "${code_partition}" REQUIRED)
set(imgtool_rom_command --align ${write_block_size} --rom-fixed ${code_partition_offset)

endif()

# TF-M combined images need --pad-header because the MCUboot header gap is
Expand Down
1 change: 1 addition & 0 deletions sysbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake)
OR SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT
OR SB_CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION
# Do not use the upstream mcuboot.cmake on new platforms.
OR SB_CONFIG_SOC_SERIES_NRF53
OR SB_CONFIG_SOC_SERIES_NRF54L
OR SB_CONFIG_SOC_SERIES_NRF54H OR SB_CONFIG_QSPI_XIP_SPLIT_IMAGE
# TF-M NS builds require signing tfm_merged.hex, not zephyr.hex.
Expand Down
Loading