This variable was originally provided for two indended purposes: * Let users manually add a new image in a desired order in the list. * Let users set build-only images, which are excluded from the list. Given the recent additions of the `sysbuild_add_dependencies()` function and the `BUILD_ONLY` parameter, `IMAGES` should be considered obsolete. Furthermore, the list of images added to sysbuild should be updated automatically when calling `ExternalZephyrProject_Add()`. This is now possible by using a GLOBAL property internal to sysbuild. With that, the `IMAGES` variable can be removed. Its existing usage for image ordering is replaced with `sysbuild_add_dependencies()` treewide. Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
26 lines
966 B
CMake
26 lines
966 B
CMake
# Copyright 2022 NXP
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Add the mcuboot key file to the secondary swapped app
|
|
# This must be done here to ensure that the same key file is used for signing
|
|
# both the primary and secondary apps
|
|
set(swapped_app_CONFIG_MCUBOOT_SIGNATURE_KEY_FILE
|
|
\"${SB_CONFIG_BOOT_SIGNATURE_KEY_FILE}\" CACHE STRING
|
|
"Signature key file for signing" FORCE)
|
|
|
|
# Add the swapped app to the build
|
|
ExternalZephyrProject_Add(
|
|
APPLICATION swapped_app
|
|
SOURCE_DIR ${APP_DIR}/swapped_app
|
|
)
|
|
|
|
# Add the swapped app to the list of images to flash
|
|
# Ensure the flashing order of images is as follows:
|
|
# - mcuboot
|
|
# - swapped app
|
|
# - primary app (test_mcuboot)
|
|
# This order means that if the debugger resets the MCU in between flash
|
|
# iterations, the MCUBoot swap won't be triggered until the secondary app
|
|
# is actually present in flash.
|
|
sysbuild_add_dependencies(FLASH test_mcuboot swapped_app)
|
|
sysbuild_add_dependencies(FLASH swapped_app mcuboot)
|