diff --git a/CMakeLists.txt b/CMakeLists.txt index b57e564fc285..1955fcc8df46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ endforeach() include(cmake/extensions.cmake) include(cmake/version.cmake) include(cmake/version_app.cmake) -include(cmake/multi_image.cmake) include(cmake/sdp.cmake) zephyr_include_directories(include) diff --git a/Kconfig.nrf b/Kconfig.nrf index fc019955f389..8b6e648b2f3d 100644 --- a/Kconfig.nrf +++ b/Kconfig.nrf @@ -28,12 +28,6 @@ endif # BUILD_WITH_TFM menu "Nordic nRF Connect" -# Hides child parent configuration options -config HIDE_CHILD_PARENT_CONFIG - bool - default y if "$(HIDE_CHILD_PARENT_CONFIG)" = "True" - default n - # Override configuration from zephyr which sets this to 0x200 if MCUboot is # enabled (CONFIG_BOOTLOADER_MCUBOOT), since NCS use partition_manager to # get this offset intsead. diff --git a/applications/machine_learning/CMakeLists.txt b/applications/machine_learning/CMakeLists.txt index ff90feb8c4a0..676ae206bb86 100644 --- a/applications/machine_learning/CMakeLists.txt +++ b/applications/machine_learning/CMakeLists.txt @@ -39,7 +39,3 @@ add_subdirectory(common/src/modules) add_subdirectory(src/events) add_subdirectory(src/modules) add_subdirectory(src/util) - -if(CONFIG_BT_HCI_IPC AND NOT SYSBUILD) - assert_exists(hci_ipc_CONF_FILE) -endif() diff --git a/applications/nrf_desktop/CMakeLists.txt b/applications/nrf_desktop/CMakeLists.txt index ec87ef388447..5c8f5f931031 100644 --- a/applications/nrf_desktop/CMakeLists.txt +++ b/applications/nrf_desktop/CMakeLists.txt @@ -43,19 +43,7 @@ add_subdirectory(src/hw_interface) add_subdirectory(src/modules) add_subdirectory(src/util) -if(NOT SYSBUILD AND NOT CONFIG_NCS_IS_VARIANT_IMAGE) - if(CONFIG_BOOTLOADER_MCUBOOT) - assert_exists(mcuboot_CONF_FILE) - endif() - if(CONFIG_SECURE_BOOT) - assert_exists(b0_CONF_FILE) - endif() - if(CONFIG_BT_HCI_IPC) - assert_exists(hci_ipc_CONF_FILE) - endif() -endif() - -if (CONFIG_IMG_MANAGER) +if(CONFIG_IMG_MANAGER) zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) endif() diff --git a/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 b/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 index a1758d9e0264..ff389a3084b7 100644 --- a/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 +++ b/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 @@ -93,9 +93,6 @@ config SECURE_BOOT config BOOTLOADER_MCUBOOT default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS -config ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - config NRF53_UPGRADE_NETWORK_CORE default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS diff --git a/cmake/extensions.cmake b/cmake/extensions.cmake index 3fb35d0f7dac..a245a17f2fae 100644 --- a/cmake/extensions.cmake +++ b/cmake/extensions.cmake @@ -80,35 +80,6 @@ function(get_board_without_ns_suffix board_in board_out) endif() endfunction() -# Add an overlay file to a child image. -# This can be used by a parent image to set overlay of Kconfig configuration or devicetree -# in its child images. This function must be called before 'add_child_image(image)' -# to have effect. -# -# Parameters: -# 'image' - child image name -# 'overlay_file' - overlay to be added to child image -# 'overlay_type' - 'OVERLAY_CONFIG' or 'DTC_OVERLAY_FILE' -function(add_overlay image overlay_file overlay_type) - set(old_overlays ${${image}_${overlay_type}}) - string(FIND "${old_overlays}" "${overlay_file}" found) - if (${found} EQUAL -1) - set(${image}_${overlay_type} "${old_overlays};${overlay_file}" CACHE STRING - "Extra config fragments for ${image} child image" FORCE - ) - endif() -endfunction() - -# Convenience macro to add configuration overlays to child image. -macro(add_overlay_config image overlay_file) - add_overlay(${image} ${overlay_file} EXTRA_CONF_FILE) -endmacro() - -# Convenience macro to add device tree overlays to child image. -macro(add_overlay_dts image overlay_file) - add_overlay(${image} ${overlay_file} EXTRA_DTC_OVERLAY_FILE) -endmacro() - # Add a partition manager configuration file to the build. # Note that is only one image is included in the build, # you must set CONFIG_PM_SINGLE_IMAGE=y for the partition manager @@ -353,59 +324,13 @@ function(set_shared) set(multi_args "PROPERTY") cmake_parse_arguments(SHARE "${flags}" "${single_args}" "${multi_args}" ${ARGN}) - if(SYSBUILD) - # Sysbuild can read the cache directly, no reason for an extra share file. - list(POP_FRONT SHARE_PROPERTY listname) - if(SHARE_APPEND) - list(APPEND ${listname} ${SHARE_PROPERTY}) - list(REMOVE_DUPLICATES ${listname}) - set(SHARE_PROPERTY ${${listname}}) - endif() - set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var") - return() - endif() - - check_arguments_required("set_shared" SHARE IMAGE FILE) - - check_arguments_exclusive("set_shared" SHARE FILE IMAGE PROPERTY APPEND) - check_arguments_exclusive("set_shared" SHARE IMAGE FILE) - - - set(prop_target ${IMAGE_NAME}_shared_property_target) - if(NOT TARGET ${prop_target}) - add_custom_target(${prop_target}) - endif() - - if(DEFINED SHARE_IMAGE) - # When using IMAGE, then PROPERTY is also required. - check_arguments_required("set_shared" SHARE PROPERTY) - - set(share_prop_target ${SHARE_IMAGE}_shared_property_target) - - if(SHARE_APPEND) - set(SHARE_APPEND APPEND) - else() - set(SHARE_APPEND) - endif() - - get_property(string_targets TARGET ${prop_target} PROPERTY image_targets) - if(NOT "add_custom_target(${share_prop_target})" IN_LIST string_targets) - set_property( - TARGET ${prop_target} APPEND PROPERTY - image_targets "add_custom_target(${share_prop_target})" - ) - endif() - - set_property(TARGET ${prop_target} APPEND_STRING PROPERTY shared_vars - "set_property(TARGET ${share_prop_target} ${SHARE_APPEND} PROPERTY ${SHARE_PROPERTY})\n" - ) - endif() - - if(DEFINED SHARE_FILE) - set_property(TARGET ${prop_target} APPEND_STRING PROPERTY shared_vars - "include(${SHARE_FILE})\n" - ) + list(POP_FRONT SHARE_PROPERTY listname) + if(SHARE_APPEND) + list(APPEND ${listname} ${SHARE_PROPERTY}) + list(REMOVE_DUPLICATES ${listname}) + set(SHARE_PROPERTY ${${listname}}) endif() + set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var") endfunction() # generate_shared(IMAGE FILE ) diff --git a/cmake/fw_zip.cmake b/cmake/fw_zip.cmake index 0a01f716d7a2..d50680445f18 100644 --- a/cmake/fw_zip.cmake +++ b/cmake/fw_zip.cmake @@ -18,7 +18,7 @@ function(generate_dfu_zip) message(FATAL_ERROR "Missing required param") endif() - if(SYSBUILD AND GENZIP_IMAGE) + if(GENZIP_IMAGE) set(APPNAME ${GENZIP_IMAGE}) sysbuild_get(CONFIG_BUILD_OUTPUT_META IMAGE ${GENZIP_IMAGE} VAR CONFIG_BUILD_OUTPUT_META KCONFIG) sysbuild_get(CONFIG_BOARD IMAGE ${GENZIP_IMAGE} VAR CONFIG_BOARD KCONFIG) diff --git a/cmake/mesh_dfu_metadata.cmake b/cmake/mesh_dfu_metadata.cmake index e52e34cc5b25..98fca26a3314 100644 --- a/cmake/mesh_dfu_metadata.cmake +++ b/cmake/mesh_dfu_metadata.cmake @@ -7,12 +7,7 @@ find_package(Python3 REQUIRED) function(mesh_dfu_metadata) - if(SYSBUILD) - set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr) - else() - set(metadata_dir ${PROJECT_BINARY_DIR}) - endif() - + set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr) set(metadata_depends ${CMAKE_BINARY_DIR}/dfu_application.zip) add_custom_command( @@ -42,6 +37,4 @@ function(mesh_dfu_metadata) ) endfunction() -if(SYSBUILD) - mesh_dfu_metadata() -endif() +mesh_dfu_metadata() diff --git a/cmake/multi_image.cmake b/cmake/multi_image.cmake deleted file mode 100644 index 8eafc3349b49..000000000000 --- a/cmake/multi_image.cmake +++ /dev/null @@ -1,574 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(SYSBUILD) - # Sysbuild and child-image are mutual exclusive, so if sysbuild is used disable child-image - function(add_child_image) - set(CONFIG_USE_PARTITION_MANAGER n CACHE INTERNAL "") - # ignore, sysbuild is in use. - endfunction() - return() -endif() - -if(IMAGE_NAME) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY KERNEL_HEX_NAME ${KERNEL_HEX_NAME}) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY ZEPHYR_BINARY_DIR ${ZEPHYR_BINARY_DIR}) - # Share the elf file, in order to support symbol loading for debuggers. - set_shared(IMAGE ${IMAGE_NAME} PROPERTY KERNEL_ELF_NAME ${KERNEL_ELF_NAME}) - set_shared(IMAGE ${IMAGE_NAME} - PROPERTY BUILD_BYPRODUCTS - ${PROJECT_BINARY_DIR}/${KERNEL_HEX_NAME} - ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} - ) - # Share the signing key file so that the parent image can use it to - # generate signed update candidates. - if(CONFIG_BOOT_SIGNATURE_KEY_FILE) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY SIGNATURE_KEY_FILE ${CONFIG_BOOT_SIGNATURE_KEY_FILE}) - endif() - - generate_shared(IMAGE ${IMAGE_NAME} FILE ${CMAKE_BINARY_DIR}/shared_vars.cmake) -else() - # Store a preload file with whatever configurations are required to create - # a variant build of this image (that is, 'app'). Copy relevant information - # from the 'app' image CMakeCache in order to build an identical variant image. - # In general, what we need to copy is the arguments passed by the user - # through command line arguments. These can typically be identified by - # inspecting their help text. However, some variables have special - # handling, resulting in a different help text. These cannot be found - # using the same mechanisms as the regular variables, and needs special - # handling. - - # Add a custom target similar to that created when adding a child image - # to facilitate the process of creating a variant image of the app image. - add_custom_target(app_subimage) - - set(base_image_preload_file ${CMAKE_BINARY_DIR}/image_preload.cmake) - - file( - WRITE - ${base_image_preload_file} - "# Generated file that can be used to preload variant images\n" - ) - - get_cmake_property(variables_cached CACHE_VARIABLES) - foreach(var_name ${variables_cached}) - # If '-DCONF_FILE' is specified, it is unset by boilerplate.cmake and - # replaced with 'CACHED_CONF_FILE' in the cache. Therefore we need this - # special handling for passing the value to the variant image. - if("${var_name}" MATCHES "CACHED_CONF_FILE") - list(APPEND application_vars ${var_name}) - endif() - - # If 'CACHED_CONF_FILE' is specified instead of 'CONF_FILE', the build system does not determine - # build type automatically. In that case, the 'CONF_FILE_BUILD_TYPE' shall be passed explicitly. - if("${var_name}" MATCHES "CONF_FILE_BUILD_TYPE") - list(APPEND application_vars ${var_name}) - endif() - - # '-DDTC_OVERLAY_FILE' is given helptext by the build system. Therefore - # we need this special handling for passing the value to the variant image. - if("${var_name}" MATCHES "DTC_OVERLAY_FILE") - list(APPEND application_vars ${var_name}) - endif() - - # All CONFIG_.* and CLI_CONFIG_* variables are given helptext by the build - # system. Therefore we need this special handling for passing the value to - # the variant image. - if("${var_name}" MATCHES "^CONFIG_.*" OR - "${var_name}" MATCHES "^CLI_CONFIG_.*" - ) - list(APPEND application_vars ${var_name}) - endif() - - # Command line arguments can generally be identified in the CMakeCache - # because they have the same help text generated by CMake. The text: - # - "No help, variable specified on the command line." - # - "Selected " command line variables updated by Zephyr. - get_property(var_help CACHE ${var_name} PROPERTY HELPSTRING) - string(TOLOWER ${var_name} var_name_lower) - if("${var_help}" STREQUAL "No help, variable specified on the command line." OR - "${var_help}" STREQUAL "Selected ${var_name_lower}") - list(APPEND application_vars ${var_name}) - endif() - endforeach() - - foreach(app_var_name ${application_vars}) - string(REPLACE "\"" "\\\"" app_var_value "$CACHE{${app_var_name}}") - file( - APPEND - ${base_image_preload_file} - "set(${app_var_name} \"${app_var_value}\" CACHE INTERNAL \"NCS child image controlled\")\n" - ) - endforeach() - - set_property( - TARGET app_subimage - PROPERTY preload_file - ${base_image_preload_file} - ) - - set_property( - TARGET app_subimage - PROPERTY source_dir - ${APPLICATION_SOURCE_DIR} - ) - - set_property( - TARGET app_subimage - PROPERTY binary_dir - ${CMAKE_BINARY_DIR} - ) -endif(IMAGE_NAME) - -function(add_child_image) - # Adds a child image to the build. - # - # Required arguments are: - # NAME - The name of the child image - # SOURCE_DIR - The source dir of the child image, not required if - # PRELOAD_IMAGE is set. - # - # Optional arguments are: - # DOMAIN - The domain to place the child image in. - # PRELOAD_IMAGE - Use preload file from this image instead of using standard - # mechanisms for locating child image configurations. - # Set this to "app" to use the preload file from the "root" - # image (that is, the only non-child-image in the build). - # - # Depending on the value of CONFIG_${NAME}_BUILD_STRATEGY the child image - # is either built from source, included as a hex file, or ignored. - # - # See chapter "Multi-image builds" in the documentation for more details. - - # Don't add child images when building variant images. - if (CONFIG_NCS_IS_VARIANT_IMAGE) - return() - endif() - - set(oneValueArgs NAME SOURCE_DIR DOMAIN PRELOAD_IMAGE) - cmake_parse_arguments(ACI "" "${oneValueArgs}" "" ${ARGN}) - - if (NOT ACI_NAME OR NOT (ACI_SOURCE_DIR OR ACI_PRELOAD_IMAGE)) - message(FATAL_ERROR "Missing parameter, required: NAME and (SOURCE_DIR or PRELOAD_IMAGE)") - endif() - - if (NOT CONFIG_PARTITION_MANAGER_ENABLED) - message(FATAL_ERROR - "CONFIG_PARTITION_MANAGER_ENABLED was not set for image ${ACI_NAME}." - "This option must be set for an image to support being added as a child" - "image through 'add_child_image'. This is typically done by invoking the" - " `build_strategy` kconfig template for the child image.") - endif() - - string(TOUPPER ${ACI_NAME} UPNAME) - - if (CONFIG_${UPNAME}_BUILD_STRATEGY_USE_HEX_FILE) - assert_exists(CONFIG_${UPNAME}_HEX_FILE) - message("Using ${CONFIG_${UPNAME}_HEX_FILE} instead of building ${ACI_NAME}") - - # Set property so that the hex file is merged in by partition manager. - set_property(GLOBAL PROPERTY ${ACI_NAME}_PM_HEX_FILE ${CONFIG_${UPNAME}_HEX_FILE}) - elseif (CONFIG_${UPNAME}_BUILD_STRATEGY_SKIP_BUILD) - message("Skipping building of ${ACI_NAME}") - else() - # Build normally - add_child_image_from_source(${ARGN}) - endif() -endfunction() - -function(add_child_image_from_source) - # See 'add_child_image' - set(oneValueArgs NAME SOURCE_DIR DOMAIN BOARD PRELOAD_IMAGE) - cmake_parse_arguments(ACI "" "${oneValueArgs}" "" ${ARGN}) - - if (NOT ACI_NAME OR NOT (ACI_SOURCE_DIR OR ACI_PRELOAD_IMAGE)) - message(FATAL_ERROR "Missing parameter, required: NAME and (SOURCE_DIR or PRELOAD_IMAGE)") - endif() - - # Pass information that the partition manager is enabled to Kconfig. - add_overlay_config( - ${ACI_NAME} - ${ZEPHYR_NRF_MODULE_DIR}/subsys/partition_manager/partition_manager_enabled.conf - ) - - if (${ACI_NAME}_BOARD) - message(FATAL_ERROR - "${ACI_NAME}_BOARD set in outer scope. Will be ignored, use " - "`add_child_image(BOARD ${${ACI_NAME}_BOARD} ...)` for adding a child " - "image for specific board") - endif() - - # Add the new partition manager domain if needed. - # The domain corresponds to the BOARD without the 'ns' suffix. - if (ACI_DOMAIN) - if ("${ACI_BOARD}" STREQUAL "") - message(FATAL_ERROR - "No board specified for domain '${ACI_DOMAIN}'. This configuration is " - "typically defined in ${BOARD_DIR}/Kconfig") - endif() - - set(domain_parent ${${ACI_DOMAIN}_PM_DOMAIN_DYNAMIC_PARTITION}) - if(DEFINED ${ACI_DOMAIN}_PM_DOMAIN_DYNAMIC_PARTITION - AND NOT "${domain_parent}" STREQUAL "${ACI_NAME}" - ) - # A domain may only have one child image, which can then act as a parent - # to other images in the domain. - # As it is a cache variable we check it's content so that CMake re-run - # will pass the check as long as the child image hasn't changed. - message(FATAL_ERROR "A domain may only have a single child image." - "Current domain image is: ${domain_parent}, `${domain_parent}` is a " - "domain parent image, so you may add `${ACI_NAME}` as a child inside " - "`${domain_parent}`" - ) - endif() - # This needs to be made globally available as it is used in other files. - set(${ACI_DOMAIN}_PM_DOMAIN_DYNAMIC_PARTITION ${ACI_NAME} CACHE INTERNAL "") - - if (NOT (${ACI_DOMAIN} IN_LIST PM_DOMAINS)) - list(APPEND PM_DOMAINS ${ACI_DOMAIN}) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS ${ACI_DOMAIN}) - endif() - elseif (NOT ACI_BOARD) - # No BOARD is given as argument, this triggers automatic conversion of - # *.ns board from parent image. - get_board_without_ns_suffix(${BOARD}${BOARD_QUALIFIERS} ACI_BOARD) - endif() - - if (NOT ACI_DOMAIN AND DOMAIN) - # If no domain is specified, a child image will inherit the domain of - # its parent. - set(ACI_DOMAIN ${DOMAIN}) - set(inherited " (inherited)") - endif() - - set(${ACI_NAME}_DOMAIN ${ACI_DOMAIN}) - set(${ACI_NAME}_BOARD ${ACI_BOARD}) - - message("\n=== child image ${ACI_NAME} - ${ACI_DOMAIN}${inherited} begin ===") - - if (CONFIG_BOOTLOADER_MCUBOOT) - list(APPEND extra_cmake_args "-DCONFIG_NCS_MCUBOOT_IN_BUILD=y") - endif() - - if (ACI_PRELOAD_IMAGE) - get_property( - preload_file - TARGET ${ACI_PRELOAD_IMAGE}_subimage - PROPERTY preload_file - ) - - get_property( - source_dir - TARGET ${ACI_PRELOAD_IMAGE}_subimage - PROPERTY source_dir - ) - - get_property( - binary_dir - TARGET ${ACI_PRELOAD_IMAGE}_subimage - PROPERTY binary_dir - ) - - list(APPEND extra_cmake_args "-DCONFIG_NCS_IS_VARIANT_IMAGE=y") - list(APPEND extra_cmake_args "-DPRELOAD_BINARY_DIR=${binary_dir}") - else() - set(source_dir ${ACI_SOURCE_DIR}) - - # It is possible for a sample to use a custom set of Kconfig fragments for a - # child image, or to append additional Kconfig fragments to the child image. - # Note that in this context is the name of the child image as - # passed to the 'add_child_image' function. - # - # DIRECTORY - # | - prj.conf (A) - # | - prj_.conf (B) - # | - boards DIRECTORY - # | | - .conf (C) - # | | - _.conf (D) - - - # DIRECTORY - # | - prj.conf - # | - prj_.conf - # | - child_image DIRECTORY - # |-- .conf (I) Fragment, used together with (A) and (C) - # |-- _.conf (J) Fragment, used together with (B) and (D) - # |-- .overlay If present, will be merged with BOARD.dts - # |-- DIRECTORY - # |-- boards DIRECTORY - # | |-- .conf (E) If present, use instead of (C), requires (G). - # | |-- _.conf (F) If present, use instead of (D), requires (H). - # | |-- .overlay If present, will be merged with BOARD.dts - # | |-- _.overlay If present, will be merged with BOARD.dts - # |-- prj.conf (G) If present, use instead of (A) - # | Note that (C) is ignored if this is present. - # | Use (E) instead. - # |-- prj_.conf (H) If present, used instead of (B) when user - # | specify `-DCONF_FILE=prj_.conf for - # | parent image. Note that any (C) is ignored - # | if this is present. Use (F) instead. - # |-- .overlay If present, will be merged with BOARD.dts - # |-- _.overlay If present, will be merged with BOARD.dts - # - # Note: The folder `child_image/` is only need when configurations - # files must be used instead of the child image default configs. - # The append a child image default config, place the additional settings - # in `child_image/.conf`. - zephyr_get(COMMON_CHILD_IMAGE_CONFIG_DIR) - string(CONFIGURE "${COMMON_CHILD_IMAGE_CONFIG_DIR}" COMMON_CHILD_IMAGE_CONFIG_DIR) - foreach(config_dir ${APPLICATION_CONFIG_DIR} ${COMMON_CHILD_IMAGE_CONFIG_DIR} ) - set(ACI_CONF_DIR ${config_dir}/child_image) - set(ACI_NAME_CONF_DIR ${config_dir}/child_image/${ACI_NAME}) - if (NOT ${ACI_NAME}_CONF_FILE) - if(DEFINED CONF_FILE_BUILD_TYPE AND DEFINED ${ACI_NAME}_FILE_SUFFIX) - message(WARNING "Cannot use BUILD_TYPE='${CONF_FILE_BUILD_TYPE}' together with ${ACI_NAME}_FILE_SUFFIX='${${ACI_NAME}_FILE_SUFFIX}'. " - "Ignoring BUILD_TYPE='${CONF_FILE_BUILD_TYPE}'" - ) - else() - set(LEGACY_BUILD_ARGUMENT BUILD ${CONF_FILE_BUILD_TYPE}) - endif() - ncs_file(CONF_FILES ${ACI_NAME_CONF_DIR} - BOARD ${ACI_BOARD} - # Child image always uses the same revision as parent board. - BOARD_REVISION ${BOARD_REVISION} - KCONF ${ACI_NAME}_CONF_FILE - DTS ${ACI_NAME}_DTC_OVERLAY_FILE - ${LEGACY_BUILD_ARGUMENT} - SUFFIX ${${ACI_NAME}_FILE_SUFFIX} - ) - # Place the result in the CMake cache and remove local scoped variable. - foreach(file CONF_FILE DTC_OVERLAY_FILE) - if(DEFINED ${ACI_NAME}_${file}) - set(${ACI_NAME}_${file} ${${ACI_NAME}_${file}} CACHE STRING - "Default ${ACI_NAME} configuration file" FORCE - ) - set(${ACI_NAME}_${file}) - endif() - endforeach() - - # Check for configuration fragment. The contents of these are appended - # to the project configuration, as opposed to the CONF_FILE which is used - # as the base configuration. - if(DEFINED ${ACI_NAME}_FILE_SUFFIX) - # Child/parent image does not support a prefix for the main application, therefore only - # use child image configuration with suffixes if specifically commanded with an argument - # targeting this child image - set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}.conf) - zephyr_file_suffix(child_image_conf_fragment SUFFIX ${${ACI_NAME}_FILE_SUFFIX}) - elseif(NOT "${CONF_FILE_BUILD_TYPE}" STREQUAL "") - set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}_${CONF_FILE_BUILD_TYPE}.conf) - else() - set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}.conf) - endif() - if (EXISTS ${child_image_conf_fragment}) - add_overlay_config(${ACI_NAME} ${child_image_conf_fragment}) - endif() - - # Check for overlay named .overlay. - set(child_image_dts_overlay ${ACI_CONF_DIR}/${ACI_NAME}.overlay) - zephyr_file_suffix(child_image_dts_overlay SUFFIX ${${ACI_NAME}_FILE_SUFFIX}) - if (EXISTS ${child_image_dts_overlay}) - add_overlay_dts(${ACI_NAME} ${child_image_dts_overlay}) - endif() - - if(${ACI_NAME}_CONF_FILE OR ${ACI_NAME}_DTC_OVERLAY_FILE - OR EXISTS ${child_image_conf_fragment} OR EXISTS ${child_image_dts_overlay}) - # If anything is picked up directly from APPLICATION_CONFIG_DIR, then look no further. - break() - endif() - endif() - endforeach() - # Construct a list of variables that, when present in the root - # image, should be passed on to all child images as well. - list(APPEND - SHARED_MULTI_IMAGE_VARIABLES - CMAKE_BUILD_TYPE - CMAKE_VERBOSE_MAKEFILE - BOARD_DIR - BOARD_REVISION - ZEPHYR_MODULES - ZEPHYR_EXTRA_MODULES - ZEPHYR_TOOLCHAIN_VARIANT - CROSS_COMPILE - GNUARMEMB_TOOLCHAIN_PATH - EXTRA_KCONFIG_TARGETS - NCS_TOOLCHAIN_VERSION - PM_DOMAINS - ${ACI_DOMAIN}_PM_DOMAIN_DYNAMIC_PARTITION - WEST_PYTHON - ) - - # Construct a list of cache variables that, when present in the root - # image, should be passed on to all child images as well. - list(APPEND - SHARED_CACHED_MULTI_IMAGE_VARIABLES - ARCH_ROOT - BOARD_ROOT - SOC_ROOT - MODULE_EXT_ROOT - SCA_ROOT - ) - - foreach(kconfig_target ${EXTRA_KCONFIG_TARGETS}) - list(APPEND - SHARED_MULTI_IMAGE_VARIABLES - EXTRA_KCONFIG_TARGET_COMMAND_FOR_${kconfig_target} - ) - endforeach() - - set(preload_file ${CMAKE_BINARY_DIR}/${ACI_NAME}/child_image_preload.cmake) - file(WRITE ${preload_file} "# Generated file used for preloading a child image\n") - - unset(image_cmake_args) - list(REMOVE_DUPLICATES SHARED_MULTI_IMAGE_VARIABLES) - foreach(shared_var ${SHARED_MULTI_IMAGE_VARIABLES}) - if(DEFINED ${shared_var}) - file( - APPEND - ${preload_file} - "set(${shared_var} \"${${shared_var}}\" CACHE INTERNAL \"NCS child image controlled\")\n" - ) - endif() - endforeach() - - list(REMOVE_DUPLICATES SHARED_CACHED_MULTI_IMAGE_VARIABLES) - foreach(shared_var ${SHARED_CACHED_MULTI_IMAGE_VARIABLES}) - if(DEFINED CACHE{${shared_var}} AND NOT DEFINED ${ACI_NAME}_${shared_var}) - file( - APPEND - ${preload_file} - "set(${shared_var} \"$CACHE{${shared_var}}\" CACHE INTERNAL \"NCS child image controlled\")\n" - ) - endif() - endforeach() - - # Add FILE_SUFFIX to the preload file if it is set with the specific name of this image - file(APPEND - ${preload_file} - "set(FILE_SUFFIX \"${${ACI_NAME}_FILE_SUFFIX}\" CACHE INTERNAL \"NCS child image controlled\")\n" - ) - - get_cmake_property(VARIABLES VARIABLES) - get_cmake_property(VARIABLES_CACHED CACHE_VARIABLES) - - set(regex "^${ACI_NAME}_.+") - - list(FILTER VARIABLES INCLUDE REGEX ${regex}) - list(FILTER VARIABLES_CACHED INCLUDE REGEX ${regex}) - - set(VARIABLES_ALL ${VARIABLES} ${VARIABLES_CACHED}) - list(REMOVE_DUPLICATES VARIABLES_ALL) - foreach(var_name ${VARIABLES_ALL}) - string(REPLACE "\"" "\\\"" ${var_name} "${${var_name}}") - # This regex is guaranteed to match due to the filtering done - # above, we only re-run the regex to extract the part after - # '_'. We run the regex twice because it is believed that - # list(FILTER is faster than doing a string(REGEX on each item. - string(REGEX MATCH "^${ACI_NAME}_(.+)" unused_out_var ${var_name}) - file( - APPEND - ${preload_file} - "set(${CMAKE_MATCH_1} \"${${var_name}}\" CACHE INTERNAL \"NCS child image controlled\")\n" - ) - endforeach() - endif() - - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${ACI_NAME}) - execute_process( - COMMAND ${CMAKE_COMMAND} - -G${CMAKE_GENERATOR} - ${EXTRA_MULTI_IMAGE_CMAKE_ARGS} # E.g. --trace-expand - -DIMAGE_NAME=${ACI_NAME} - -C ${preload_file} - ${extra_cmake_args} - ${source_dir} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${ACI_NAME} - RESULT_VARIABLE ret - ) - - if (IMAGE_NAME) - # Expose your childrens secrets to your parent - set_shared(FILE ${CMAKE_BINARY_DIR}/${ACI_NAME}/shared_vars.cmake) - endif() - - set_property(DIRECTORY APPEND PROPERTY - CMAKE_CONFIGURE_DEPENDS - ${CMAKE_BINARY_DIR}/${ACI_NAME}/zephyr/.config - ) - - if(NOT ${ret} EQUAL "0") - message(FATAL_ERROR "CMake generation for ${ACI_NAME} failed, aborting. Command: ${ret}") - endif() - - message("=== child image ${ACI_NAME} - ${ACI_DOMAIN}${inherited} end ===\n") - - # Include some variables from the child image into the parent image - # namespace - include(${CMAKE_BINARY_DIR}/${ACI_NAME}/shared_vars.cmake) - - if(MULTI_IMAGE_DEBUG_MAKEFILE AND "${CMAKE_GENERATOR}" STREQUAL "Ninja") - set(multi_image_build_args "-d" "${MULTI_IMAGE_DEBUG_MAKEFILE}") - endif() - if(MULTI_IMAGE_DEBUG_MAKEFILE AND "${CMAKE_GENERATOR}" STREQUAL "Unix Makefiles") - set(multi_image_build_args "--debug=${MULTI_IMAGE_DEBUG_MAKEFILE}") - endif() - - get_shared(${ACI_NAME}_byproducts IMAGE ${ACI_NAME} PROPERTY BUILD_BYPRODUCTS) - - include(ExternalProject) - ExternalProject_Add(${ACI_NAME}_subimage - SOURCE_DIR ${source_dir} - BINARY_DIR ${CMAKE_BINARY_DIR}/${ACI_NAME} - BUILD_BYPRODUCTS ${${ACI_NAME}_byproducts} - CONFIGURE_COMMAND "" - BUILD_COMMAND ${CMAKE_COMMAND} --build . -- ${multi_image_build_args} - INSTALL_COMMAND "" - BUILD_ALWAYS True - USES_TERMINAL_BUILD True - ) - - set_property( - TARGET ${ACI_NAME}_subimage - PROPERTY preload_file - ${preload_file} - ) - - set_property( - TARGET ${ACI_NAME}_subimage - PROPERTY source_dir - ${source_dir} - ) - - set_property( - TARGET ${ACI_NAME}_subimage - PROPERTY binary_dir - ${CMAKE_BINARY_DIR}/${ACI_NAME} - ) - - if (NOT ACI_PRELOAD_IMAGE) - foreach(kconfig_target - menuconfig - guiconfig - ${EXTRA_KCONFIG_TARGETS} - ) - - add_custom_target(${ACI_NAME}_${kconfig_target} - ${CMAKE_MAKE_PROGRAM} ${kconfig_target} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${ACI_NAME} - USES_TERMINAL - ) - endforeach() - endif() - - if (NOT "${ACI_NAME}" STREQUAL "${${ACI_DOMAIN}_PM_DOMAIN_DYNAMIC_PARTITION}") - set_property( - GLOBAL APPEND PROPERTY - PM_IMAGES - "${ACI_NAME}" - ) - endif() - -endfunction() diff --git a/cmake/partition_manager.cmake b/cmake/partition_manager.cmake index 8e331d4a0eee..9c42f86224e7 100644 --- a/cmake/partition_manager.cmake +++ b/cmake/partition_manager.cmake @@ -26,21 +26,7 @@ endmacro() # Load static configuration if found. # Try user defined file first, then file found in configuration directory, # finally file from board directory. -if(SYSBUILD) - zephyr_get(PM_STATIC_YML_FILE SYSBUILD GLOBAL) -elseif(CONFIG_PARTITION_MANAGER_ENABLED) - message(DEPRECATION " - --------------------------------------------------------------------- - --- WARNING: Child and parent image functionality is deprecated --- - --- and should be replaced with sysbuild. Child and parent image --- - --- support remains only to allow existing customer applications --- - --- to build and allow porting to sysbuild, it is no longer --- - --- receiving updates or new features and it will not be possible --- - --- to build using child/parent image at all in nRF Connect SDK --- - --- version 2.9 onwards. --- - ---------------------------------------------------------------------" - ) -endif() +zephyr_get(PM_STATIC_YML_FILE SYSBUILD GLOBAL) if(DEFINED PM_STATIC_YML_FILE) string(CONFIGURE "${PM_STATIC_YML_FILE}" user_def_pm_static) @@ -80,13 +66,6 @@ elseif (EXISTS ${board_dir_pm_static_common}) set(static_configuration_file ${board_dir_pm_static_common}) endif() -if (EXISTS "${static_configuration_file}" AND NOT SYSBUILD) - message(STATUS "Found partition manager static configuration: " - "${static_configuration_file}" - ) - set(static_configuration --static-config ${static_configuration_file}) -endif() - if (NOT static_configuration AND CONFIG_PM_IMAGE_NOT_BUILT_FROM_SOURCE) message(WARNING "One or more child image is not configured to be built from source. \ @@ -97,23 +76,6 @@ if (NOT static_configuration AND CONFIG_PM_IMAGE_NOT_BUILT_FROM_SOURCE) place the image correctly in flash.") endif() -if (NOT static_configuration AND - (CONFIG_BOOTLOADER_MCUBOOT OR CONFIG_SECURE_BOOT) AND NOT SYSBUILD) - message(WARNING " - --------------------------------------------------------------------- - --- WARNING: Using a bootloader without pm_static.yml. --- - --- There are cases where a deployed product can consist of --- - --- multiple images, and only a subset of these images can be --- - --- upgraded through a firmware update mechanism. In such cases, --- - --- the upgradable images must have partitions that are static --- - --- and are matching the partition map used by the bootloader --- - --- programmed onto the device. --- - --------------------------------------------------------------------- - \n" - ) -endif() - - # Check if current image is the dynamic partition in its domain. # I.E. it is the only partition without a statically configured size in this # domain. This is equivalent to the 'app' partition in the root domain. @@ -129,675 +91,3 @@ endif() get_property(PM_IMAGES GLOBAL PROPERTY PM_IMAGES) get_property(PM_SUBSYS_PREPROCESSED GLOBAL PROPERTY PM_SUBSYS_PREPROCESSED) get_property(PM_DOMAINS GLOBAL PROPERTY PM_DOMAINS) - -# This file is executed once per domain. -# -# It will be executed if one of the following criteria is true for the -# current image: -# - It's a child image, and is the dynamic partition in the domain -# - It's the root image, and a static configuration has been provided -# - It's the root image, and PM_IMAGES is populated. -# - It's the root image, and other domains exist. -# - A subsys has defined a partition and CONFIG_PM_SINGLE_IMAGE is set. -# Otherwise, return here -if (NOT ( - (IMAGE_NAME AND is_dynamic_partition_in_domain) OR - (NOT IMAGE_NAME AND static_configuration) OR - (NOT IMAGE_NAME AND PM_IMAGES) OR - (NOT IMAGE_NAME AND PM_DOMAINS) OR - (PM_SUBSYS_PREPROCESSED AND CONFIG_PM_SINGLE_IMAGE) - ) - OR SYSBUILD - ) - return() -endif() - -# Set the dynamic partition. This is the only partition which does not -# have a statically defined size. There is only one dynamic partition per -# domain. For the "root domain" (ie the domain of the root image) this is -# always "app". -if (NOT is_dynamic_partition_in_domain) - set(dynamic_partition "app") -else() - set(dynamic_partition ${${DOMAIN}_PM_DOMAIN_DYNAMIC_PARTITION}) - set( - dynamic_partition_argument - "--flash_primary-dynamic-partition;${dynamic_partition}" - ) -endif() - -# Check if the dynamic partition image hex has already been defined -get_property(DYNAMIC_PARTITION_HEX GLOBAL PROPERTY - ${dynamic_partition}_PM_HEX_FILE - ) -if (NOT DYNAMIC_PARTITION_HEX) - # Add the dynamic partition as an image partition. - set_property(GLOBAL PROPERTY - ${dynamic_partition}_PM_HEX_FILE - ${PROJECT_BINARY_DIR}/${KERNEL_HEX_NAME} - ) -endif() - -get_property(DYNAMIC_PARTITION_TARGET GLOBAL PROPERTY - ${dynamic_partition}_PM_TARGET - ) -if (NOT DYNAMIC_PARTITION_TARGET) - set_property(GLOBAL PROPERTY - ${dynamic_partition}_PM_TARGET - ${logical_target_for_zephyr_elf} - ) -endif() - -# Prepare the input_files, header_files, and images lists -set(generated_path include/generated) -foreach (image ${PM_IMAGES}) - list(APPEND prefixed_images ${DOMAIN}:${image}) - list(APPEND images ${image}) - - get_shared(${image}_input_files IMAGE ${image} PROPERTY PM_YML_FILES) - get_shared(${image}_binary_dir IMAGE ${image} PROPERTY ZEPHYR_BINARY_DIR) - - list(APPEND input_files ${${image}_input_files}) - list(APPEND header_files ${${image}_binary_dir}/${generated_path}/pm_config.h) - - # Re-configure (Re-execute all CMakeLists.txt code) when original - # (not preprocessed) configuration file changes. - get_shared(dependencies IMAGE ${image} PROPERTY PM_YML_DEP_FILES) - set_property( - DIRECTORY APPEND PROPERTY - CMAKE_CONFIGURE_DEPENDS - ${dependencies} - ) -endforeach() - -# Explicitly add the dynamic partition image -list(APPEND prefixed_images "${DOMAIN}:${dynamic_partition}") -list(APPEND images ${dynamic_partition}) -list(APPEND input_files ${ZEPHYR_BINARY_DIR}/${generated_path}/pm.yml) -list(APPEND header_files ${ZEPHYR_BINARY_DIR}/${generated_path}/pm_config.h) - -# Add subsys defined pm.yml to the input_files -list(APPEND input_files ${PM_SUBSYS_PREPROCESSED}) - -if (DEFINED CONFIG_SOC_SERIES_NRF91X) - # See nRF91 Product Specification, chapter "UICR" - set(otp_start_addr "0xff8108") - set(otp_size 756) # 189 * 4 -elseif (DEFINED CONFIG_SOC_NRF5340_CPUAPP) - # See nRF5340 Product Specification, chapter Application Core -> ... "UICR" - set(otp_start_addr "0xff8100") - set(otp_size 764) # 191 * 4 -elseif (DEFINED CONFIG_SOC_NRF54L15_CPUAPP) - set(otp_start_addr "0xffd500") - set(otp_size 1276) # 319 * 4 -endif() - -if (DEFINED CONFIG_SOC_SERIES_NRF54LX) - set(soc_nvs_controller rram_controller) - set(soc_nvs_controller_driver_kc CONFIG_SOC_FLASH_NRF_RRAM) -else() - set(soc_nvs_controller flash_controller) - set(soc_nvs_controller_driver_kc CONFIG_SOC_FLASH_NRF) -endif() - -add_region( - NAME sram_primary - SIZE ${CONFIG_PM_SRAM_SIZE} - BASE ${CONFIG_PM_SRAM_BASE} - PLACEMENT complex - DYNAMIC_PARTITION sram_primary - ) - -math(EXPR flash_size "${CONFIG_FLASH_SIZE} * 1024" OUTPUT_FORMAT HEXADECIMAL) - -if (CONFIG_SOC_SERIES_NRF91X OR CONFIG_SOC_NRF5340_CPUAPP OR CONFIG_SOC_NRF54L15_CPUAPP) - add_region( - NAME otp - SIZE ${otp_size} - BASE ${otp_start_addr} - PLACEMENT start_to_end - ) -endif() -add_region( - NAME flash_primary - SIZE ${flash_size} - BASE ${CONFIG_FLASH_BASE_ADDRESS} - PLACEMENT complex - DEVICE ${soc_nvs_controller} - DEFAULT_DRIVER_KCONFIG ${soc_nvs_controller_driver_kc} - ) - -dt_chosen(ext_flash_dev PROPERTY nordic,pm-ext-flash) -if (DEFINED ext_flash_dev) - dt_prop(num_bits PATH ${ext_flash_dev} PROPERTY size) - math(EXPR num_bytes "${num_bits} / 8") - - set(external_flash_driver_kconfig CONFIG_PM_EXTERNAL_FLASH_HAS_DRIVER) - - add_region( - NAME external_flash - SIZE ${num_bytes} - BASE ${CONFIG_PM_EXTERNAL_FLASH_BASE} - PLACEMENT start_to_end - DEVICE "DT_CHOSEN(nordic_pm_ext_flash)" - DEFAULT_DRIVER_KCONFIG ${external_flash_driver_kconfig} - ) -endif() - -# If simultaneous updates of the network core and application core is supported -# we add a region which is used to emulate flash. In reality this data is being -# placed in RAM. This is used to bank the network core update in RAM while -# the application core update is banked in flash. This works since the nRF53 -# application core has 512kB of RAM and the network core only has 256kB of flash -get_shared( - mcuboot_NRF53_MULTI_IMAGE_UPDATE - IMAGE mcuboot - PROPERTY NRF53_MULTI_IMAGE_UPDATE - ) - -get_shared( - mcuboot_NRF53_RECOVERY_NETWORK_CORE - IMAGE mcuboot - PROPERTY NRF53_RECOVERY_NETWORK_CORE - ) - -if ((DEFINED mcuboot_NRF53_MULTI_IMAGE_UPDATE) OR (DEFINED mcuboot_NRF53_RECOVERY_NETWORK_CORE)) - # This region will contain the 'mcuboot_secondary' partition, and the banked - # updates for the network core will be stored here. - get_shared(ram_flash_label IMAGE mcuboot PROPERTY RAM_FLASH_LABEL) - get_shared(ram_flash_addr IMAGE mcuboot PROPERTY RAM_FLASH_ADDR) - get_shared(ram_flash_size IMAGE mcuboot PROPERTY RAM_FLASH_SIZE) - - add_region( - NAME ram_flash - SIZE ${ram_flash_size} - BASE ${ram_flash_addr} - PLACEMENT start_to_end - DEVICE ${ram_flash_label} - DEFAULT_DRIVER_KCONFIG CONFIG_FLASH_SIMULATOR - ) -endif() - -if (DOMAIN) - set(UNDERSCORE_DOMAIN _${DOMAIN}) -endif() - -set(pm_out_partition_file ${APPLICATION_BINARY_DIR}/partitions${UNDERSCORE_DOMAIN}.yml) -set(pm_out_region_file ${APPLICATION_BINARY_DIR}/regions${UNDERSCORE_DOMAIN}.yml) -set(pm_out_dotconf_file ${APPLICATION_BINARY_DIR}/pm${UNDERSCORE_DOMAIN}.config) - -set(pm_cmd - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/partition_manager.py - --input-files ${input_files} - --regions ${regions} - --output-partitions ${pm_out_partition_file} - --output-regions ${pm_out_region_file} - ${dynamic_partition_argument} - ${static_configuration} - ${region_arguments} - ) - -set(pm_output_cmd - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/partition_manager_output.py - --input-partitions ${pm_out_partition_file} - --input-regions ${pm_out_region_file} - --config-file ${pm_out_dotconf_file} - ) - -# Run the partition manager algorithm. -execute_process( - COMMAND - ${pm_cmd} - RESULT_VARIABLE ret - ) - -if(NOT ${ret} EQUAL "0") - message(FATAL_ERROR "Partition Manager failed, aborting. Command: ${pm_cmd}") -endif() - -# Produce header files and config file. -execute_process( - COMMAND - ${pm_output_cmd} - RESULT_VARIABLE ret - ) - -if(NOT ${ret} EQUAL "0") - message(FATAL_ERROR "Partition Manager output generation failed, aborting. Command: ${pm_output_cmd}") -endif() - -# Create a dummy target that we can add properties to for -# extraction in generator expressions. -add_custom_target(partition_manager) - -# Make Partition Manager configuration available in CMake -import_pm_config(${pm_out_dotconf_file} pm_var_names) - -foreach(name ${pm_var_names}) - set_property( - TARGET partition_manager - PROPERTY ${name} - ${${name}} - ) -endforeach() - -# Turn the space-separated list into a Cmake list. -string(REPLACE " " ";" PM_ALL_BY_SIZE ${PM_ALL_BY_SIZE}) - -# Iterate over every partition, from smallest to largest. -foreach(part ${PM_ALL_BY_SIZE}) - string(TOUPPER ${part} PART) - get_property(${part}_PM_HEX_FILE GLOBAL PROPERTY ${part}_PM_HEX_FILE) - get_property(${part}_PM_ELF_FILE GLOBAL PROPERTY ${part}_PM_ELF_FILE) - - # Process container partitions (if it has a SPAN list it is a container partition). - if(DEFINED PM_${PART}_SPAN) - string(REPLACE " " ";" PM_${PART}_SPAN ${PM_${PART}_SPAN}) - list(APPEND containers ${part}) - endif() - - # Include the partition in the merge operation if it has a hex file. - if(DEFINED ${part}_PM_HEX_FILE) - get_property(${part}_PM_TARGET GLOBAL PROPERTY ${part}_PM_TARGET) - list(APPEND explicitly_assigned ${part}) - else() - if(${part} IN_LIST images) - get_shared(${part}_bin_dir IMAGE ${part} PROPERTY ZEPHYR_BINARY_DIR) - get_shared(${part}_hex_file IMAGE ${part} PROPERTY KERNEL_HEX_NAME) - get_shared(${part}_elf_file IMAGE ${part} PROPERTY KERNEL_ELF_NAME) - set(${part}_PM_HEX_FILE ${${part}_bin_dir}/${${part}_hex_file}) - set(${part}_PM_ELF_FILE ${${part}_bin_dir}/${${part}_elf_file}) - set(${part}_PM_TARGET ${part}_subimage) - elseif(${part} IN_LIST containers) - set(${part}_PM_HEX_FILE ${PROJECT_BINARY_DIR}/${part}.hex) - set(${part}_PM_TARGET ${part}_hex) - endif() - list(APPEND implicitly_assigned ${part}) - endif() -endforeach() - -if (${is_dynamic_partition_in_domain}) - set(merged_suffix _${DOMAIN}) - string(TOUPPER ${merged_suffix} MERGED_SUFFIX) -endif() -set(merged merged${merged_suffix}) -set(MERGED MERGED${MERGED_SUFFIX}) - -set(PM_${MERGED}_SPAN ${implicitly_assigned} ${explicitly_assigned}) -set(${merged}_overlap TRUE) # Enable overlapping for the merged hex file. - -# Iterate over all container partitions, plus the "fake" merged paritition. -# The loop will create a hex file for each iteration. -foreach(container ${containers} ${merged}) - string(TOUPPER ${container} CONTAINER) - - # Prepare the list of hex files and list of dependencies for the merge command. - foreach(part ${PM_${CONTAINER}_SPAN}) - string(TOUPPER ${part} PART) - list(APPEND ${container}hex_files ${${part}_PM_HEX_FILE}) - list(APPEND ${container}elf_files ${${part}_PM_ELF_FILE}) - list(APPEND ${container}targets ${${part}_PM_TARGET}) - endforeach() - - # Do not merge hex files for empty partitions - if(NOT ${container}hex_files) - list(REMOVE_ITEM PM_${MERGED}_SPAN ${container}) - continue() - endif() - - # If overlapping is enabled, add the appropriate argument. - if(${${container}_overlap}) - set(${container}overlap_arg --overlap=replace) - endif() - - # Add command to merge files. - add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/${container}.hex - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${PROJECT_BINARY_DIR}/${container}.hex - ${${container}overlap_arg} - ${${container}hex_files} - DEPENDS - ${${container}targets} - ${${container}hex_files} - # SES will load symbols from all elf files listed as dependencies to - # ${PROJECT_BINARY_DIR}/merged.hex. Therefore we add - # ${${container}elf_files} as dependency to ensure they are loaded by SES - # even though it is unnecessary for building the application. - ${${container}elf_files} - ) - - # Wrapper target for the merge command. - add_custom_target( - ${container}_hex - ALL DEPENDS - ${PROJECT_BINARY_DIR}/${container}.hex - ) - -endforeach() - -if (CONFIG_SECURE_BOOT AND CONFIG_BOOTLOADER_MCUBOOT) - # Create symbols for the offsets required for moving test update hex files - # to MCUBoots secondary slot. This is needed because objcopy does not - # support arithmetic expressions as argument (e.g. '0x100+0x200'), and all - # of the symbols used to generate the offset is only available as a - # generator expression when MCUBoots cmake code exectues. This because - # partition manager is performed as the last step in the configuration stage. - if(CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY AND CONFIG_HAS_HW_NRF_QSPI) - if(DEFINED ext_flash_dev) - get_filename_component(qspi_node ${ext_flash_dev} DIRECTORY) - else() - dt_nodelabel(qspi_node NODELABEL "qspi") - endif() - if(DEFINED qspi_node) - dt_reg_addr(xip_addr PATH ${qspi_node} NAME qspi_mm) - if(NOT DEFINED xip_addr) - message(WARNING "\ - Could not find memory mapped address for XIP. Generated update hex files will \ - not have the correct base address. Hence they can not be programmed directly \ - to the external flash") - endif() - endif() - else() - set(xip_addr 0) - endif() - - math(EXPR s0_offset "${xip_addr} + ${PM_MCUBOOT_SECONDARY_ADDRESS} - ${PM_S0_ADDRESS}") - math(EXPR s1_offset "${xip_addr} + ${PM_MCUBOOT_SECONDARY_ADDRESS} - ${PM_S1_ADDRESS}") - - set_property( - TARGET partition_manager - PROPERTY s0_TO_SECONDARY - ${s0_offset} - ) - set_property( - TARGET partition_manager - PROPERTY s1_TO_SECONDARY - ${s1_offset} - ) -endif() - -# Calculate absolute address for the wi-fi firmware patch location. -if (CONFIG_WIFI_NRF70 AND CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE) - if(DEFINED ext_flash_dev) - get_filename_component(qspi_node ${ext_flash_dev} DIRECTORY) - else() - dt_nodelabel(qspi_node NODELABEL "qspi") - endif() - if(DEFINED qspi_node) - dt_reg_addr(xip_addr PATH ${qspi_node} NAME qspi_mm) - if(NOT DEFINED xip_addr) - message(WARNING "\ - Could not find memory mapped address for XIP. Generated update hex files will \ - not have the correct base address. Hence they can not be programmed directly \ - to the external flash") - endif() - else() - set(xip_addr 0) - endif() - - math(EXPR wifi_fw_abs_addr "${xip_addr} + ${PM_NRF70_WIFI_FW_OFFSET}") - set_property( - TARGET partition_manager - PROPERTY nrf70_wifi_fw_XIP_ABS_ADDR - ${wifi_fw_abs_addr} - ) -endif() - -if (is_dynamic_partition_in_domain) - # We are being built as sub image. - # Expose the generated partition manager configuration files to parent image. - # This is used by the root image to create the global configuration in - # pm_config.h. - set_shared(IMAGE ${DOMAIN} PROPERTY PM_DOMAIN_PARTITIONS ${pm_out_partition_file}) - set_shared(IMAGE ${DOMAIN} PROPERTY PM_DOMAIN_REGIONS ${pm_out_region_file}) - set_shared(IMAGE ${DOMAIN} PROPERTY PM_DOMAIN_HEADER_FILES ${header_files}) - set_shared(IMAGE ${DOMAIN} PROPERTY PM_DOMAIN_IMAGES ${prefixed_images}) - set_shared(IMAGE ${DOMAIN} PROPERTY PM_HEX_FILE ${PROJECT_BINARY_DIR}/${merged}.hex) - set_shared(IMAGE ${DOMAIN} PROPERTY PM_DOTCONF_FILES ${pm_out_dotconf_file}) - set_shared(IMAGE ${DOMAIN} PROPERTY PM_APP_HEX ${PROJECT_BINARY_DIR}/app.hex) - set_shared(IMAGE ${IMAGE_NAME} APPEND PROPERTY BUILD_BYPRODUCTS ${PROJECT_BINARY_DIR}/${merged}.hex) - if(CONFIG_SECURE_BOOT) - # Only when secure boot is enabled the app will be signed. - set_shared(IMAGE ${DOMAIN} PROPERTY PM_SIGNED_APP_HEX ${PROJECT_BINARY_DIR}/signed_by_b0_app.hex) - endif() -else() - # This is the root image, generate the global pm_config.h - # First, include the shared properties for all child images. - if (PM_DOMAINS) - # We ensure the existence of PM_DOMAINS to support older cmake versions. - # When version >= 3.17 is required this check can be removed. - list(REMOVE_DUPLICATES PM_DOMAINS) - endif() - foreach (d ${PM_DOMAINS}) - # Don't include shared vars from own domain. - if (NOT ("${DOMAIN}" STREQUAL "${d}")) - get_shared(shared_header_files IMAGE ${d} PROPERTY PM_DOMAIN_HEADER_FILES) - get_shared(shared_prefixed_images IMAGE ${d} PROPERTY PM_DOMAIN_IMAGES) - get_shared(shared_pm_out_partition_file IMAGE ${d} PROPERTY PM_DOMAIN_PARTITIONS) - get_shared(shared_pm_out_region_file IMAGE ${d} PROPERTY PM_DOMAIN_REGIONS) - get_shared(shared_domain_hex_files IMAGE ${d} PROPERTY PM_HEX_FILE) - - list(APPEND header_files ${shared_header_files}) - list(APPEND prefixed_images ${shared_prefixed_images}) - list(APPEND pm_out_partition_file ${shared_pm_out_partition_file}) - list(APPEND pm_out_region_file ${shared_pm_out_region_file}) - list(APPEND domain_hex_files ${shared_domain_hex_files}) - list(APPEND global_hex_depends ${${d}_PM_DOMAIN_DYNAMIC_PARTITION}_subimage) - - # Add domain prefix cmake variables for all partitions - # Here, we actually overwrite the already imported pm.config values - # for our own domain. This is not an issue since all of these variables - # are accessed through the 'partition_manager' target, and most likely - # through generator expression, as this file is one of the last - # cmake files executed in the configure stage. - get_shared(conf_file IMAGE ${d} PROPERTY PM_DOTCONF_FILES) - import_pm_config(${conf_file} ${d}_pm_var_names) - - foreach(name ${${d}_pm_var_names}) - set_property( - TARGET partition_manager - PROPERTY ${d}_${name} - ${${name}} - ) - endforeach() - endif() - endforeach() - - if (CONFIG_BOOTLOADER_MCUBOOT) - if (CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY AND CONFIG_HAS_HW_NRF_QSPI) - # First we see if an ext flash dev has been chosen, if not, then we look - # up the 'qspi' node and assume that this has the required address. - if (DEFINED ext_flash_dev) - get_filename_component(qspi_node ${ext_flash_dev} DIRECTORY) - else() - dt_nodelabel(qspi_node NODELABEL "qspi") - endif() - - # If the qspi node is still not defined we are building on a platform - # which does not have the qspi peripheral, in which case no hex files - # will be generated for the secondary slot. - if(DEFINED qspi_node) - dt_reg_addr(xip_addr PATH ${qspi_node} NAME qspi_mm) - if(NOT DEFINED xip_addr) - message(WARNING "\ -Could not find memory mapped address for XIP. Generated update hex files will \ -not have the correct base address. Hence they can not be programmed directly \ -to the external flash") - endif() - endif() - endif() - - # Create symbols for the offset required for moving the signed network - # core application to MCUBoots secondary slot. This is needed - # because objcopy does not support arithmetic expressions as argument - # (e.g. '0x100+0x200'), and all of the symbols used to generate the - # offset are only available as a generator expression when MCUBoots - # cmake code executes. - - # Check if a signed version of the network core application is defined. - # If so, this indicates that we need to support firmware updates on the - # network core. This again means that we should generate the required - # hex files. - get_shared(cpunet_signed_app_hex IMAGE CPUNET PROPERTY PM_SIGNED_APP_HEX) - - if (CONFIG_NRF53_UPGRADE_NETWORK_CORE - AND DEFINED cpunet_signed_app_hex) - # The address coming from other domains are not available in this scope - # since it is imported by a different domain. Hence, it must be fetched - # through the 'partition_manager' target. - get_target_property(net_app_addr partition_manager CPUNET_PM_APP_ADDRESS) - - get_shared( - mcuboot_NRF53_MULTI_IMAGE_UPDATE - IMAGE mcuboot - PROPERTY NRF53_MULTI_IMAGE_UPDATE - ) - - # Check if multi image updates are enabled, in which case we need - # to use the "_1" variant of the secondary partition for the network core. - if(DEFINED mcuboot_NRF53_MULTI_IMAGE_UPDATE) - set(sec_slot_idx "_1") - endif() - - # Calculate the offset from the address which the net/app core app is linked - # against to the secondary slot. We need these values to generate hex files - # which targets the secondary slot. - math(EXPR net_app_to_secondary - "${xip_addr} \ - + ${PM_MCUBOOT_SECONDARY${sec_slot_idx}_ADDRESS} \ - - ${net_app_addr} \ - + ${PM_MCUBOOT_PAD_SIZE}" - ) - - set_property( - TARGET partition_manager - PROPERTY net_app_TO_SECONDARY - ${net_app_to_secondary} - ) - - # This value is needed by `imgtool.py` which is used to sign the images. - set_property( - TARGET partition_manager - PROPERTY net_app_slot_size - ${PM_MCUBOOT_SECONDARY${sec_slot_idx}_SIZE} - ) - endif() - - math(EXPR app_to_secondary - "${xip_addr} \ - + ${PM_MCUBOOT_SECONDARY_ADDRESS} \ - - ${PM_MCUBOOT_PRIMARY_ADDRESS}" - ) - - set_property( - TARGET partition_manager - PROPERTY app_TO_SECONDARY - ${app_to_secondary} - ) - endif() - - # Explicitly add the root image domain hex file to the list - list(APPEND domain_hex_files ${PROJECT_BINARY_DIR}/${merged}.hex) - list(APPEND global_hex_depends ${merged}_hex) - - # Now all partition manager configuration from all images and domains are - # available. Generate the global pm_config.h, and provide it to all images. - set(pm_global_output_cmd - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/partition_manager_output.py - --input-partitions ${pm_out_partition_file} - --input-regions ${pm_out_region_file} - --header-files ${header_files} - --images ${prefixed_images} - ) - - execute_process( - COMMAND - ${pm_global_output_cmd} - RESULT_VARIABLE ret - ) - - if(NOT ${ret} EQUAL "0") - message(FATAL_ERROR "Partition Manager GLOBAL output generation failed, - aborting. Command: ${pm_global_output_cmd}") - endif() - - set_property( - TARGET partition_manager - PROPERTY PM_CONFIG_FILES - ${pm_out_partition_file} - ) - - set_property( - TARGET partition_manager - PROPERTY PM_DEPENDS - ${global_hex_depends} - ) - - add_custom_target( - partition_manager_report - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/partition_manager_report.py - --input ${pm_out_partition_file} - COMMAND_EXPAND_LISTS - ) - - if (PM_DOMAINS) - # For convenience, generate global hex file containing all domains' hex - # files. - set(merged_domains merged_domains) - set(final_merged ${ZEPHYR_BINARY_DIR}/${merged_domains}.hex) - - # Add command to merge files. - add_custom_command( - OUTPUT ${final_merged} - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${final_merged} - ${domain_hex_files} - DEPENDS - ${domain_hex_files} - ${global_hex_depends} - ) - - # Wrapper target for the merge command. - add_custom_target(merged_domains_hex ALL DEPENDS ${final_merged}) - endif() - - set(ZEPHYR_RUNNER_CONFIG_KERNEL_HEX "${final_merged}" - CACHE STRING "Path to merged image in Intel Hex format" FORCE) - -endif() - -# We need to tell the flash runner use the merged hex file instead of -# 'zephyr.hex'This is typically done by setting the 'hex_file' property of the -# 'runners_yaml_props_target' target. However, since the CMakeLists.txt file -# reading those properties has already run, and the 'hex_file' property -# is not evaluated in a generator expression, it is too late at this point to -# set that variable. Hence we must operate on the 'yaml_contents' property, -# which is evaluated in a generator expression. - -if (merged_domains) - # Multiple domains are included in the build, point to the result of - # merging the merged hex file for all domains. - set(merged_hex_to_flash ${merged_domains}.hex) -else() - set(merged_hex_to_flash ${merged}.hex) -endif() - -get_target_property(runners_content runners_yaml_props_target yaml_contents) - -string(REGEX REPLACE "hex_file:[^\n]*" - "hex_file: ${merged_hex_to_flash}" runners_content_updated_hex_file ${runners_content}) - -set_property( - TARGET runners_yaml_props_target - PROPERTY yaml_contents ${runners_content_updated_hex_file} - ) diff --git a/cmake/sysbuild/lwm2m_carrier_divided_dfu.cmake b/cmake/sysbuild/lwm2m_carrier_divided_dfu.cmake index 4d19e3f0a6e9..9487589f3b11 100644 --- a/cmake/sysbuild/lwm2m_carrier_divided_dfu.cmake +++ b/cmake/sysbuild/lwm2m_carrier_divided_dfu.cmake @@ -30,6 +30,4 @@ function(lwm2m_carrier_divided_dfu) ) endfunction(lwm2m_carrier_divided_dfu) -if(SYSBUILD) - lwm2m_carrier_divided_dfu() -endif() +lwm2m_carrier_divided_dfu() diff --git a/doc/nrf/app_dev/config_and_build/multi_image.rst b/doc/nrf/app_dev/config_and_build/multi_image.rst deleted file mode 100644 index 5292c17eb22d..000000000000 --- a/doc/nrf/app_dev/config_and_build/multi_image.rst +++ /dev/null @@ -1,412 +0,0 @@ -.. _ug_multi_image: - -Multi-image builds using child and parent images -################################################ - -.. contents:: - :local: - :depth: 2 - -.. caution:: - |sysbuild_related_deprecation_note| - -The firmware programmed to a device can be composed of either one application or several separate images. -In the latter case, the *parent* :term:`image file` requires one or more other images (the *child images*) to be present. -The child image then *chain-loads*, or *boots*, the parent image, which could also be a child image to another parent image, and boots that one. - -The most common use cases for builds composed of multiple images are applications that require a bootloader to be present or applications for multi-core CPUs. - -Using multiple images has the following advantages: - -* You can run the linker multiple times and partition the final firmware into several regions. - This partitioning is often useful for bootloaders. -* Since there is a symbol table for each image, the same symbol names can exist multiple times in the final firmware. - This is useful for bootloader images, which can require their own copy of a library that the application uses, but in a different version or configuration. -* In multi-core builds, the :term:`build configuration` of a child image in a separate core can be made known to the parent image. - -For the list of image files output by the build system for the multi-image builds, refer to :ref:`app_build_output_files` page. - -.. _ug_multi_image_when_to_use_images: - -When to use multiple images -*************************** - -In the |NCS|, multiple images are required in the following scenarios: - -First-stage and second-stage bootloaders - The first-stage bootloader establishes a root of trust by verifying the next step in the boot sequence. - This first-stage bootloader is immutable, which means it cannot be updated or deleted. - If a second-stage bootloader is present, then the first-stage bootloader is responsible for booting and updating the second-stage bootloader, which in turn is responsible for booting and updating the application. - As such, the first-stage bootloader, the second-stage bootloader, and the application must be located in different images. - In this scenario, the application is the parent image and the bootloaders are two separate child images. - - See :ref:`ug_bootloader` and :ref:`ug_bootloader_adding` for more information. - -nRF5340 development kit support - The nRF5340 development kit (DK) contains two separate processors: a network core and an application core. - When programming an application for the nRF5340 DK, the application must be divided into at least two images, one for each core. - - See :ref:`ug_nrf5340` for more information. - -nRF5340 Audio development kit support - The nRF5340 Audio development kit (DK) is based on the nRF5340 development kit and also contains two separate processors. - When programming an application for the nRF5340 Audio DK, the application core image is built from a combination of different configuration files. - The network core image is programmed with an application-specific precompiled Bluetooth Low Energy Controller binary file that contains the LE Audio Controller Subsystem for nRF53. - - See the documentation for :ref:`nrf53_audio_app` for more information. - -.. _ug_multi_image_default_config: - -Default configuration -********************* - -The |NCS| samples are set up to build all related images as one solution, starting from the parent image. -This is referred to as a *multi-image build*. - -When building the parent image, you can configure how the child image should be handled: - -* Build the child image from the source and include it with the parent image. - This is the default setting. -* Use a prebuilt HEX file of the child image and include it with the parent image. -* Ignore the child image. - -When building the child image from the source or using a prebuilt HEX file, the build system merges the HEX files of both the parent and child image, so that they can be programmed in one single step. -This means that you can enable and integrate an additional image just by using the default configuration. - -To change the default configuration and configure how a child image is handled, locate the ``BUILD_STRATEGY`` Kconfig options for the child image in the parent image configuration. -For example, to use a prebuilt HEX file of the MCUboot instead of building it, select :kconfig:option:`CONFIG_MCUBOOT_BUILD_STRATEGY_USE_HEX_FILE` instead of the default :kconfig:option:`CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE`, and specify the HEX file in :kconfig:option:`CONFIG_MCUBOOT_HEX_FILE`. -To ignore an MCUboot child image, select :kconfig:option:`CONFIG_MCUBOOT_BUILD_STRATEGY_SKIP_BUILD` instead of :kconfig:option:`CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE`. - -.. _ug_multi_image_defining: - -Defining and enabling a child image -*********************************** - -You can enable existing child images in the |NCS| by enabling the respective modules in the parent image and selecting the desired build strategy. - -To turn an application that you have implemented into a child image that can be included in a parent image, you must update the build scripts to enable the child image and add the required configuration options. -You should also know how image-specific variables are disambiguated and what targets of the child images are available. - -.. _ug_multi_image_build_scripts: - -Updating the build scripts -========================== - -To make it possible to enable a child image from a parent image, you must include the child image in the build script. -If you need to perform this operation out-of-tree (that is, without modifying |NCS| code), or from the top-level CMakeLists.txt in your sample, see :ref:`ug_multi_image_add_child_image_oot`. - -To do so, place the code from the following example in the CMake tree that is conditional on a configuration option. -In the |NCS|, the code is included in the :file:`CMakeLists.txt` file for the samples, and in the MCUboot repository. - -.. code-block:: cmake - - if (CONFIG_SECURE_BOOT) - add_child_image( - NAME b0 - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/bootloader - ) - endif() - - if (CONFIG_BOOTLOADER_MCUBOOT) - add_child_image( - NAME mcuboot - SOURCE_DIR ${MCUBOOT_DIR}/boot/zephyr - ) - endif() - -In this code, ``add_child_image`` registers the child image with the given name and file path and executes the build scripts of the child image. -Note that both the child image's application build scripts and the core build scripts are executed. -The core build scripts might use a different configuration and possibly different devicetree settings. - -If you have to execute a child image on a different core, you must specify the namespace for the child image as *domain* when adding the child image. -See the following example: - -.. code-block:: cmake - - add_child_image( - NAME hci_ipc - SOURCE_DIR ${ZEPHYR_BASE}/samples/bluetooth/hci_ipc - DOMAIN CPUNET - ) - -A *domain* is well-defined if there is the ``CONFIG_DOMAIN_${DOMAIN}_BOARD`` configuration option in Kconfig. - -.. _ug_multi_image_add_child_image_oot: - -Adding a child image using Zephyr modules -========================================= - -Any call to ``add_child_image`` must be done *after* :file:`nrf/cmake/extensions.cmake` is invoked, but *before* :file:`multi_image.cmake` is invoked. -In some scenarios, this is not possible without modifying the |NCS| build code, for example, from top-level sample files and project :file:`CMakeLists.txt` files. - -To avoid this issue, use the *Modules* mechanism provided by the Zephyr build system. -The following example shows how to add the required module from a top-level sample :file:`CMakeLists.txt`. - -.. code-block:: cmake - - cmake_minimum_required(VERSION 3.20.0) - - set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}) - - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - project(app) - - target_sources(app PRIVATE src/main.c) - -A :file:`zephyr/module.yml` file is needed at the base of the added module. -The following example specifies only the path to the :file:`CMakeLists.txt` of the new module. -See :ref:`modules` for more details. - -.. code-block:: - - build: - cmake: aci - -The :file:`CMakeLists.txt` located in the directory pointed to by :file:`zephyr/module.yml` will be invoked when ``add_child_image`` can be invoked. - -.. code-block:: cmake - - add_child_image( - NAME remote - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../remote - DOMAIN remote - BOARD ${CONFIG_APP_REMOTE_BOARD} - ) - -Adding configuration options -============================ - -When enabling a child image, you must select the build strategy to define how the image should be included. -The following three options are available: - -* ``_BUILD_STRATEGY_FROM_SOURCE`` - Build the child image from source along with the parent image. -* ``_BUILD_STRATEGY_USE_HEX_FILE`` - Merge the specified HEX file of the child image with the parent image, using ``_HEX_FILE`` to specify the HEX file. -* ``_BUILD_STRATEGY_SKIP_BUILD`` - Ignore the child image when building and build only the parent image. - -.. note:: - - Child images that are built with the build strategy ``_BUILD_STRATEGY_SKIP_BUILD`` or ``_BUILD_STRATEGY_USE_HEX_FILE`` must define a :ref:`static partition `. - -Add these configuration options to the Kconfig file of your child image, replacing ```` with the uppercase name of your child image that is specified in ``add_child_image``. -To do this, include the :file:`Kconfig.template.build_strategy` template as follows: - -.. code-block:: Kconfig - - module=MCUBOOT - source "${ZEPHYR_NRF_MODULE_DIR}/subsys/partition_manager/Kconfig.template.build_strategy" - -.. _ug_multi_image_variables: - -Image-specific variables -======================== - -The child and parent images are executed in different CMake processes and thus have different namespaces. - -Variables in the parent image are not propagated to the child image, with the following exceptions: - -* Any variable named ``_VARIABLEONE`` in a parent image is propagated to the child image named ```` as ``VARIABLEONE``. - See `Temporary variables in child images`_ for more information. -* CMake build settings, such as ``BOARD_DIR``, build type, toolchain info, partition manager info, and similar are always passed to child images. - See `Permanent configuration changes to child images`_ for more information. - -Using these two exceptions, you can set variables in child images from either parent images or the command line, and you can also set variables globally across all images. - -.. _ug_multi_image_variables_fragments: - -Temporary variables in child images ------------------------------------ - -It is possible to provide variables to the child images. -These variables will be valid until you :ref:`clean the build directory pristinely `. - -For example, to change the ``VARIABLEONE`` variable for the ``childimageone`` child image and the parent image, specify the CMake command as follows: - - .. parsed-literal:: - :class: highlight - - cmake -D\ *childimageone*\_\ *VARIABLEONE*\=value -D\ *VARIABLEONE*\=value - -You can extend the CMake command used to create the child images by adding flags to the CMake variable ``EXTRA_MULTI_IMAGE_CMAKE_ARGS``. -For example, add ``--trace-expand`` to that variable to output more debug information. - -With west, you can pass these configuration variables into CMake by using the ``--`` separator: - - .. code-block:: console - - west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ - -Dmcuboot_CONF_FILE=prj_a.conf \ - -DCONF_FILE=app_prj.conf - -Child image Kconfig modification -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It is possible to provide Kconfig configuration for child images, either as individual settings or using Kconfig fragments. -Each child image is referenced using its image name. - -These temporary settings will be valid until you :ref:`clean the build directory pristinely `. - -The following example sets the configuration option ``CONFIG_VARIABLEONE=val`` in the child image ``childimageone``: - - .. parsed-literal:: - :class: highlight - - cmake -D\ *childimageone*\_\ *CONFIG_VARIABLEONE=val*\ [...] - -You can add a Kconfig fragment to the child image default configuration in a similar way. -The following example adds an extra Kconfig fragment ``extrafragment.conf`` to ``childimageone``: - - .. parsed-literal:: - :class: highlight - - cmake -D\ *childimageone*\_EXTRA_CONF_FILE=\ *extrafragment.conf*\ [...] - -It is also possible to provide a custom configuration file as a replacement for the default Kconfig file for the child image. -The following example uses the custom configuration file ``myfile.conf`` when building ``childimageone``: - - .. parsed-literal:: - :class: highlight - - cmake -D\ *childimageone*\_CONF_FILE=\ *myfile.conf*\ [...] - -If your application includes multiple child images, then you can combine all the above as follows: - -* Setting ``CONFIG_VARIABLEONE=val`` in the main application. -* Adding a Kconfig fragment ``extrafragment.conf`` to the ``childimageone`` child image, using ``-Dchildimageone_EXTRA_CONF_FILE=extrafragment.conf``. -* Using ``myfile.conf`` as configuration for the ``quz`` child image, using ``-Dquz_CONF_FILE=myfile.conf``. - - .. parsed-literal:: - :class: highlight - - cmake -DCONFIG_VARIABLEONE=val -D\ *childimageone*\_EXTRA_CONF_FILE=\ *extrafragment.conf*\ -Dquz_CONF_FILE=\ *myfile.conf*\ [...] - -See :ref:`ug_bootloader` for more details. - -.. note:: - - The build system grabs the Kconfig fragment or configuration file specified in a CMake argument relative to that image's application directory. - For example, the build system uses ``nrf/samples/bootloader/my-fragment.conf`` when building with the ``-Db0_EXTRA_CONF_FILE=my-fragment.conf`` option, whereas ``-DEXTRA_CONF_FILE=my-fragment.conf`` grabs the fragment from the main application's directory, such as ``zephyr/samples/hello_world/my-fragment.conf``. - -You can also merge multiple fragments into the overall configuration for an image by giving a list of Kconfig fragments as a string, separated using ``;``. -The following example shows how to combine ``abc.conf``, Kconfig fragment of the ``childimageone`` child image, with the ``extrafragment.conf`` fragment: - - .. parsed-literal:: - :class: highlight - - cmake -D\ *childimageone*\_EXTRA_CONF_FILE='\ *extrafragment.conf*\;\ *abc.conf*\' - -When the build system finds the fragment, it outputs their merge during the CMake build output as follows: - -.. parsed-literal:: - :class: highlight - - ... - Merged configuration '\ *extrafragment.conf*\' - Merged configuration '\ *abc.conf*\' - ... - -Child image devicetree modification -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can provide devicetree overlays for a child image using ``*.overlay`` files. - -The following example sets the devicetree overlay ``extra.overlay`` to ``childimageone``: - -.. parsed-literal:: - :class: highlight - - cmake -D\ *childimageone*\_DTC_OVERLAY_FILE='\ *extra.overlay*\' - -The build system does also automatically apply any devicetree overlay located in the ``child_image`` folder and named as follows (where ``ACI_NAME`` is the name of the child image): - -* ``child_image/.overlay`` -* ``child_image//.overlay`` -* ``child_image//_.overlay`` -* ``child_image//boards/.overlay`` -* ``child_image//boards/_.overlay`` - -.. note:: - - The build system grabs the devicetree overlay files specified in a CMake argument relative to that image's application directory. - For example, the build system uses ``nrf/samples/bootloader/my-dts.overlay`` when building with the ``-Db0_DTC_OVERLAY_FILE=my-dts.overlay`` option, whereas ``-DDTC_OVERLAY_FILE=my-dts.overlay`` grabs the fragment from the main application's directory, such as ``zephyr/samples/hello_world/my-dts.overlay``. - -.. _ug_multi_image_permanent_changes: - -Permanent configuration changes to child images ------------------------------------------------ - -You can make a project automatically pass Kconfig configuration files, fragments, and devicetree overlays to child images by placing them under a predefined path. -For example, in the |NCS| applications and samples that use different :ref:`build types `, the :file:`child_image` folder in the application source directory is often used to apply :ref:`permanent configuration changes `. - -The listing below describes how to leverage this functionality, where ``ACI_NAME`` is the name of the child image to which the configuration will be applied. - -.. literalinclude:: ../../../../cmake/multi_image.cmake - :language: c - :start-at: It is possible for a sample to use a custom set of Kconfig fragments for a - :end-before: set(ACI_CONF_DIR ${config_dir}/child_image) - -When you are using :ref:`app_build_additions_build_types` and the configuration name has been inferred, the child image Kconfig overlay file is searched at :file:`child_image/_.conf`. -Alternatively, the child image Kconfig configuration file can be introduced as :file:`child_image//prj.conf` and follow the same pattern as the parent Kconfig. -For example, :file:`child_image/mcuboot/prj_release.conf` can be used to define the ``release`` build type for the ``mcuboot`` child image. - -Child image targets -=================== - -You can indirectly invoke a selection of child image targets from the parent image. -Currently, the child targets that can be invoked from the parent targets are ``menuconfig``, ``guiconfig``, and any targets listed in ``EXTRA_KCONFIG_TARGETS``. - -To disambiguate targets, use the same prefix convention used for variables. -For example, to run menuconfig, invoke the ``menuconfig`` target to configure the parent image and ``mcuboot_menuconfig`` to configure the MCUboot child image. - -You can also invoke any child target directly from its build directory. -Child build directories are located at the root of the parent's build directory. - -Controlling the build process -============================= - -The child image is built using CMake's build command ``cmake --build``. -This mechanism allows additional control of the build process through CMake. - -CMake options -------------- - -The following CMake options are propagated from the CMake command of the parent image to the CMake command of the child image: - -* ``CMAKE_BUILD_TYPE`` -* ``CMAKE_VERBOSE_MAKEFILE`` - -You can add other CMake options to a specific child image in the same way as you can set :ref:`Image-specific variables `. -For example, add ``-Dmcuboot_CMAKE_VERBOSE_MAKEFILE`` to the parent's CMake command to build the ``mcuboot`` child image with verbose output. - -To enable additional debug information for the multi-image build command, set the CMake option ``MULTI_IMAGE_DEBUG_MAKEFILE`` to the desired debug mode. -For example, add ``-DMULTI_IMAGE_DEBUG_MAKEFILE=explain`` to log the reasons why a command was executed. - -See :ref:`cmake_options` for instructions on how to specify these CMake options for the build. - -CMake environment variables ---------------------------- - -Unlike CMake options, CMake environment variables allow you to control the build process without re-invoking CMake. - -You can use the CMake environment variables `VERBOSE`_ and `CMAKE_BUILD_PARALLEL_LEVEL`_ to control the verbosity and the number of parallel jobs for a build: - -When using the command line or |VSC| terminal window, you must set them before invoking west. -They apply to both the parent and child images. -For example, to build with verbose output and one parallel job, use the following command, where *board_target* is the target for the development kit for which you are building: - -.. parsed-literal:: - :class: highlight - - west build -b *board_target* -- -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_PARALLEL_LEVEL=1 - -Memory placement -**************** - -In a multi-image build, all images must be placed in memory so that they do not overlap. -The flash memory start address for each image must be specified by, for example, :kconfig:option:`CONFIG_FLASH_LOAD_OFFSET`. - -Hardcoding the image locations like this works fine for simple use cases like a bootloader that prepares a device, where there are no further requirements on where in memory each image must be placed. -However, more advanced use cases require a memory layout where images are located in a specific order relative to one another. - -The |NCS| provides a Python tool that allows you to specify this kind of relative placement or even a static placement based on start addresses and sizes for the different images. - -See :ref:`partition_manager` for more information about how to set up your partitions and configure your build system. diff --git a/lib/edge_impulse/CMakeLists.txt b/lib/edge_impulse/CMakeLists.txt index 5b69061aa620..6da3f3ff7884 100644 --- a/lib/edge_impulse/CMakeLists.txt +++ b/lib/edge_impulse/CMakeLists.txt @@ -50,10 +50,7 @@ endforeach() list(REMOVE_DUPLICATES EI_URI_LIST) file(GLOB_RECURSE edge_impulse_all_headers "${EDGE_IMPULSE_SOURCE_DIR}/*.h") - -if(SYSBUILD) - zephyr_get(EI_API_KEY_HEADER SYSBUILD GLOBAL) -endif() +zephyr_get(EI_API_KEY_HEADER SYSBUILD GLOBAL) include(ExternalProject) ExternalProject_Add(edge_impulse_project diff --git a/modules/mcuboot/CMakeLists.txt b/modules/mcuboot/CMakeLists.txt index 5ec2643d7c86..fbe8fbd62891 100644 --- a/modules/mcuboot/CMakeLists.txt +++ b/modules/mcuboot/CMakeLists.txt @@ -1,950 +1,3 @@ add_subdirectory(${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/zephyr ${CMAKE_CURRENT_BINARY_DIR}/boot/bootutil/zephyr ) - -if(SYSBUILD) - # Code below is partition manager w/ child image support, thus return when - # sysbuild is used. - return() -endif() - -if (CONFIG_MCUBOOT) - if (CONFIG_NRF53_MULTI_IMAGE_UPDATE) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY NRF53_MULTI_IMAGE_UPDATE - ${CONFIG_NRF53_MULTI_IMAGE_UPDATE}) - endif() - - if (CONFIG_NRF53_RECOVERY_NETWORK_CORE) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY NRF53_RECOVERY_NETWORK_CORE - ${CONFIG_NRF53_RECOVERY_NETWORK_CORE}) - endif() - - dt_nodelabel(ram_flash_ctrl_dev NODELABEL nordic_ram_flash_controller) - if (DEFINED ram_flash_ctrl_dev) - # Share the information about the ram_flash node with the parent image. - # This information is used to create the partition manager region. - dt_nodelabel(ram_flash_dev NODELABEL flash_sim0) - dt_reg_addr(ram_flash_addr PATH ${ram_flash_dev}) - dt_reg_size(ram_flash_size PATH ${ram_flash_dev}) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY RAM_FLASH_ADDR ${ram_flash_addr}) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY RAM_FLASH_SIZE ${ram_flash_size}) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY RAM_FLASH_LABEL nordic_ram_flash_controller) - endif() -endif() - -if(CONFIG_XIP_SPLIT_IMAGE) - # Add MCUboot extra configuration file to disable image verification and use 3 images - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/nrf5340_exip_image.conf - ) -endif() - -if(CONFIG_BOOTLOADER_MCUBOOT) - if (CONFIG_NCS_IS_VARIANT_IMAGE) - # NCS Handles everything regarding mcuboot, ensure Zephyr doesn't interfere. - # This is a temporary solution until Zephyr signing has been made more modular. - set(CONFIG_BOOTLOADER_MCUBOOT False PARENT_SCOPE) - - # When building the variant of an image, the configuration of the variant image - # is identical to the base image, except 'CONFIG_NCS_IS_VARIANT_IMAGE'. The - # logic below should only be performed once, for the base image, not for the variant variant. - # Hence, we have this early return to avoid execution of this file for the variant image. - return() - endif() - - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/fw_zip.cmake) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/dfu_multi_image.cmake) - - function(sign) - # Signs a hex image - # - # Required arguments are: - # SIGNED_BIN_FILE_IN - (required) Hex image to sign - # SIGNED_HEX_FILE_NAME_PREFIX - (required) Prefix of the output image - # SLOT_SIZE - (required) The size of the primary partition - # SIGNED_HEX_FILE_OUT - (required) Signed hex output image - # - # Optional arguments: - # START_ADDRESS_OFFSET - (optional) Offset - # SIGNED_BIN_FILE_OUT - (optional) Signed bin output image - # SIGNED_HEX_TEST_FILE_OUT - (optional) Signed hex output test image including IMAGE_MAGIC - # IMAGE_DEPENDENCIES - (optional) Dependencies between signed image and other images - # ROM_FIXED - (optional) Start address of image - # DEPENDS - (optional) One or more dependencies for signing the hex image - set(oneValueArgs SIGNED_BIN_FILE_IN SIGNED_HEX_FILE_NAME_PREFIX SLOT_SIZE SIGNED_HEX_FILE_OUT) - set(oneValueOptionalArgs SIGNED_BIN_FILE_OUT SIGNED_HEX_TEST_FILE_OUT START_ADDRESS_OFFSET IMAGE_DEPENDENCIES ROM_FIXED) - set(multiValueArgs DEPENDS) - cmake_parse_arguments(SIGN_ARG "" "${oneValueArgs};${oneValueOptionalArgs}" "${multiValueArgs}" ${ARGN}) - check_arguments_required_all(sign SIGN_ARG ${oneValueArgs}) - - set(signed_hex ${SIGN_ARG_SIGNED_HEX_FILE_NAME_PREFIX}_signed.hex) - set(${SIGN_ARG_SIGNED_HEX_FILE_OUT} ${signed_hex} PARENT_SCOPE) - set(to_sign_bin ${SIGN_ARG_SIGNED_HEX_FILE_NAME_PREFIX}_to_sign.bin) - set(update_bin ${SIGN_ARG_SIGNED_HEX_FILE_NAME_PREFIX}_update.bin) - set(test_update_hex ${SIGN_ARG_SIGNED_HEX_FILE_NAME_PREFIX}_test_update.hex) - if(DEFINED SIGN_ARG_SIGNED_BIN_FILE_OUT) - set(${SIGN_ARG_SIGNED_BIN_FILE_OUT} ${update_bin} PARENT_SCOPE) - endif() - if(DEFINED SIGN_ARG_SIGNED_HEX_TEST_FILE_OUT) - set(${SIGN_ARG_SIGNED_HEX_TEST_FILE_OUT} ${test_update_hex} PARENT_SCOPE) - endif() - - if(DEFINED SIGN_ARG_ROM_FIXED) - set(SIGN_ARG_ROM_FIXED --rom-fixed ${SIGN_ARG_ROM_FIXED}) - endif() - - # Ensure that it is possible to move the secondary slot to the memory - # mapped area for external flash if the secondary slot is located in - # external flash. Only devices with 'qspi' should have hex files generated - # for the secondary slot, since these are the only ones with a memory mapped - # area. - dt_nodelabel(qspi_node NODELABEL "qspi") - if ((NOT CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY OR DEFINED qspi_node) AND - SIGN_ARG_START_ADDRESS_OFFSET) - set(moved_test_update_hex - ${SIGN_ARG_SIGNED_HEX_FILE_NAME_PREFIX}_moved_test_update.hex - ) - - if(DEFINED SIGN_ARG_SIGNED_HEX_TEST_FILE_OUT) - set(${SIGN_ARG_SIGNED_HEX_TEST_FILE_OUT} - ${test_update_hex} ${moved_test_update_hex} PARENT_SCOPE - ) - endif() - - add_custom_command( - OUTPUT - ${moved_test_update_hex} # Signed hex with IMAGE_MAGIC located at secondary slot - - COMMAND - # Create version of test update which is located at the secondary slot. - # Hence, if a programmer is given this hex file, it will flash it - # to the secondary slot, and upon reboot mcuboot will swap in the - # contents of the hex file. - ${CMAKE_OBJCOPY} - --input-target=ihex - --output-target=ihex - --change-address=${SIGN_ARG_START_ADDRESS_OFFSET} - --gap-fill=0xff - ${test_update_hex} - ${moved_test_update_hex} - - DEPENDS - ${SIGN_ARG_DEPENDS} - ${test_update_hex} - ) - endif() - - if(DEFINED SIGN_ARG_IMAGE_DEPENDENCIES) - set(sign_dependencies "-d;\"${SIGN_ARG_IMAGE_DEPENDENCIES}\"") - endif() - - add_custom_command( - OUTPUT - ${signed_hex} # Signed hex of input hex. - - COMMAND - # Create signed hex file from input hex file. - # This does not have the IMAGE_MAGIC at the end. So for this hex file - # to be applied by mcuboot, the application is required to write the - # IMAGE_MAGIC into the image trailer. - ${sign_cmd} - ${sign_dependencies} - ${SIGN_ARG_ROM_FIXED} - --slot-size ${SIGN_ARG_SLOT_SIZE} - ${SIGN_ARG_SIGNED_BIN_FILE_IN} - ${signed_hex} - - DEPENDS - ${SIGN_ARG_DEPENDS} - ) - - add_custom_command( - OUTPUT - ${update_bin} # Signed binary of input hex. - - COMMAND - # Create binary version of the input hex file, this is done so that we - # can create a signed binary file which will be transferred in OTA - # updates. - ${CMAKE_OBJCOPY} - --input-target=ihex - --output-target=binary - --gap-fill=0xff - ${SIGN_ARG_SIGNED_BIN_FILE_IN} - ${to_sign_bin} - - COMMAND - # Sign the binary version of the input hex file. - ${sign_cmd} - ${sign_dependencies} - ${SIGN_ARG_ROM_FIXED} - --slot-size ${SIGN_ARG_SLOT_SIZE} - ${to_sign_bin} - ${update_bin} - DEPENDS - ${SIGN_ARG_DEPENDS} - ) - - add_custom_command( - OUTPUT - ${test_update_hex} # Signed hex with IMAGE_MAGIC - - COMMAND - # Create signed hex file from input hex file *with* IMAGE_MAGIC. - # As this includes the IMAGE_MAGIC in its image trailer, it will be - # swapped in by mcuboot without any invocation from the app. Note, - # however, that this this hex file is located in the same address space - # as the input hex file, so in order for it to work as a test update, - # it needs to be moved. - ${sign_cmd} - ${sign_dependencies} - ${SIGN_ARG_ROM_FIXED} - --slot-size ${SIGN_ARG_SLOT_SIZE} - --pad # Adds IMAGE_MAGIC to end of slot. - ${SIGN_ARG_SIGNED_BIN_FILE_IN} - ${test_update_hex} - - DEPENDS - ${SIGN_ARG_DEPENDS} - ${update_bin} - ) - endfunction() - - function(split) - # Splits an elf image into 2 sets of hex and bin files - # - # Required arguments are: - # ELF_FILE_IN - # ELF_SECTION_NAMES - # HEX_INCLUDE_FILE_OUT - # HEX_EXCLUDE_FILE_OUT - set(oneValueArgs ELF_FILE_IN HEX_INCLUDE_FILE_OUT HEX_EXCLUDE_FILE_OUT) - set(multiValueArgs ELF_SECTION_NAMES DEPENDS) - cmake_parse_arguments(SPLIT_ARG "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - check_arguments_required_all(split SPLIT_ARG ${oneValueArgs} ELF_SECTION_NAMES) - - set(include_param) - set(exclude_param) - - foreach(section_name ${SPLIT_ARG_ELF_SECTION_NAMES}) - set(include_param ${include_param} -R ${section_name}) - set(exclude_param ${exclude_param} -j ${section_name}) - endforeach() - - add_custom_command( - OUTPUT - ${SPLIT_ARG_HEX_INCLUDE_FILE_OUT} - - COMMAND - ${CMAKE_OBJCOPY} - --output-target=ihex - ${include_param} - ${SPLIT_ARG_ELF_FILE_IN} - ${SPLIT_ARG_HEX_INCLUDE_FILE_OUT} - - DEPENDS - ${SPLIT_ARG_DEPENDS} - ) - - add_custom_command( - OUTPUT - ${SPLIT_ARG_HEX_EXCLUDE_FILE_OUT} - - COMMAND - ${CMAKE_OBJCOPY} - --output-target=ihex - ${exclude_param} - ${SPLIT_ARG_ELF_FILE_IN} - ${SPLIT_ARG_HEX_EXCLUDE_FILE_OUT} - - DEPENDS - ${SPLIT_ARG_DEPENDS} - ) - endfunction() - - if (CONFIG_BUILD_S1_VARIANT AND ("${CONFIG_S1_VARIANT_IMAGE_NAME}" STREQUAL "mcuboot")) - # Inject this configuration from parent image to mcuboot. - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/subsys/bootloader/image/build_s1.conf - ) - endif() - - if (CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY) - # By passing this value we don't require the user to pass any overlay files - # to the MCUboot child image for storing the secondary partition in - # external flash. - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/subsys/partition_manager/ext_flash_mcuboot_secondary.conf - ) - endif() - - if (CONFIG_BUILD_WITH_TFM) - # Configure MCUBoot to be able to boot TFM - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/tfm.conf - ) - - # Add fault injection protection to MCUBOOT - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/fih_low_enable.conf - ) - endif() - - if (CONFIG_NRF53_UPGRADE_NETWORK_CORE AND CONFIG_ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS) - # To allow multi image update of the network core we add a devicetree - # overlay which defines a flash controller used for emulating flash - # in RAM. - add_overlay_dts( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/flash_sim.overlay - ) - endif() - - # For devices with USB then a USB CDC node in mcuboot is required. - # As USB CDC is generally needed for this mcuboot use-case it should be - # considered if this solution could be better generalized. - if (CONFIG_MCUBOOT_USB_SUPPORT) - add_overlay_dts( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/usb.overlay - ) - endif() - - # Enable the same option in the MCUBoot child image - if (CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/hw_counters.conf - ) - - set(imgtool_security_counter --security-counter ${CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_VALUE}) - endif() - - add_child_image( - NAME mcuboot - SOURCE_DIR ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr - ) - - if (CONFIG_BUILD_S1_VARIANT) - add_child_image( - NAME s1_image - PRELOAD_IMAGE mcuboot - ) - elseif(CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT) - add_child_image( - NAME mcuboot_secondary_app - PRELOAD_IMAGE app - ) - endif() - - set(merged_hex_file - ${PROJECT_BINARY_DIR}/mcuboot_primary_app.hex) - set(merged_hex_file_depends - mcuboot_primary_app_hex$${PROJECT_BINARY_DIR}/mcuboot_primary_app.hex) - set(sign_merged - $) - set(app_to_sign_hex - $) - set(app_sign_depends - $) - - if (NOT DEFINED CONFIG_BOOT_SIGNATURE_KEY_FILE) - get_shared(mcuboot_sign_key IMAGE mcuboot PROPERTY SIGNATURE_KEY_FILE) - set(CONFIG_BOOT_SIGNATURE_KEY_FILE ${mcuboot_sign_key}) - endif () - - foreach (filepath ${mcuboot_CONF_FILE}) - if (EXISTS ${filepath}) - file(STRINGS ${filepath} mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE - REGEX "^CONFIG_BOOT_SIGNATURE_KEY_FILE=") - if (mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE) - get_filename_component(mcuboot_CONF_DIR ${filepath} DIRECTORY) - endif() - endif() - endforeach() - - if(IS_ABSOLUTE ${CONFIG_BOOT_SIGNATURE_KEY_FILE}) - set(mcuboot_key_file ${CONFIG_BOOT_SIGNATURE_KEY_FILE}) - elseif (DEFINED mcuboot_CONF_DIR) - if (EXISTS ${mcuboot_CONF_DIR}/${CONFIG_BOOT_SIGNATURE_KEY_FILE}) - set(mcuboot_key_file ${mcuboot_CONF_DIR}/${CONFIG_BOOT_SIGNATURE_KEY_FILE}) - endif() - endif() - - if(CONFIG_SIGN_IMAGES) - # Set default key - if (NOT DEFINED mcuboot_key_file) - message(WARNING " - --------------------------------------------------------- - --- WARNING: Using default MCUBoot key, it should not --- - --- be used for production. --- - --------------------------------------------------------- - \n" - ) - set(mcuboot_key_file ${ZEPHYR_MCUBOOT_MODULE_DIR}/${CONFIG_BOOT_SIGNATURE_KEY_FILE}) - endif() - - set(app_core_binary_name app_update.bin) - - execute_process(COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts/imgtool.py - getpub -k ${mcuboot_key_file} - OUTPUT_QUIET - ERROR_QUIET - RESULT_VARIABLE ret_val - ) - - if(${ret_val} EQUAL 2) - message(WARNING "Key file `${mcuboot_key_file}` does not contain a valid \ - private key. Signing of images will be disabled.") - message("Disable signing with `CONFIG_SIGN_IMAGES=n` to silence this warning.") - return() - endif() - - # Arguments to imgtool. - if(NOT CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS STREQUAL "") - # Separate extra arguments into the proper format for adding to - # extra_post_build_commands. - # - # Use UNIX_COMMAND syntax for uniform results across host - # platforms. - separate_arguments(imgtool_extra UNIX_COMMAND ${CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS}) - else() - set(imgtool_extra) - endif() - - set(sign_cmd - ${PYTHON_EXECUTABLE} - ${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts/imgtool.py - sign - --key ${mcuboot_key_file} - --header-size $ - --align ${CONFIG_MCUBOOT_FLASH_WRITE_BLOCK_SIZE} - --version ${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION} - --pad-header - ${imgtool_security_counter} - ${imgtool_extra} - ) - - set(app_offset $) - - if (CONFIG_NRF53_ENFORCE_IMAGE_VERSION_EQUALITY) - # Specify image pair IDs to generate dependencies between images. - set(APPLICATION_IMAGE_PAIR_IDX 0) - set(NETWORK_IMAGE_PAIR_IDX 1) - - # Add dependency inside application core image to require the latest network core image. - set(sign_dependencies IMAGE_DEPENDENCIES "(${NETWORK_IMAGE_PAIR_IDX},${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION})") - endif() - - if (CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT) - set(rom_fixed ROM_FIXED $) - else() - set(rom_fixed) - endif() - - if(CONFIG_XIP_SPLIT_IMAGE) - split( - ELF_FILE_IN ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} - ELF_SECTION_NAMES ".extflash_text_reloc;.extflash_rodata_reloc" - HEX_INCLUDE_FILE_OUT ${PROJECT_BINARY_DIR}/internal_flash.hex - HEX_EXCLUDE_FILE_OUT ${PROJECT_BINARY_DIR}/qspi_flash.hex - DEPENDS ${app_sign_depends} ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} - ) - - add_custom_target(mcuboot_split_target - DEPENDS - ${PROJECT_BINARY_DIR}/internal_flash.hex - ${PROJECT_BINARY_DIR}/qspi_flash.hex - ) - - sign( - SIGNED_BIN_FILE_IN ${PROJECT_BINARY_DIR}/internal_flash.hex - SIGNED_HEX_FILE_NAME_PREFIX ${PROJECT_BINARY_DIR}/internal_flash - SLOT_SIZE $ - SIGNED_HEX_FILE_OUT internal_flash_signed_hex - SIGNED_BIN_FILE_OUT internal_flash_signed_bin - ${sign_dependencies} - ${rom_fixed} - DEPENDS ${app_sign_depends} mcuboot_split_target - ) - - sign( - SIGNED_BIN_FILE_IN ${PROJECT_BINARY_DIR}/qspi_flash.hex - SIGNED_HEX_FILE_NAME_PREFIX ${PROJECT_BINARY_DIR}/qspi_flash - SLOT_SIZE $ - SIGNED_HEX_FILE_OUT qspi_flash_signed_hex - SIGNED_BIN_FILE_OUT qspi_flash_signed_bin - ${sign_dependencies} - ${rom_fixed} - DEPENDS ${app_sign_depends} mcuboot_split_target - ) - - add_custom_target(mcuboot_sign_target - DEPENDS - ${internal_flash_signed_hex} - ${internal_flash_signed_bin} - ${qspi_flash_signed_hex} - ${qspi_flash_signed_bin} - ) - - # When signing split images then we must inform partition manager that it - # now has to use both images as mcuboot primary app. - set_property(GLOBAL PROPERTY - mcuboot_primary_app_PM_HEX_FILE - ${qspi_flash_signed_hex} - ${internal_flash_signed_hex} - ) - set_property(GLOBAL PROPERTY - mcuboot_primary_app_PM_TARGET - mcuboot_sign_target - ) - - set(generate_bin_app_files - ${PROJECT_BINARY_DIR}/internal_flash_update.bin - ${PROJECT_BINARY_DIR}/qspi_flash_update.bin - ) - - set(generate_script_app_params - "internal_flash_update.binload_address=$" - "internal_flash_update.binimage_index=0" - "internal_flash_update.binslot_index_primary=1" - "internal_flash_update.binslot_index_secondary=2" - "internal_flash_update.binversion_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - "qspi_flash_update.binload_address=$" - "qspi_flash_update.binimage_index=2" - "qspi_flash_update.binslot_index_primary=5" - "qspi_flash_update.binslot_index_secondary=6" - "qspi_flash_update.binversion_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - ) -else() - sign( - SIGNED_BIN_FILE_IN ${app_to_sign_hex} - SIGNED_HEX_FILE_NAME_PREFIX ${PROJECT_BINARY_DIR}/app - SLOT_SIZE $ - START_ADDRESS_OFFSET ${app_offset} - SIGNED_HEX_FILE_OUT app_signed_hex - SIGNED_BIN_FILE_OUT app_signed_bin - SIGNED_HEX_TEST_FILE_OUT app_signed_test_hex - ${sign_dependencies} - ${rom_fixed} - DEPENDS ${app_sign_depends} - ) - - add_custom_target(mcuboot_sign_target - DEPENDS ${app_signed_hex} ${app_signed_bin} ${app_signed_test_hex} - ) - - set_property(GLOBAL PROPERTY - mcuboot_primary_app_PM_HEX_FILE - ${app_signed_hex} - ) - set_property(GLOBAL PROPERTY - mcuboot_primary_app_PM_TARGET - mcuboot_sign_target - ) - - set(generate_bin_app_files - ${PROJECT_BINARY_DIR}/${app_core_binary_name} - ) -endif() - - if (CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT) - get_shared(mcuboot_secondary_app_bin_dir IMAGE mcuboot_secondary_app PROPERTY ZEPHYR_BINARY_DIR) - set(mcuboot_secondary_app_hex ${mcuboot_secondary_app_bin_dir}/zephyr.hex) - - set(rom_fixed ROM_FIXED $) - - sign( - SIGNED_BIN_FILE_IN ${mcuboot_secondary_app_hex} - SIGNED_HEX_FILE_NAME_PREFIX ${PROJECT_BINARY_DIR}/mcuboot_secondary_app - SLOT_SIZE $ - SIGNED_HEX_FILE_OUT mcuboot_secondary_app_signed_hex - SIGNED_BIN_FILE_OUT mcuboot_secondary_app_signed_bin - SIGNED_HEX_TEST_FILE_OUT mcuboot_secondary_app_signed_test_hex - ${rom_fixed} - DEPENDS mcuboot_secondary_app_subimage ${mcuboot_secondary_app_bin_dir}/zephyr.hex - ) - - add_custom_target(mcuboot_secondary_app_sign_target - DEPENDS - ${mcuboot_secondary_app_signed_hex} - ${mcuboot_secondary_app_signed_bin} - ${mcuboot_secondary_app_signed_test_hex} - ) - - set_property(GLOBAL PROPERTY - mcuboot_secondary_app_PM_HEX_FILE - ${mcuboot_secondary_app_signed_hex} - ) - - set_property(GLOBAL PROPERTY - mcuboot_secondary_app_PM_TARGET - mcuboot_secondary_app_sign_target - ) - endif() - - get_shared(cpunet_signed_app_hex IMAGE CPUNET PROPERTY PM_SIGNED_APP_HEX) - - if (CONFIG_NRF53_UPGRADE_NETWORK_CORE - AND DEFINED cpunet_signed_app_hex) - # Network core application updates are enabled. - # We know this since MCUBoot is enabled on the application core, and - # a network core child image is included in the build. - # These updates are verified by the application core MCUBoot. - # Create a signed variant of the network core application. - - get_shared(cpunet_images IMAGE CPUNET PROPERTY PM_DOMAIN_IMAGES) - foreach(image ${cpunet_images}) - if(${image} MATCHES "CPUNET:(.*)") - set(image_name ${CMAKE_MATCH_1}) - if(TARGET ${image_name}_subimage) - get_shared(${image_name}_byproducts IMAGE ${image_name} PROPERTY BUILD_BYPRODUCTS) - list(APPEND sign_depends ${image_name}_subimage ${${image_name}_byproducts}) - endif() - endif() - endforeach() - - set(net_core_binary_name net_core_app_update.bin) - - if (CONFIG_NRF53_ENFORCE_IMAGE_VERSION_EQUALITY) - # Add dependency inside network core image to require the latest application core image. - set(sign_dependencies IMAGE_DEPENDENCIES "(${APPLICATION_IMAGE_PAIR_IDX},${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION})") - endif() - - sign( - SIGNED_BIN_FILE_IN ${cpunet_signed_app_hex} - SIGNED_HEX_FILE_NAME_PREFIX ${PROJECT_BINARY_DIR}/net_core_app - SLOT_SIZE $ - START_ADDRESS_OFFSET $ - SIGNED_HEX_FILE_OUT net_core_app_signed_hex - SIGNED_BIN_FILE_OUT net_core_app_signed_bin - SIGNED_HEX_TEST_FILE_OUT net_core_app_signed_test_hex - ${sign_dependencies} - DEPENDS ${sign_depends} - ) - - add_custom_target( - net_core_app_sign_target - DEPENDS ${net_core_app_signed_hex} - ${net_core_app_signed_bin} - ${net_core_app_signed_test_hex} - ) - - add_dependencies( - mcuboot_sign_target - net_core_app_sign_target - ) - - get_shared(net_core_soc IMAGE net_core PROPERTY SOC) - get_shared(net_core_version IMAGE net_core PROPERTY VERSION) - - set(generate_bin_files - ${generate_bin_app_files} - ${PROJECT_BINARY_DIR}/${net_core_binary_name} - ) - - if(NOT CONFIG_XIP_SPLIT_IMAGE) - set(generate_script_app_params - "${app_core_binary_name}load_address=$" - "${app_core_binary_name}image_index=0" - "${app_core_binary_name}slot_index_primary=1" - "${app_core_binary_name}slot_index_secondary=2" - "${app_core_binary_name}version_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - ) - endif() - - set(generate_script_params - ${generate_script_app_params} - "${net_core_binary_name}image_index=1" - "${net_core_binary_name}slot_index_primary=3" - "${net_core_binary_name}slot_index_secondary=4" - "${net_core_binary_name}load_address=$" - "${net_core_binary_name}board=${CONFIG_DOMAIN_CPUNET_BOARD}" - "${net_core_binary_name}version=${net_core_version}" - "${net_core_binary_name}soc=${net_core_soc}" - ) - else() - # No network core update - if(CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT) - if(CONFIG_XIP_SPLIT_IMAGE) - message(FATAL_ERROR "This build configuration is not supported: -CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT cannot be used with CONFIG_XIP_SPLIT_IMAGE.") - endif() - - set(secondary_app_core_binary_name mcuboot_secondary_app_update.bin) - set(generate_bin_files - ${generate_bin_app_files} - ${PROJECT_BINARY_DIR}/${secondary_app_core_binary_name} - ) - set(generate_script_params - "${app_core_binary_name}load_address=$" - "${app_core_binary_name}version_MCUBOOT+XIP=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - "${app_core_binary_name}slot=0" - "${secondary_app_core_binary_name}load_address=$" - "${secondary_app_core_binary_name}version_MCUBOOT+XIP=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - "${secondary_app_core_binary_name}slot=1" - ) - else() - set(generate_bin_files - ${generate_bin_app_files} - ) - - if(NOT CONFIG_XIP_SPLIT_IMAGE) - set(generate_script_params - "load_address=$" - "version_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - ) - else() - set(generate_script_params ${generate_script_app_params}) - endif() - endif() - endif() - - # Targets for adding nrf70 wifi firmware patch. This workflow creates the nrf70_signed.hex and nrf70_update.bin files that can be - # used in DFU process, and multi-image DFU process. - if(CONFIG_NRF_WIFI_FW_PATCH_DFU) - set(nrf70_binary_name nrf70_update.bin) - - sign( - SIGNED_BIN_FILE_IN ${PROJECT_BINARY_DIR}/nrf70.hex - SIGNED_HEX_FILE_NAME_PREFIX ${PROJECT_BINARY_DIR}/nrf70 - SLOT_SIZE $ - SIGNED_HEX_FILE_OUT nrf70_signed_hex - SIGNED_BIN_FILE_OUT nrf70_signed_bin - SIGNED_HEX_TEST_FILE_OUT nrf70_signed_test_hex - DEPENDS ${PROJECT_BINARY_DIR}/nrf70.hex - ) - - add_custom_target(mcuboot_nrf70_target - DEPENDS - ${nrf70_signed_hex} - ${nrf70_signed_bin} - ${nrf70_signed_test_hex} - ) - - set_property(GLOBAL PROPERTY - nrf70_wifi_fw_PM_HEX_FILE - ${nrf70_signed_hex} - ) - - set_property(GLOBAL PROPERTY - nrf70_wifi_fw_PM_TARGET - mcuboot_nrf70_target - ) - - add_dependencies( - mcuboot_sign_target - mcuboot_nrf70_target - ) - - # Add nrf70 update file to the existing bin files list before generating the zip file. - list(APPEND generate_bin_files - ${PROJECT_BINARY_DIR}/${nrf70_binary_name} - ) - - if(CONFIG_NRF53_UPGRADE_NETWORK_CORE) - list(APPEND generate_script_params - "${nrf70_binary_name}image_index=2" - "${nrf70_binary_name}slot_index_primary=5" - "${nrf70_binary_name}slot_index_secondary=6" - ) - else() - list(APPEND generate_script_params - "${nrf70_binary_name}image_index=1" - "${nrf70_binary_name}slot_index_primary=3" - "${nrf70_binary_name}slot_index_secondary=4" - ) - endif() - - endif() - - generate_dfu_zip( - OUTPUT ${PROJECT_BINARY_DIR}/dfu_application.zip - BIN_FILES ${generate_bin_files} - TYPE application - SCRIPT_PARAMS ${generate_script_params} - ) - - if (CONFIG_BUILD_S1_VARIANT AND ("${CONFIG_S1_VARIANT_IMAGE_NAME}" STREQUAL "mcuboot")) - # Secure Boot (B0) is enabled, and we have to build update candidates - # for both S1 and S0. - - # We need to override some attributes of the parent slot S0/S1. - # Which contains both the S0/S1 image and the padding/header. - foreach(parent_slot s0;s1) - set(slot ${parent_slot}_image) - - # Fetch the target and hex file for the current slot. - # Note that these hex files are already signed by B0. - get_property(${slot}_target GLOBAL PROPERTY ${slot}_PM_TARGET) - get_property(${slot}_hex GLOBAL PROPERTY ${slot}_PM_HEX_FILE) - - # The gap from S0/S1 partition is calculated by partition manager - # and stored in its target. - set(slot_offset - $) - - set(out_path ${PROJECT_BINARY_DIR}/signed_by_mcuboot_and_b0_${slot}) - - sign( - SIGNED_BIN_FILE_IN ${${slot}_hex} - SIGNED_HEX_FILE_NAME_PREFIX ${out_path} - SLOT_SIZE $ - START_ADDRESS_OFFSET ${slot_offset} - SIGNED_HEX_FILE_OUT signed_hex - SIGNED_BIN_FILE_OUT signed_bin - SIGNED_HEX_TEST_FILE_OUT signed_test_hex - DEPENDS ${${slot}_target} ${${slot}_hex} - ) - - # We now have to override the S0/S1 partition, so use `parent_slot` - # variable, which is "s0" and "s1" respectively. This to get partition - # manager to override the implicitly assigned container hex files. - - # Wrapper target for the generated hex file. - add_custom_target(signed_${parent_slot}_target - DEPENDS ${signed_hex} ${signed_bin} ${signed_test_hex} - ) - - # Override the container hex file. - set_property(GLOBAL PROPERTY - ${parent_slot}_PM_HEX_FILE - ${signed_hex} - ) - - # Override the container hex file target. - set_property(GLOBAL PROPERTY - ${parent_slot}_PM_TARGET - signed_${parent_slot}_target - ) - endforeach() - - # Generate zip file with both update candidates - set(s0_name signed_by_mcuboot_and_b0_s0_image_update.bin) - set(s0_bin_path ${PROJECT_BINARY_DIR}/${s0_name}) - set(s1_name signed_by_mcuboot_and_b0_s1_image_update.bin) - set(s1_bin_path ${PROJECT_BINARY_DIR}/${s1_name}) - - # Create dependency to ensure explicit build order. This is needed to have - # a single target represent the state when both s0 and s1 imags are built. - add_dependencies( - signed_s1_target - signed_s0_target - ) - - generate_dfu_zip( - OUTPUT ${PROJECT_BINARY_DIR}/dfu_mcuboot.zip - BIN_FILES ${s0_bin_path} ${s1_bin_path} - TYPE mcuboot - SCRIPT_PARAMS - "${s0_name}load_address=$" - "${s1_name}load_address=$" - "version_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - "version_B0=${CONFIG_FW_INFO_FIRMWARE_VERSION}" - ) - endif() - endif(CONFIG_SIGN_IMAGES) -endif() - -if (CONFIG_DFU_MULTI_IMAGE_PACKAGE_BUILD) - set(dfu_multi_image_ids) - set(dfu_multi_image_paths) - set(dfu_multi_image_targets) - - if(CONFIG_XIP_SPLIT_IMAGE) - message(FATAL_ERROR "This build configuration is not supported: -CONFIG_DFU_MULTI_IMAGE_PACKAGE_BUILD cannot be used with CONFIG_XIP_SPLIT_IMAGE.") - endif() - - if (CONFIG_DFU_MULTI_IMAGE_PACKAGE_APP) - list(APPEND dfu_multi_image_ids 0) - list(APPEND dfu_multi_image_paths "${PROJECT_BINARY_DIR}/${app_core_binary_name}") - list(APPEND dfu_multi_image_targets mcuboot_sign_target) - endif() - - if (CONFIG_DFU_MULTI_IMAGE_PACKAGE_NET) - list(APPEND dfu_multi_image_ids 1) - list(APPEND dfu_multi_image_paths "${PROJECT_BINARY_DIR}/${net_core_binary_name}") - list(APPEND dfu_multi_image_targets net_core_app_sign_target) - endif() - - if (CONFIG_DFU_MULTI_IMAGE_PACKAGE_MCUBOOT) - list(APPEND dfu_multi_image_ids -2 -1) - list(APPEND dfu_multi_image_paths "${s0_bin_path}" "${s1_bin_path}") - list(APPEND dfu_multi_image_targets signed_s0_target signed_s1_target) - endif() - - if(CONFIG_NRF_WIFI_FW_PATCH_DFU) - if (CONFIG_DFU_MULTI_IMAGE_PACKAGE_NET) - list(APPEND dfu_multi_image_ids 2) - else() - list(APPEND dfu_multi_image_ids 1) - endif() - list(APPEND dfu_multi_image_paths "${PROJECT_BINARY_DIR}/${nrf70_binary_name}") - list(APPEND dfu_multi_image_targets mcuboot_nrf70_target) - endif() - - dfu_multi_image_package(dfu_multi_image_pkg - IMAGE_IDS ${dfu_multi_image_ids} - IMAGE_PATHS ${dfu_multi_image_paths} - OUTPUT ${PROJECT_BINARY_DIR}/dfu_multi_image.bin - ) - - add_dependencies(dfu_multi_image_pkg ${dfu_multi_image_targets}) -endif() - -if(CONFIG_ZIGBEE AND CONFIG_ZIGBEE_FOTA) - if (CONFIG_ZIGBEE_FOTA_GENERATE_LEGACY_IMAGE_TYPE) - set(firmware_binary "${PROJECT_BINARY_DIR}/${app_core_binary_name}") - set(legacy_cmd "--legacy") - elseif(CONFIG_DFU_MULTI_IMAGE_PACKAGE_BUILD) - set(firmware_binary "${PROJECT_BINARY_DIR}/dfu_multi_image.bin") - set(legacy_cmd ) - else() - message(FATAL_ERROR "No Zigbee FOTA image format selected. Please enable either legacy or the multi-image format.") - endif() - - add_custom_target(zigbee_ota_image ALL - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/zb_add_ota_header.py - --application ${firmware_binary} - --application-version-string ${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION} - --zigbee-manufacturer-id ${CONFIG_ZIGBEE_FOTA_MANUFACTURER_ID} - --zigbee-image-type ${CONFIG_ZIGBEE_FOTA_IMAGE_TYPE} - --zigbee-comment ${CONFIG_ZIGBEE_FOTA_COMMENT} - --zigbee-ota-min-hw-version ${CONFIG_ZIGBEE_FOTA_MIN_HW_VERSION} - --zigbee-ota-max-hw-version ${CONFIG_ZIGBEE_FOTA_MAX_HW_VERSION} - --out-directory ${PROJECT_BINARY_DIR} - ${legacy_cmd} - - DEPENDS - ${firmware_binary} - ) -endif(CONFIG_ZIGBEE AND CONFIG_ZIGBEE_FOTA) - -# Zephyr has a Kconfig option used for signing an application image -# with MCUboot using west sign. If partition manager is in use and -# there are multiple images, we want to make sure users understand -# this option should probably be left alone, since the NCS build -# system has its own way of managing signing. -if (CONFIG_MCUBOOT_SIGNATURE_KEY_FILE) - message(WARNING - "CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is set to \"${CONFIG_MCUBOOT_SIGNATURE_KEY_FILE}\". -You are using the NCS Mcuboot signing, which means this option will be ignored. -Image signing in NCS is done via the MCUboot image's \ - CONFIG_BOOT_SIGNATURE_KEY_FILE option. -Consider setting CONFIG_MCUBOOT_SIGNATURE_KEY_FILE in your application image\ - back to its default value, the empty string.") -endif() - -# NCS Handles everything regarding mcuboot, ensure Zephyr doesn't interfere. -# This is a temporary solution until Zephyr signing has been made more modular. -set(CONFIG_BOOTLOADER_MCUBOOT False PARENT_SCOPE) diff --git a/modules/mcuboot/Kconfig b/modules/mcuboot/Kconfig index 506804b19b27..4bbd2b5cd963 100644 --- a/modules/mcuboot/Kconfig +++ b/modules/mcuboot/Kconfig @@ -1,41 +1,7 @@ menu "MCUboot" -config BOOT_SIGNATURE_KEY_FILE - string "MCUBoot PEM key file" - depends on !MCUBOOT_BUILD_STRATEGY_FROM_SOURCE - help - Absolute path to PEM key file containing the private key corresponding - to the public key included in MCUBoot. This will be used to sign the - image so that it can be verified by MCUBoot. Since MCUBoot is not - built from source, it is not possible for the build system to deduce - what key was used when compiling it. Hence, it is required that the - key is passed to the build system through this option. - -config SIGN_IMAGES - bool "Sign images for MCUBoot" - default y - imply BUILD_OUTPUT_META - depends on MCUBOOT_BUILD_STRATEGY_FROM_SOURCE \ - || BOOT_SIGNATURE_KEY_FILE != "" - help - Sign images for MCUBoot as integrated part of the build stages using - the private key. - if BOOTLOADER_MCUBOOT -config BOOT_BUILD_DIRECT_XIP_VARIANT - bool "Build DIRECT_XIP variant" - default y if MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP - default y if MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT - help - Build a variant of the 'app' image which can be used for DIRECT_XIP. - -# The name of this configuration needs to match the requirements set by the -# script `partition_manager.py`. See `pm.yml` in the application directory -# of MCUBoot. -module=MCUBOOT -source "${ZEPHYR_BASE}/../nrf/subsys/partition_manager/Kconfig.template.build_strategy" - menuconfig MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION bool "Downgrade prevention using hardware security counters" depends on SOC_NRF5340_CPUAPP || SOC_SERIES_NRF91X @@ -98,41 +64,6 @@ config USE_NRF53_MULTI_IMAGE_WITHOUT_UPGRADE_ONLY different swapping methods. This will however give you the potential of bricking the network core upon reverts. -config DFU_MULTI_IMAGE_PACKAGE_BUILD - bool "Build DFU Multi Image package" - depends on BOOTLOADER_MCUBOOT - help - Build DFU Multi Image package that contains a manifest file followed by - selected update images. - -if DFU_MULTI_IMAGE_PACKAGE_BUILD - -config DFU_MULTI_IMAGE_PACKAGE_APP - bool "Include Application Core image in DFU Multi Image package" - default y - -config DFU_MULTI_IMAGE_PACKAGE_NET - bool "Include Network Core image in DFU Multi Image package" - depends on NRF53_UPGRADE_NETWORK_CORE - default y - -config DFU_MULTI_IMAGE_PACKAGE_MCUBOOT - bool "Include MCUboot image in DFU Multi Image package" - depends on BUILD_S1_VARIANT - # Currently simultaneous application and MCUboot updates are unsupported - depends on !DFU_MULTI_IMAGE_PACKAGE_APP && !DFU_MULTI_IMAGE_PACKAGE_NET - -endif # DFU_MULTI_IMAGE_PACKAGE_BUILD - -config ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS - bool "DTS overlay of the sim-flash intermediary for upgrading NET core" - depends on BOOTLOADER_MCUBOOT - help - Add DTS overlay which defines the flash simulator device which is emulating - the network core primary slot. This slot is required either to allow - multi image update of the network core or to allow serial recovery of - the network core. - config MCUBOOT_USE_ALL_AVAILABLE_RAM bool "Allow MCUBoot to use all available RAM (security implications)" depends on ARM_TRUSTZONE_M @@ -143,13 +74,3 @@ config MCUBOOT_USE_ALL_AVAILABLE_RAM RAM partition. endmenu - -config XIP_SPLIT_IMAGE - bool "Split XIP image" - depends on SOC_NRF5340_CPUAPP - depends on !MCUBOOT - help - Allows for an image to be split into 2 parts where there is code executing from internal - flash and code from QSPI via XIP. Requires specific project setup for projects to use - this feature: project's cmake which supports code dispatching, linker script for describe QSPI - linking area and dedicated partition manager configuration. diff --git a/modules/mcuboot/boot/zephyr/Kconfig b/modules/mcuboot/boot/zephyr/Kconfig index d4752cf04c1a..5dc4e87b6605 100644 --- a/modules/mcuboot/boot/zephyr/Kconfig +++ b/modules/mcuboot/boot/zephyr/Kconfig @@ -105,9 +105,6 @@ config BOOT_ERASE_PROGRESSIVELY config BOOT_IMAGE_ACCESS_HOOKS bool - # Child/parent check - default y if UPDATEABLE_IMAGE_NUMBER > 1 && SOC_NRF5340_CPUAPP && PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY && MCUBOOT_APPLICATION_IMAGE_NUMBER = -1 - # Sysbuild check default y if MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 depends on MCUBOOT diff --git a/modules/mcuboot/hooks/nrf53_hooks.c b/modules/mcuboot/hooks/nrf53_hooks.c index 79c9b599c5f4..72237e110e97 100644 --- a/modules/mcuboot/hooks/nrf53_hooks.c +++ b/modules/mcuboot/hooks/nrf53_hooks.c @@ -15,17 +15,10 @@ #include "bootutil/fault_injection_hardening.h" #include "flash_map_backend/flash_map_backend.h" -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ /* MCUboot image update image number */ #define NET_CORE_SECONDARY_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER /* MCUboot serial recovery slot number */ #define NET_CORE_VIRTUAL_PRIMARY_SLOT (CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER * 2) + 1 -#else -/* Legacy child/parent */ -#define NET_CORE_SECONDARY_IMAGE 1 -#define NET_CORE_VIRTUAL_PRIMARY_SLOT 3 -#endif #include #if defined(CONFIG_PCD_APP) && defined(CONFIG_NRF53_MULTI_IMAGE_UPDATE) \ diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 62ec748b929d..5404a933e28f 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -30,30 +30,23 @@ endif() if(CONFIG_BOOTLOADER_MCUBOOT AND NOT CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY) # Configure the secondary partition to be non-secure - if(SYSBUILD) - function(mcuboot_single_check val) - import_kconfig(CONFIG_ "${CMAKE_BINARY_DIR}/../mcuboot/zephyr/.config") - set(${val} "${CONFIG_SINGLE_APPLICATION_SLOT}" PARENT_SCOPE) - endfunction() - - set(mcuboot_single_slot) - mcuboot_single_check(mcuboot_single_slot) - - if(mcuboot_single_slot) - set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DNRF_NS_SECONDARY=n - ) - else() - set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DNRF_NS_SECONDARY=y - ) - endif() + function(mcuboot_single_check val) + import_kconfig(CONFIG_ "${CMAKE_BINARY_DIR}/../mcuboot/zephyr/.config") + set(${val} "${CONFIG_SINGLE_APPLICATION_SLOT}" PARENT_SCOPE) + endfunction() + + set(mcuboot_single_slot) + mcuboot_single_check(mcuboot_single_slot) + + if(mcuboot_single_slot) + set_property(TARGET zephyr_property_target + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_NS_SECONDARY=n + ) else() set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS - -DNRF_NS_SECONDARY=$ + -DNRF_NS_SECONDARY=y ) endif() endif() @@ -352,8 +345,6 @@ set_property(TARGET zephyr_property_target -DTFM_EXTRA_CONFIG_PATH="${CMAKE_CURRENT_BINARY_DIR}/config_extra.cmake" ) -if(SYSBUILD) - set(BYPRODUCT_KERNEL_SIGNED_HEX_NAME "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex" - CACHE FILEPATH "Kernel hex file" FORCE - ) -endif() +set(BYPRODUCT_KERNEL_SIGNED_HEX_NAME "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex" + CACHE FILEPATH "Kernel hex file" FORCE +) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index cbe5f9ba71b0..8c0062102703 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -4,155 +4,4 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if (CONFIG_SECURE_BOOT) - if (CONFIG_SOC_NRF5340_CPUNET) - # Share some information which is used when generating the zip file - # with the update binaries. - set_shared(IMAGE net_core PROPERTY SOC ${CONFIG_SOC}) - set_shared(IMAGE net_core PROPERTY VERSION ${CONFIG_FW_INFO_FIRMWARE_VERSION}) - add_child_image( - NAME b0n - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/nrf5340/netboot - ) - else() - add_child_image( - NAME b0 - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/bootloader - ) - endif() - if (CONFIG_SOC_NRF5340_CPUAPP AND CONFIG_BOOTLOADER_MCUBOOT) - add_overlay_config( - mcuboot - ${ZEPHYR_NRF_MODULE_DIR}/subsys/bootloader/image/log_minimal.conf - ) - endif() - if (CONFIG_BUILD_S1_VARIANT AND "${CONFIG_S1_VARIANT_IMAGE_NAME}" STREQUAL "app") - add_child_image( - NAME s1_image - PRELOAD_IMAGE app - ) - endif() -endif() - -if (CONFIG_NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE) - add_child_image( - NAME "empty_app_core" - SOURCE_DIR "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/empty_app_core" - DOMAIN "CPUAPP" - BOARD ${CONFIG_DOMAIN_CPUAPP_BOARD} - ) -endif() - -if (CONFIG_NCS_SAMPLE_PROVISIONING_NET_CORE_CHILD_IMAGE) - add_child_image( - NAME "provisioning_net_core" - SOURCE_DIR "${ZEPHYR_NRF_MODULE_DIR}/samples/tfm/provisioning_image_net_core" - DOMAIN "CPUNET" - BOARD ${CONFIG_DOMAIN_CPUNET_BOARD} - ) -endif() - -if (CONFIG_NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE) - add_child_image( - NAME "remote_shell" - SOURCE_DIR "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/remote_shell" - DOMAIN "CPUAPP" - BOARD ${CONFIG_DOMAIN_CPUAPP_BOARD} - ) -endif() - -if (CONFIG_NCS_SAMPLE_DTM_REMOTE_HCI_CHILD_IMAGE) - add_child_image( - NAME "remote_hci" - SOURCE_DIR "${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/direct_test_mode/remote_hci" - DOMAIN "CPUAPP" - BOARD ${CONFIG_DOMAIN_CPUAPP_BOARD} - ) -endif() - -if (CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_EMPTY_NET_CORE_CHILD_IMAGE) - - if (CONFIG_NCS_SAMPLE_EMPTY_NET_CORE_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "empty_net_core") - set(CHILD_IMAGE_PATH "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/empty_net_core") - - elseif (CONFIG_NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "multiprotocol_rpmsg") - set(CHILD_IMAGE_PATH "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/multiprotocol_rpmsg") - - elseif (CONFIG_NCS_SAMPLE_HCI_IPC_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "hci_ipc") - set(CHILD_IMAGE_PATH "${ZEPHYR_BASE}/samples/bluetooth/hci_ipc") - - elseif (CONFIG_NCS_SAMPLE_802154_RPMSG_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "802154_rpmsg") - set(CHILD_IMAGE_PATH "${ZEPHYR_BASE}/samples/boards/nordic/ieee802154/802154_rpmsg") - - elseif (CONFIG_NCS_SAMPLE_RPC_HOST_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "rpc_host") - set(CHILD_IMAGE_PATH "${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/rpc_host") - - elseif (CONFIG_NCS_SAMPLE_PERIPHERAL_RADIO_TEST_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "peripheral_radio_test") - set(CHILD_IMAGE_PATH "${ZEPHYR_NRF_MODULE_DIR}/samples/peripheral/radio_test") - - else() - # If we get here, something is wrong with the Kconfig resolution - message(WARNING "CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE is set but " - "couldn't resolve which RPMsg sample to add.") - endif() - - if (CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP) - # By passing this value we don't require the user to pass any overlay files to the - # network core child image. Bluetooth buffer sizes are aligned automatically. - if (CONFIG_NCS_SAMPLE_HCI_IPC_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE) - add_overlay_config( - ${CHILD_IMAGE_NAME} - ${CMAKE_CURRENT_LIST_DIR}/common/mcumgr_bt_ota_dfu/rpmsg_child_image_overlay.conf - ) - endif() - endif() - - # Only include a child image if both image name and path have been defined. - # Prevents e.g. menuconfig from becoming inaccessible, among others. - if(CHILD_IMAGE_NAME AND CHILD_IMAGE_PATH) - - if (CONFIG_NRF53_UPGRADE_NETWORK_CORE) - # Inject this configuration from parent image to enable - # secure bootloader on the network core. This enables firmware update - # of the network core application. - add_overlay_config( - ${CHILD_IMAGE_NAME} - "${ZEPHYR_NRF_MODULE_DIR}/subsys/bootloader/image/secure_boot.conf" - ) - - # Inject this configuration from parent image mcuboot to enable - # the PCD subsystem which is used to communicate the firmware update - # to the network core bootloader. - add_overlay_config( - mcuboot - "${ZEPHYR_NRF_MODULE_DIR}/subsys/pcd/pcd.conf" - ) - endif() - - if (CONFIG_BT_MESH) - # Inject this configuration from the parent image to enable - # the necessary amount of advertising sets in the Bluetooth controller - # on the network core required by the Bluetooth Mesh. - add_overlay_config( - ${CHILD_IMAGE_NAME} - "${ZEPHYR_NRF_MODULE_DIR}/subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf" - ) - endif() - - add_child_image( - NAME ${CHILD_IMAGE_NAME} - SOURCE_DIR ${CHILD_IMAGE_PATH} - DOMAIN "CPUNET" - BOARD ${CONFIG_DOMAIN_CPUNET_BOARD} - ) - endif() - -endif() - add_subdirectory(common) diff --git a/samples/bluetooth/peripheral_uart/nrf5340dk_app_sr_net.conf b/samples/bluetooth/peripheral_uart/nrf5340dk_app_sr_net.conf index 98da3f134528..3b93b0f89ee5 100644 --- a/samples/bluetooth/peripheral_uart/nrf5340dk_app_sr_net.conf +++ b/samples/bluetooth/peripheral_uart/nrf5340dk_app_sr_net.conf @@ -6,4 +6,3 @@ CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_NRF53_UPGRADE_NETWORK_CORE=y -CONFIG_ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS=y diff --git a/samples/common/mcumgr_bt_ota_dfu/rpmsg_child_image_overlay.conf b/samples/common/mcumgr_bt_ota_dfu/rpmsg_child_image_overlay.conf deleted file mode 100644 index 0d200267521e..000000000000 --- a/samples/common/mcumgr_bt_ota_dfu/rpmsg_child_image_overlay.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Align Bluetooth buffers with the Application image -CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y - -# Reduce the maximum connection number to fit the image into RAM memory. -CONFIG_BT_MAX_CONN=10 diff --git a/scripts/bluetooth/mesh/mesh_dfu_metadata.py b/scripts/bluetooth/mesh/mesh_dfu_metadata.py index 2ba3757d6686..abcd6d85120d 100644 --- a/scripts/bluetooth/mesh/mesh_dfu_metadata.py +++ b/scripts/bluetooth/mesh/mesh_dfu_metadata.py @@ -34,7 +34,6 @@ def exit_with_error_msg(): traceback.print_exc() print("Extracting BLE Mesh metadata failed") - print("You can bypass this script by disabling the CONFIG_BT_MESH_DFU_METADATA_ON_BUILD option in your project config") sys.exit(0) @@ -399,16 +398,8 @@ def existing_metadata_print(path): args = input_parse() sysbuild_config_path = os.path.abspath(os.path.join(args.bin_path, '.config.sysbuild')) - - if os.path.isfile(sysbuild_config_path): - # Sysbuild - zip_path = os.path.abspath(os.path.join(args.bin_path, '..', '..', 'dfu_application.zip')) - sysbuild = True - else: - # Child/parent image - zip_path = os.path.abspath(os.path.join(args.bin_path, 'dfu_application.zip')) - sysbuild = False - + zip_path = os.path.abspath(os.path.join(args.bin_path, '..', '..', 'dfu_application.zip')) + sysbuild = True metadata_path = os.path.abspath(os.path.join(args.bin_path, FILE_NAME)) config_path = os.path.abspath(os.path.join(args.bin_path, '.config')) kconfigs = KConfig.from_file(config_path) diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt index 80023be74eea..58a0d7e83d62 100644 --- a/subsys/CMakeLists.txt +++ b/subsys/CMakeLists.txt @@ -6,21 +6,11 @@ add_subdirectory_ifdef(CONFIG_BT bluetooth) -add_subdirectory_ifdef(CONFIG_BOOTLOADER_MCUBOOT bootloader/bl_override) add_subdirectory_ifdef(CONFIG_IS_SECURE_BOOTLOADER bootloader) -if(NOT (SYSBUILD OR NCS_SYSBUILD_PARTITION_MANAGER)) - add_subdirectory_ifdef(CONFIG_SECURE_BOOT bootloader/image) -endif() add_subdirectory_ifdef(CONFIG_SECURE_BOOT_CRYPTO bootloader/bl_crypto) add_subdirectory_ifdef(CONFIG_SECURE_BOOT_VALIDATION bootloader/bl_validation) add_subdirectory_ifdef(CONFIG_SECURE_BOOT_STORAGE bootloader/bl_storage) -if(NOT SYSBUILD) - if(CONFIG_BOOTLOADER_PROVISION_HEX) - include(bootloader/cmake/provision_hex.cmake) - endif() -endif() - add_subdirectory_ifdef(CONFIG_NRF_SECURITY nrf_security) add_subdirectory_ifdef(CONFIG_TRUSTED_STORAGE trusted_storage) diff --git a/subsys/bluetooth/mesh/CMakeLists.txt b/subsys/bluetooth/mesh/CMakeLists.txt index e58a83dfa059..047cdcc8b28b 100644 --- a/subsys/bluetooth/mesh/CMakeLists.txt +++ b/subsys/bluetooth/mesh/CMakeLists.txt @@ -80,9 +80,3 @@ zephyr_linker_sources(SECTIONS sensor_types.ld) zephyr_linker_sources(SECTIONS scene_types.ld) zephyr_library_sources_ifdef(CONFIG_BT_MESH_RPL_STORAGE_MODE_EMDS rpl.c) - -if(CONFIG_SIGN_IMAGES AND CONFIG_BT_MESH_DFU_METADATA_ON_BUILD) - # Child/parent image - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/mesh_dfu_metadata.cmake) - mesh_dfu_metadata() -endif() diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 41071f4e1be4..55cca2e5a97e 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -129,16 +129,6 @@ choice TFM_PROFILE_TYPE default TFM_PROFILE_TYPE_NOT_SET endchoice -config BT_MESH_DFU_METADATA_ON_BUILD - bool "Generate DFU metadata on build" - default y if BT_MESH_DFU_SRV - depends on SIGN_IMAGES - help - Generate a JSON file containing all DFU related metadata upon - application build. The JSON will be added to dfu application zip - file stored in the project binary folder of your project, along - with the application update image. - rsource "Kconfig.models" rsource "Kconfig.dk_prov" rsource "shell/Kconfig" diff --git a/subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf b/subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf deleted file mode 100644 index 39302d470782..000000000000 --- a/subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# The application configuration does not apply to the network core. This file is needed to align -# the advertiser configuration on the controller configuration with the default host configuration -# set for the Bluetooth Mesh subsystem. See ncs/nrf/subsys/bluetooth/mesh/Kconfig for the default -# configuration. -CONFIG_BT_EXT_ADV=y -CONFIG_BT_EXT_ADV_MAX_ADV_SET=5 diff --git a/subsys/bluetooth/services/fast_pair/CMakeLists.txt b/subsys/bluetooth/services/fast_pair/CMakeLists.txt index 691ee6f38df3..2938fb20996f 100644 --- a/subsys/bluetooth/services/fast_pair/CMakeLists.txt +++ b/subsys/bluetooth/services/fast_pair/CMakeLists.txt @@ -39,59 +39,10 @@ if(CONFIG_BT_FAST_PAIR_FMDN) target_link_libraries(fast_pair PRIVATE fmdn) endif() -if(SYSBUILD) zephyr_get(FP_DATA_PRESENT MERGE SYSBUILD) - if(NOT FP_DATA_PRESENT AND TARGET zephyr_interface) - zephyr_compile_definitions( - FP_DATA_NOT_PRESENT - ) - endif() -endif() - -if(NOT SYSBUILD) - set(FP_PARTITION_NAME bt_fast_pair) - - set( - FP_PROVISIONING_DATA_HEX - ${CMAKE_BINARY_DIR}/modules/nrf/subsys/bluetooth/services/fast_pair/fp_provisioning_data.hex - ) - - set(FP_PROVISIONING_DATA_ADDRESS $) - - if(NOT DEFINED FP_MODEL_ID OR NOT DEFINED FP_ANTI_SPOOFING_KEY) - message(FATAL_ERROR "FP_MODEL_ID and FP_ANTI_SPOOFING_KEY build variables must be specified.") - endif() - - add_custom_command( - OUTPUT - ${FP_PROVISIONING_DATA_HEX} - DEPENDS - "${CMAKE_BINARY_DIR}/pm.config" - COMMAND - ${PYTHON_EXECUTABLE} ${ZEPHYR_NRF_MODULE_DIR}/scripts/nrf_provision/fast_pair/fp_provision_cli.py - -o ${FP_PROVISIONING_DATA_HEX} -a ${FP_PROVISIONING_DATA_ADDRESS} - -m ${FP_MODEL_ID} -k ${FP_ANTI_SPOOFING_KEY} - COMMENT - "Generating Fast Pair provisioning data hex file" - USES_TERMINAL - ) - - add_custom_target( - ${FP_PARTITION_NAME}_target - DEPENDS - "${FP_PROVISIONING_DATA_HEX}" - ) - - set_property( - GLOBAL PROPERTY - ${FP_PARTITION_NAME}_PM_HEX_FILE - "${FP_PROVISIONING_DATA_HEX}" - ) - - set_property( - GLOBAL PROPERTY - ${FP_PARTITION_NAME}_PM_TARGET - ${FP_PARTITION_NAME}_target +if(NOT FP_DATA_PRESENT AND TARGET zephyr_interface) + zephyr_compile_definitions( + FP_DATA_NOT_PRESENT ) endif() diff --git a/subsys/bootloader/CMakeLists.txt b/subsys/bootloader/CMakeLists.txt index 7bbcb9740892..ad4d43198ec3 100644 --- a/subsys/bootloader/CMakeLists.txt +++ b/subsys/bootloader/CMakeLists.txt @@ -8,16 +8,10 @@ add_subdirectory(bl_boot) zephyr_include_directories(include) -if(NOT IMAGE_NAME AND (NOT SYSBUILD OR (SYSBUILD AND NOT CONFIG_PARTITION_MANAGER_ENABLED))) +if(NOT IMAGE_NAME AND NOT CONFIG_PARTITION_MANAGER_ENABLED) message(WARNING "Building bootloader without associated application. " "Dummy values will be used for partition configuration." "Building bootloader without associated application. ") - if(NOT SYSBUILD) - message(WARNING "The idiomatic way of including the immutable bootloader is to set " - "the configuration 'CONFIG_SECURE_BOOTLOADER=y' in your applications " - "'prj.conf'.") - endif() - zephyr_include_directories(include/dummy_values/) endif() diff --git a/subsys/bootloader/Kconfig b/subsys/bootloader/Kconfig index a513b99ddf51..c8cad7c5f120 100644 --- a/subsys/bootloader/Kconfig +++ b/subsys/bootloader/Kconfig @@ -6,22 +6,6 @@ menu "Bootloader" -config BUILD_S1_VARIANT - # This can not depend on BOOTLOADER_MCUBOOT, or SECURE_BOOT as this - # option has to be set when building MCUBoot (or any other child image - # which will be stored in S0 and S1) itself. - bool "Build S1 variant of specified image" - help - Build upgrade candidate of image for alternative slot S1. - -config S1_VARIANT_IMAGE_NAME - string - default "mcuboot" if MCUBOOT || BOOTLOADER_MCUBOOT - default "app" if !BOOTLOADER_MCUBOOT - depends on BUILD_S1_VARIANT - help - Which image should be linked against S1. - config SECURE_BOOT bool "Use Secure Bootloader" depends on !IS_SECURE_BOOTLOADER @@ -31,106 +15,8 @@ config SECURE_BOOT Set this option to enable the first stage bootloader which verifies the signature of the app. -config BOOTLOADER_PROVISION_HEX - bool - default y if SECURE_BOOT - default y if MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION - help - Generate provision.hex if NSIB is enabled or if MCUboot hardware - counters are enabled. - if SECURE_BOOT -module=B0 -source "${ZEPHYR_BASE}/../nrf/subsys/partition_manager/Kconfig.template.build_strategy" - -config SB_PRIVATE_KEY_PROVIDED - bool - help - Hidden config specifying whether the build system has access to the - private key used for signing, and will use it to perform signing and - create the public key to be provisioned. - -choice SB_SIGNING - prompt "Firmware signing method" - default SB_SIGNING_PYTHON - config SB_SIGNING_PYTHON - bool "Sign with Python ecdsa library" - select SB_PRIVATE_KEY_PROVIDED - - config SB_SIGNING_OPENSSL - bool "Sign with openssl command line tool" - select SB_PRIVATE_KEY_PROVIDED - - config SB_SIGNING_CUSTOM - bool "Sign with custom command" -endchoice - -config SB_SIGNING_KEY_FILE - string - prompt "Private key PEM file" if SB_PRIVATE_KEY_PROVIDED - default "" - help - Absolute path to the private key PEM file. - Specifies the private key used for signing the firmware image. - The hash of the corresponding public key is stored as the first - entry in the list of public key hashes in the provision hex file. - See also SB_PUBLIC_KEY_FILES. - -config SB_SIGNING_COMMAND - string - prompt "Custom signing command" if !SB_PRIVATE_KEY_PROVIDED - default "" - help - This command will be called to produce a signature of the firmware. - It will be called as "${CONFIG_SB_SIGNING_COMMAND} " - The command must calculate the signature over the contents - of the and write the signature to stdout. - The signature must be on DER format. - -config SB_SIGNING_PUBLIC_KEY - string - prompt "Public key PEM file" if !SB_PRIVATE_KEY_PROVIDED - default "" - help - Path to a PEM file. - When using a custom signing command, specify the corresponding public - key here. This public key is checked during building, and added as - the first entry in the provisioned data. See SB_PUBLIC_KEY_FILES. - -config SB_PUBLIC_KEY_FILES - string "Public Key PEM files" - default "" - help - Comma-separated list of absolute paths to public key pem files. - The provision hex file will contain a list of hashes of public keys. - The first public key hash is the one corresponding to the private - signing key used to sign the image. See SB_SIGNING_KEY_FILE. - The hashes of the public keys specified in this configuration will be - placed after the aforementioned public key hash, in the order - they appear in this config. The order is significant since if an image - is successfully validated against a public key in the list, all - public keys before it in the list will be invalidated. - Example value: ~/keys/pk1.pem,~/keys/pk2.pem,~/keys/pk3.pem - If config is the string "debug", 2 generated debug files will be used. - If config is an empty string then only the public key hash - corresponding to the private signing key used to sign the image is - included in provision.hex. - -config SB_DEBUG_SIGNATURE_PUBLIC_KEY_LAST - bool "[DEBUG] Place signing public key last" - default n - help - Place the public key used for signing last in the list instead of - first. This is meant to be used for testing looping through the - public keys. - -config SB_DEBUG_NO_VERIFY_HASHES - bool - help - [DEBUG] Don't check public key hashes for applicability. - Use this only in (negative) tests! - config SB_MONOTONIC_COUNTER bool "Enable HW monotonic version counter" default y diff --git a/subsys/bootloader/bl_override/CMakeLists.txt b/subsys/bootloader/bl_override/CMakeLists.txt deleted file mode 100644 index efc44cf606f8..000000000000 --- a/subsys/bootloader/bl_override/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if (CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK) - add_overlay_config( - mcuboot - ${CMAKE_CURRENT_SOURCE_DIR}/override_external_mcuboot.conf - ) -endif() diff --git a/subsys/bootloader/cmake/provision_hex.cmake b/subsys/bootloader/cmake/provision_hex.cmake deleted file mode 100644 index 4c1e5ab3b5cd..000000000000 --- a/subsys/bootloader/cmake/provision_hex.cmake +++ /dev/null @@ -1,167 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This CMakeLists.txt is executed only by the parent application -# and generates the provision.hex file. - -set_ifndef(partition_manager_target partition_manager) - -if(NCS_SYSBUILD_PARTITION_MANAGER) - # Get the main app of the domain that secure boot should handle. - get_property(main_app GLOBAL PROPERTY DOMAIN_APP_${SB_CONFIG_SECURE_BOOT_DOMAIN}) - ExternalProject_Get_Property(${main_app} BINARY_DIR) - import_kconfig(CONFIG_ ${BINARY_DIR}/zephyr/.config) - sysbuild_get(APPLICATION_CONFIG_DIR IMAGE ${main_app} VAR APPLICATION_CONFIG_DIR CACHE) -endif() - -if (CONFIG_NCS_IS_VARIANT_IMAGE) - # When building the variant of an image, the configuration of the variant image - # is identical to the base image, except 'CONFIG_NCS_IS_VARIANT_IMAGE'. This file is - # included when provisioning, which can be the case for the base - # image. However, the logic in this file should only be performed once, for - # the base image, not for the variant variant. Hence, we have this check to avoid - # execution of this file for the variant image. - return() -endif() - -# Build and include hex file containing provisioned data for the bootloader. -set(PROVISION_HEX_NAME provision.hex) -set(PROVISION_HEX ${PROJECT_BINARY_DIR}/${PROVISION_HEX_NAME}) - -if(CONFIG_SECURE_BOOT) - if (DEFINED CONFIG_SB_MONOTONIC_COUNTER) - set(monotonic_counter_arg - --num-counter-slots-version ${CONFIG_SB_NUM_VER_COUNTER_SLOTS}) - endif() - - # Skip signing if MCUBoot is to be booted and its not built from source - if ((CONFIG_SB_VALIDATE_FW_SIGNATURE OR CONFIG_SB_VALIDATE_FW_HASH) AND - ((NOT (CONFIG_BOOTLOADER_MCUBOOT AND NOT CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE)) OR NCS_SYSBUILD_PARTITION_MANAGER)) - - # Input is comma separated string, convert to CMake list type - string(REPLACE "," ";" PUBLIC_KEY_FILES_LIST "${CONFIG_SB_PUBLIC_KEY_FILES}") - - include(${CMAKE_CURRENT_LIST_DIR}/debug_keys.cmake) - include(${CMAKE_CURRENT_LIST_DIR}/sign.cmake) - - if (${CONFIG_SB_DEBUG_SIGNATURE_PUBLIC_KEY_LAST}) - message(WARNING - " - ----------------------------------------------------------------- - --- WARNING: SB_DEBUG_SIGNATURE_PUBLIC_KEY_LAST is enabled. --- - --- This config should only be enabled for testing/debugging. --- - -----------------------------------------------------------------") - list(APPEND PUBLIC_KEY_FILES ${SIGNATURE_PUBLIC_KEY_FILE}) - else() - list(INSERT PUBLIC_KEY_FILES 0 ${SIGNATURE_PUBLIC_KEY_FILE}) - endif() - - # Convert CMake list type back to comma separated string. - string(REPLACE ";" "," PUBLIC_KEY_FILES "${PUBLIC_KEY_FILES}") - - set(public_keys_file_arg - --public-key-files "${PUBLIC_KEY_FILES}" - ) - - set(PROVISION_DEPENDS signature_public_key_file_target) - endif() - - # Adjustment to be able to load into sysbuild - if (CONFIG_SOC_NRF5340_CPUNET OR "${domain}" STREQUAL "CPUNET") - set(s0_arg --s0-addr $) - else() - set(s0_arg --s0-addr $) - set(s1_arg --s1-addr $) - endif() - - if (CONFIG_SB_DEBUG_NO_VERIFY_HASHES) - set(no_verify_hashes_arg --no-verify-hashes) - endif() -endif() - -if(CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) - set(mcuboot_counters_slots --mcuboot-counters-slots ${CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_SLOTS}) -endif() - -if(CONFIG_SECURE_BOOT) -add_custom_command( - OUTPUT - ${PROVISION_HEX} - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/provision.py - ${s0_arg} - ${s1_arg} - --provision-addr $ - ${public_keys_file_arg} - --output ${PROVISION_HEX} - --max-size ${CONFIG_PM_PARTITION_SIZE_PROVISION} - ${monotonic_counter_arg} - ${no_verify_hashes_arg} - ${mcuboot_counters_slots} - DEPENDS - ${PROVISION_KEY_DEPENDS} - ${PROVISION_DEPENDS} - WORKING_DIRECTORY - ${PROJECT_BINARY_DIR} - COMMENT - "Creating data to be provisioned to the Bootloader, storing to ${PROVISION_HEX_NAME}" - USES_TERMINAL - ) -elseif(CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) -add_custom_command( - OUTPUT - ${PROVISION_HEX} - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/provision.py - --mcuboot-only - --provision-addr $ - --output ${PROVISION_HEX} - --max-size ${CONFIG_PM_PARTITION_SIZE_PROVISION} - ${mcuboot_counters_num} - ${mcuboot_counters_slots} - DEPENDS - ${PROVISION_KEY_DEPENDS} - WORKING_DIRECTORY - ${PROJECT_BINARY_DIR} - COMMENT - "Creating data to be provisioned to the Bootloader, storing to ${PROVISION_HEX_NAME}" - USES_TERMINAL - ) -endif() - - -if(CONFIG_SECURE_BOOT OR CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) - add_custom_target( - provision_target - DEPENDS - ${PROVISION_HEX} - ${PROVISION_DEPENDS} - ) - - get_property( - provision_set - GLOBAL PROPERTY provision_PM_HEX_FILE SET - ) - - if(NOT provision_set) - # Set hex file and target for the 'provision' placeholder partition. - # This includes the hex file (and its corresponding target) to the build. - set_property( - GLOBAL PROPERTY - provision_PM_HEX_FILE - ${PROVISION_HEX} - ) - - set_property( - GLOBAL PROPERTY - provision_PM_TARGET - provision_target - ) - endif() - -endif() diff --git a/subsys/bootloader/cmake/sign.cmake b/subsys/bootloader/cmake/sign.cmake deleted file mode 100644 index 03215a8f45b2..000000000000 --- a/subsys/bootloader/cmake/sign.cmake +++ /dev/null @@ -1,264 +0,0 @@ -# -# Copyright (c) 2018 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -set(GENERATED_PATH ${PROJECT_BINARY_DIR}/nrf/subsys/bootloader/generated) - -# This is needed for make, ninja is able to resolve and create the path but make -# is not able to resolve it. -file(MAKE_DIRECTORY ${GENERATED_PATH}) - -set(SIGNATURE_PUBLIC_KEY_FILE ${GENERATED_PATH}/public.pem) - -if (CONFIG_SB_SIGNING_PYTHON) - set(PUB_GEN_CMD - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/keygen.py - --public - --in ${SIGNATURE_PRIVATE_KEY_FILE} - --out ${SIGNATURE_PUBLIC_KEY_FILE} - ) -elseif (CONFIG_SB_SIGNING_OPENSSL) - set(PUB_GEN_CMD - openssl ec - -pubout - -in ${SIGNATURE_PRIVATE_KEY_FILE} - -out ${SIGNATURE_PUBLIC_KEY_FILE} - ) -elseif (CONFIG_SB_SIGNING_CUSTOM) - set(SIGNATURE_PUBLIC_KEY_FILE ${CONFIG_SB_SIGNING_PUBLIC_KEY}) - if (NOT EXISTS ${SIGNATURE_PUBLIC_KEY_FILE} OR IS_DIRECTORY ${SIGNATURE_PUBLIC_KEY_FILE}) - message(WARNING "Invalid public key file: ${SIGNATURE_PUBLIC_KEY_FILE}") - endif() -else () - message(WARNING "Unable to parse signing config.") -endif() - -if (CONFIG_SB_PRIVATE_KEY_PROVIDED) - add_custom_command( - OUTPUT - ${SIGNATURE_PUBLIC_KEY_FILE} - COMMAND - ${PUB_GEN_CMD} - DEPENDS - ${SIGNATURE_PRIVATE_KEY_FILE} - COMMENT - "Creating public key from private key used for signing" - WORKING_DIRECTORY - ${PROJECT_BINARY_DIR} - USES_TERMINAL - ) -endif() - -# Public key file target is required for all signing options -add_custom_target( - signature_public_key_file_target - DEPENDS - ${SIGNATURE_PUBLIC_KEY_FILE} - ) - -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/bl_validation_magic.cmake) - -set(slots s0_image) -if (CONFIG_SECURE_BOOT AND CONFIG_SOC_NRF5340_CPUNET AND NOT NCS_SYSBUILD_PARTITION_MANAGER) - list(APPEND slots app) -endif() - -if(NCS_SYSBUILD_PARTITION_MANAGER AND "${SB_CONFIG_SECURE_BOOT_DOMAIN}" STREQUAL "CPUNET") - get_property(domain_app GLOBAL PROPERTY DOMAIN_APP_${SB_CONFIG_SECURE_BOOT_DOMAIN}) - set(slots ${domain_app}) -endif() - -if (CONFIG_BUILD_S1_VARIANT) - list(APPEND slots s1_image) -endif () - -if (NOT "${CONFIG_SB_VALIDATION_INFO_CRYPTO_ID}" EQUAL "1") - message(FATAL_ERROR - "This value of SB_VALIDATION_INFO_CRYPTO_ID is not supported") -endif() - -foreach (slot ${slots}) - set(signed_hex ${PROJECT_BINARY_DIR}/signed_by_b0_${slot}.hex) - set(signed_bin ${PROJECT_BINARY_DIR}/signed_by_b0_${slot}.bin) - -if(NCS_SYSBUILD_PARTITION_MANAGER) - # A container can be merged, in which case we should use old style below, - # or it may be an actual image, where we know everything. - # Initial support disregards the merged hex files. - # In parent-child, everything is merged, even when having a single image in a - # container (where the original image == the merged image). - if(TARGET ${slot}) - # If slot is a target of it's own, then it means we target the hex directly and not a merged hex. - sysbuild_get(${slot}_image_dir IMAGE ${slot} VAR APPLICATION_BINARY_DIR CACHE) - sysbuild_get(${slot}_kernel_name IMAGE ${slot} VAR CONFIG_KERNEL_BIN_NAME KCONFIG) - - set(slot_hex ${${slot}_image_dir}/zephyr/${${slot}_kernel_name}.hex) - set(sign_depends ${${slot}_image_dir}/zephyr/${${slot}_kernel_name}.hex) - else() - set(slot_hex ${PROJECT_BINARY_DIR}/${slot}.hex) - set(sign_depends ${slot}_hex) - endif() -else() - if ("${slot}" STREQUAL "s1_image") - # The s1_image slot is built as a child image, add the dependency and - # path to its hex file accordingly. We cannot use the shared variables - # from the s1 child image since its configure stage might not have executed - # yet. - set(slot_hex ${CMAKE_BINARY_DIR}/s1_image/zephyr/zephyr.hex) - set(sign_depends s1_image_subimage) - else() - set(slot_hex ${PROJECT_BINARY_DIR}/${slot}.hex) - set(sign_depends ${slot}_hex) - endif() - list(APPEND sign_depends ${slot_hex} ${SIGN_KEY_FILE_DEPENDS}) -endif() - - set(to_sign ${slot_hex}) - set(hash_file ${GENERATED_PATH}/${slot}_firmware.sha256) - set(signature_file ${GENERATED_PATH}/${slot}_firmware.signature) - - set(hash_cmd - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/hash.py - --in ${to_sign} - > ${hash_file} - ) - - if (CONFIG_SB_SIGNING_PYTHON) - set(sign_cmd - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/do_sign.py - --private-key ${SIGNATURE_PRIVATE_KEY_FILE} - --in ${hash_file} - > ${signature_file} - ) - elseif (CONFIG_SB_SIGNING_OPENSSL) - set(sign_cmd - openssl dgst - -sha256 - -sign ${SIGNATURE_PRIVATE_KEY_FILE} ${hash_file} | - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/asn1parse.py - --alg ecdsa - --contents signature - > ${signature_file} - ) - elseif (CONFIG_SB_SIGNING_CUSTOM) - set(custom_sign_cmd "${CONFIG_SB_SIGNING_COMMAND}") - - if (("${custom_sign_cmd}" STREQUAL "") OR (NOT EXISTS ${SIGNATURE_PUBLIC_KEY_FILE})) - message(FATAL_ERROR "You must specify a signing command and valid public key file for custom signing.") - endif() - - string(APPEND custom_sign_cmd " ${hash_file} > ${signature_file}") - string(REPLACE " " ";" sign_cmd ${custom_sign_cmd}) - else () - message(WARNING "Unable to parse signing config.") - endif() - - add_custom_command( - OUTPUT - ${signature_file} - COMMAND - ${hash_cmd} - COMMAND - ${sign_cmd} - DEPENDS - ${sign_depends} - WORKING_DIRECTORY - ${PROJECT_BINARY_DIR} - COMMENT - "Creating signature of application" - USES_TERMINAL - COMMAND_EXPAND_LISTS - ) - - add_custom_target( - ${slot}_signature_file_target - DEPENDS - ${signature_file} - ) - - add_custom_command( - OUTPUT - ${signed_hex} - ${signed_bin} - COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/validation_data.py - --input ${to_sign} - --output-hex ${signed_hex} - --output-bin ${signed_bin} - --offset ${CONFIG_SB_VALIDATION_METADATA_OFFSET} - --signature ${signature_file} - --public-key ${SIGNATURE_PUBLIC_KEY_FILE} - --magic-value "${VALIDATION_INFO_MAGIC}" - DEPENDS - ${SIGN_KEY_FILE_DEPENDS} - ${signature_file} - ${slot}_signature_file_target - ${SIGNATURE_PUBLIC_KEY_FILE} - WORKING_DIRECTORY - ${PROJECT_BINARY_DIR} - COMMENT - "Creating validation for ${KERNEL_HEX_NAME}, storing to ${SIGNED_KERNEL_HEX_NAME}" - USES_TERMINAL - ) - - add_custom_target( - ${slot}_signed_kernel_hex_target - DEPENDS - ${signed_hex} - ${slot}_signature_file_target - signature_public_key_file_target - ) - - # Set hex file and target for the ${slot) (s0/s1) container partition. - # This includes the hex file (and its corresponding target) to the build. - set_property( - GLOBAL PROPERTY - ${slot}_PM_HEX_FILE - ${signed_hex} - ) - - set_property( - GLOBAL PROPERTY - ${slot}_PM_TARGET - ${slot}_signed_kernel_hex_target - ) - -endforeach() - - -if (CONFIG_BUILD_S1_VARIANT AND NOT CONFIG_BOOTLOADER_MCUBOOT) - # B0 will boot the app directly, create the DFU zip. If MCUBoot is enabled, - # the DFU zip files is generated by the MCUBoot build code. - - # Create dependency to ensure explicit build order. This is needed to have - # a single target represent the state when both s0 and s1 imags are built. - add_dependencies( - s1_image_signed_kernel_hex_target - s0_image_signed_kernel_hex_target - ) - - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/fw_zip.cmake) - - # Generate zip file with both update candidates - set(s0_name signed_by_b0_s0_image.bin) - set(s0_bin_path ${PROJECT_BINARY_DIR}/${s0_name}) - set(s1_name signed_by_b0_s1_image.bin) - set(s1_bin_path ${PROJECT_BINARY_DIR}/${s1_name}) - - generate_dfu_zip( - OUTPUT ${PROJECT_BINARY_DIR}/dfu_application.zip - BIN_FILES ${s0_bin_path} ${s1_bin_path} - TYPE application - SCRIPT_PARAMS - "${s0_name}load_address=$" - "${s1_name}load_address=$" - "version_B0=${CONFIG_FW_INFO_FIRMWARE_VERSION}" - ) -endif() diff --git a/subsys/bootloader/image/CMakeLists.txt b/subsys/bootloader/image/CMakeLists.txt deleted file mode 100644 index e8a460beef05..000000000000 --- a/subsys/bootloader/image/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This CMakeLists.txt is executed by the root application only when -# B0 (SECURE_BOOT) is enabled. First, figure out what image will be -# booted by B0, and set the required properties for that image to be -# bootable by B0. - -if (CONFIG_NCS_IS_VARIANT_IMAGE) - # When building the a variant of an image, the configuration of the variant image - # is identical to the base image, except 'CONFIG_NCS_IS_VARIANT_IMAGE'. This file is - # included if 'CONFIG_SECURE_BOOT' is set, which can be the case for the base - # image. However, the logic in this file should only be performed once, for - # the base image, not for the variant variant. Hence, we have this check to avoid - # execution of this file for the variant image. - return() -endif() - -if (CONFIG_BOOTLOADER_MCUBOOT) - set(image_to_boot mcuboot) - - add_overlay_config( - mcuboot - ${CMAKE_CURRENT_SOURCE_DIR}/multi_image_mcuboot.conf - ) -endif() - -if (image_to_boot) - # Include a kconfig file which enables CONFIG_FW_INFO in the image - # which is booted by B0. - add_overlay_config( - ${image_to_boot} - ${CMAKE_CURRENT_SOURCE_DIR}/fw_info.conf - ) -else() - assert(CONFIG_FW_INFO "CONFIG_FW_INFO must be set") -endif() diff --git a/subsys/net/lib/nrf70_fw_ext/Kconfig b/subsys/net/lib/nrf70_fw_ext/Kconfig index bea2c33d5fb5..170058e96f8f 100644 --- a/subsys/net/lib/nrf70_fw_ext/Kconfig +++ b/subsys/net/lib/nrf70_fw_ext/Kconfig @@ -68,7 +68,6 @@ config NRF_WIFI_FW_PATCH_DFU bool "Direct Firmware Update of nRF70 FW patch" depends on PARTITION_MANAGER_ENABLED depends on BOOTLOADER_MCUBOOT - depends on !XIP_SPLIT_IMAGE help Enabling this option adds support for Device Firmware Update (DFU) for the nRF70 Series Firmware Patch. diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota index 4a2d47c7a5bd..9be157ab82c6 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota @@ -149,7 +149,7 @@ config NRF_CLOUD_FOTA_TYPE_APP_SUPPORTED config NRF_CLOUD_FOTA_TYPE_BOOT_SUPPORTED bool - default y if (BOOTLOADER_MCUBOOT && BUILD_S1_VARIANT && SECURE_BOOT && \ + default y if (BOOTLOADER_MCUBOOT && MCUBOOT_MCUBOOT_IMAGE_NUMBER != -1 && \ NRF_CLOUD_FOTA_TRANSPORT_ENABLED) help This symbol is y when bootloader FOTA is supported by the configuration. diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps index 7d3d68762fbb..7298b346c133 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps @@ -130,7 +130,7 @@ config NRF_CLOUD_PGPS_SOCKET_RETRIES choice NRF_CLOUD_PGPS_STORAGE prompt "nRF Cloud P-GPS persistent storage location" - default NRF_CLOUD_PGPS_STORAGE_PARTITION if BUILD_S1_VARIANT + default NRF_CLOUD_PGPS_STORAGE_PARTITION if MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP || MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT || MCUBOOT_BOOTLOADER_MODE_RAM_LOAD default NRF_CLOUD_PGPS_STORAGE_MCUBOOT_SECONDARY if BOARD_THINGY91_NRF9160_NS help The P-GPS subsystem requires a contiguous section of flash memory in @@ -149,7 +149,7 @@ config NRF_CLOUD_PGPS_STORAGE_MCUBOOT_SECONDARY bool "Reuse MCUboot secondary partition for P-GPS storage" depends on BOOTLOADER_MCUBOOT depends on IMG_MANAGER - depends on !BUILD_S1_VARIANT + depends on !MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP && !MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT && !MCUBOOT_BOOTLOADER_MODE_RAM_LOAD help If set, use the secondary MCUboot partition to also store P-GPS data. Note that when a FOTA job executes, this data will be lost and will diff --git a/subsys/partition_manager/CMakeLists.txt b/subsys/partition_manager/CMakeLists.txt index a5500c480322..f0f99fe21740 100644 --- a/subsys/partition_manager/CMakeLists.txt +++ b/subsys/partition_manager/CMakeLists.txt @@ -13,11 +13,7 @@ if (CONFIG_PARTITION_MANAGER_ENABLED) endif() # Hacked location, but currently we need it and child image is not used. - -if(SYSBUILD) - set_shared(IMAGE ${IMAGE_NAME} PROPERTY ZEPHYR_BINARY_DIR ${ZEPHYR_BINARY_DIR}) -endif() - +set_shared(IMAGE ${IMAGE_NAME} PROPERTY ZEPHYR_BINARY_DIR ${ZEPHYR_BINARY_DIR}) function(preprocess_pm_yml in_file out_file) execute_process( @@ -36,20 +32,17 @@ function(preprocess_pm_yml in_file out_file) message(FATAL_ERROR "command failed with return code: ${ret}") endif() - if (DEFINED IMAGE_NAME OR SYSBUILD) - # Share location of original source file so that the parent image can add it - # to the CMAKE_CONFIGURE_DEPENDS list. - set_shared(IMAGE ${IMAGE_NAME} APPEND PROPERTY PM_YML_DEP_FILES ${in_file}) + # Share location of original source file so that the parent image can add it + # to the CMAKE_CONFIGURE_DEPENDS list. + set_shared(IMAGE ${IMAGE_NAME} APPEND PROPERTY PM_YML_DEP_FILES ${in_file}) - # Share location of preprocessed pm.yml file so that the parent image can - # use it as source for partition manager configuration. - set_shared(IMAGE ${IMAGE_NAME} APPEND PROPERTY PM_YML_FILES ${out_file}) - endif() + # Share location of preprocessed pm.yml file so that the parent image can + # use it as source for partition manager configuration. + set_shared(IMAGE ${IMAGE_NAME} APPEND PROPERTY PM_YML_FILES ${out_file}) # Re-configure (Re-execute all CMakeLists.txt code) when original # (not preprocessed) configuration file changes. set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${in_file}) - endfunction() @@ -140,24 +133,17 @@ endif() # We are using partition manager if we are a child image or if we are # the root image and the 'partition_manager' target exists. -if (SYSBUILD) - set(using_partition_manager 1) -else() - set(using_partition_manager - $,$> - ) -endif() zephyr_compile_definitions( - USE_PARTITION_MANAGER=${using_partition_manager} + USE_PARTITION_MANAGER=1 ) # TODO: check how this patch got lost and if more are missing set_property(GLOBAL APPEND PROPERTY PROPERTY_LINKER_SCRIPT_DEFINES - -DUSE_PARTITION_MANAGER=${using_partition_manager} + -DUSE_PARTITION_MANAGER=1 ) -if((EXISTS ${CMAKE_SOURCE_DIR}/pm.yml) AND (IMAGE_NAME OR (SYSBUILD AND NOT SYSBUILD_MAIN_APP))) +if((EXISTS ${CMAKE_SOURCE_DIR}/pm.yml) AND (IMAGE_NAME OR NOT SYSBUILD_MAIN_APP)) # Only preprocess pm.yml when being built as sub image. preprocess_pm_yml( diff --git a/subsys/partition_manager/Kconfig b/subsys/partition_manager/Kconfig index 1ac7b3f068e9..3f3ba8b6db28 100644 --- a/subsys/partition_manager/Kconfig +++ b/subsys/partition_manager/Kconfig @@ -218,7 +218,6 @@ config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY # option is propagated to the MCUboot child image automatically. depends on PM_EXTERNAL_FLASH_ENABLED || MCUBOOT default y if BOOTLOADER_MCUBOOT - imply ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS help Place the secondary partition of MCUboot in the external flash instead of the internal flash. This option should only be enabled by the user diff --git a/subsys/partition_manager/Kconfig.template.build_strategy b/subsys/partition_manager/Kconfig.template.build_strategy deleted file mode 100644 index 8e1b46091877..000000000000 --- a/subsys/partition_manager/Kconfig.template.build_strategy +++ /dev/null @@ -1,34 +0,0 @@ -if !HIDE_CHILD_PARENT_CONFIG - -choice - prompt "$(module) build strategy" - default $(module)_BUILD_STRATEGY_FROM_SOURCE - -config $(module)_BUILD_STRATEGY_USE_HEX_FILE - # Mandatory option when being built through add_child_image' - bool "Use hex file instead of building $(module)" - select PM_IMAGE_NOT_BUILT_FROM_SOURCE - select PARTITION_MANAGER_ENABLED - -if $(module)_BUILD_STRATEGY_USE_HEX_FILE - -config $(module)_HEX_FILE - # Mandatory option when being built through add_child_image' - string "$(module) hex file" - -endif # $(module)_BUILD_STRATEGY_USE_HEX_FILE - -config $(module)_BUILD_STRATEGY_SKIP_BUILD - # Mandatory option when being built through add_child_image' - bool "Skip building $(module)" - select PM_IMAGE_NOT_BUILT_FROM_SOURCE - select PARTITION_MANAGER_ENABLED - -config $(module)_BUILD_STRATEGY_FROM_SOURCE - # Mandatory option when being built through add_child_image' - bool "Build from source" - select PARTITION_MANAGER_ENABLED - -endchoice - -endif diff --git a/tests/modules/mcuboot/direct_xip/child_image/mcuboot.conf b/tests/modules/mcuboot/direct_xip/child_image/mcuboot.conf deleted file mode 100644 index 6808e7be7168..000000000000 --- a/tests/modules/mcuboot/direct_xip/child_image/mcuboot.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_BOOT_DIRECT_XIP=y -CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000 diff --git a/tests/modules/mcuboot/direct_xip/testcase.yaml b/tests/modules/mcuboot/direct_xip/testcase.yaml index b8d609be3507..8896626360ea 100644 --- a/tests/modules/mcuboot/direct_xip/testcase.yaml +++ b/tests/modules/mcuboot/direct_xip/testcase.yaml @@ -9,14 +9,3 @@ tests: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 - nrf5340dk/nrf5340/cpuapp - # Deprecated child and parent build to ensure feature does not break until it is removed - mcuboot.direct_xip.child_parent: - sysbuild: false - tags: mcuboot direct_xip child_parent deprecated ci_tests_modules_mcuboot - platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 - nrf5340dk/nrf5340/cpuapp - integration_platforms: - - nrf9160dk/nrf9160 - - nrf52840dk/nrf52840 - - nrf52dk/nrf52832 - - nrf5340dk/nrf5340/cpuapp diff --git a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay b/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index fcc2e240fd9e..000000000000 --- a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; diff --git a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index cf77dbe7f356..000000000000 --- a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - - -# The following configurations are required to support simultaneous multi image update -CONFIG_PCD_APP=y -CONFIG_UPDATEABLE_IMAGE_NUMBER=2 -CONFIG_FLASH_SIMULATOR=y -CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y -CONFIG_FLASH_SIMULATOR_STATS=n -CONFIG_BOOT_UPGRADE_ONLY=y - -CONFIG_SIZE_OPTIMIZATIONS=y diff --git a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay deleted file mode 100644 index fcc2e240fd9e..000000000000 --- a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; diff --git a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/thingy53_nrf5340_cpuapp.conf b/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/thingy53_nrf5340_cpuapp.conf deleted file mode 100644 index 8e0b8baae3c4..000000000000 --- a/tests/modules/mcuboot/external_flash/child_image/mcuboot/boards/thingy53_nrf5340_cpuapp.conf +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# MCUBoot serial -CONFIG_GPIO=y -CONFIG_BOOT_SERIAL_CDC_ACM=y - -# USB -CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_DEVICE_REMOTE_WAKEUP=n -CONFIG_USB_DEVICE_MANUFACTURER="Nordic Semiconductor ASA" -CONFIG_USB_DEVICE_PRODUCT="Bootloader Thingy:53" -CONFIG_USB_DEVICE_VID=0x1915 -CONFIG_USB_DEVICE_PID=0x5300 -CONFIG_USB_CDC_ACM=y - -# Decrease memory footprint -CONFIG_SPI=n -CONFIG_I2C=n -CONFIG_UART_NRFX=n - -# The following configurations are required to support simultaneous multi image update -CONFIG_PCD_APP=y -CONFIG_UPDATEABLE_IMAGE_NUMBER=2 -CONFIG_FLASH_SIMULATOR=y -CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y -CONFIG_FLASH_SIMULATOR_STATS=n -CONFIG_BOOT_UPGRADE_ONLY=y diff --git a/tests/modules/mcuboot/external_flash/child_image/mcuboot/prj.conf b/tests/modules/mcuboot/external_flash/child_image/mcuboot/prj.conf deleted file mode 100644 index 944f3c8b6f9d..000000000000 --- a/tests/modules/mcuboot/external_flash/child_image/mcuboot/prj.conf +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# In order to provide board specific configurations to the MCUboot child image -# we also need to provide a base configuration for MCUboot. This file contains -# the basic configurations needed to successfully build and run MCUboot. - -# MCUboot requires a large stack size, otherwise an MPU fault will occur -CONFIG_MAIN_STACK_SIZE=10240 - -# Enable flash operations -CONFIG_FLASH=y - -# This must be increased to accommodate the bigger images. -CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# Enable serial recovery -CONFIG_UART_CONSOLE=n -CONFIG_MCUBOOT_SERIAL=y -CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/tests/modules/mcuboot/external_flash/testcase.yaml b/tests/modules/mcuboot/external_flash/testcase.yaml index a994e6666848..b56716e1efd1 100644 --- a/tests/modules/mcuboot/external_flash/testcase.yaml +++ b/tests/modules/mcuboot/external_flash/testcase.yaml @@ -7,12 +7,3 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - thingy53/nrf5340/cpuapp - # Deprecated child and parent build to ensure feature does not break until it is removed - mcuboot.external_flash.child_parent: - sysbuild: false - platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp thingy53/nrf5340/cpuapp - tags: mcuboot external_flash child_parent deprecated ci_tests_modules_mcuboot - integration_platforms: - - nrf52840dk/nrf52840 - - nrf5340dk/nrf5340/cpuapp - - thingy53/nrf5340/cpuapp diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/CMakeLists.txt b/tests/subsys/bluetooth/mesh/metadata_extraction/CMakeLists.txt index 52b5368f0b65..0768a85c62ad 100644 --- a/tests/subsys/bluetooth/mesh/metadata_extraction/CMakeLists.txt +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/CMakeLists.txt @@ -18,12 +18,3 @@ if(CONFIG_COMP_DATA_LAYOUT_SINGLE) else() list(PREPEND script_args --multiple) endif() - -list(APPEND script_args childparent) - -if(NOT SYSBUILD) - add_custom_target(verify_metadata ALL - ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/verify_metadata.py ${script_args} - DEPENDS parse_mesh_metadata - ) -endif() diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf b/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf index e118e010754d..7f52173bd510 100644 --- a/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf @@ -15,7 +15,6 @@ CONFIG_BT_PERIPHERAL=y # Bluetooth Mesh configuration CONFIG_BT_MESH=y -CONFIG_BT_MESH_DFU_METADATA_ON_BUILD=y # Set to something other than default to check that it is parsed correctly CONFIG_BT_MESH_CRPL=64 diff --git a/tests/subsys/bootloader/bl_crypto/child_image/mcuboot.conf b/tests/subsys/bootloader/bl_crypto/child_image/mcuboot.conf deleted file mode 100644 index 562f839c88c8..000000000000 --- a/tests/subsys/bootloader/bl_crypto/child_image/mcuboot.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_EXT_API_PROVIDE_EXT_API_ATLEAST_OPTIONAL=y -CONFIG_REBOOT=y diff --git a/tests/subsys/bootloader/bl_crypto/testcase.yaml b/tests/subsys/bootloader/bl_crypto/testcase.yaml index a440aadd358f..cdd7749f5a07 100644 --- a/tests/subsys/bootloader/bl_crypto/testcase.yaml +++ b/tests/subsys/bootloader/bl_crypto/testcase.yaml @@ -18,23 +18,3 @@ tests: - nrf9160dk/nrf9160 - nrf9161dk/nrf9161 tags: b0 sysbuild ci_tests_subsys_bootloader - # Deprecated child and parent build to ensure feature does not break until it is removed - bootloader.bl_crypto.child_parent: - sysbuild: false - platform_allow: - - nrf52833dk/nrf52833 - - nrf52840dk/nrf52840 - - nrf52dk/nrf52832 - - nrf5340dk/nrf5340/cpuapp - - nrf9151dk/nrf9151 - - nrf9160dk/nrf9160 - - nrf9161dk/nrf9161 - integration_platforms: - - nrf52833dk/nrf52833 - - nrf52840dk/nrf52840 - - nrf52dk/nrf52832 - - nrf5340dk/nrf5340/cpuapp - - nrf9151dk/nrf9151 - - nrf9160dk/nrf9160 - - nrf9161dk/nrf9161 - tags: b0 child_parent deprecated ci_tests_subsys_bootloader diff --git a/tests/subsys/bootloader/bl_validation_ff_key/Kconfig b/tests/subsys/bootloader/bl_validation_ff_key/Kconfig deleted file mode 100644 index 587f28fdd11d..000000000000 --- a/tests/subsys/bootloader/bl_validation_ff_key/Kconfig +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config SB_DEBUG_NO_VERIFY_HASHES - bool - default y - -source "Kconfig.zephyr" diff --git a/tests/subsys/partition_manager/static_pm_file/testcase.yaml b/tests/subsys/partition_manager/static_pm_file/testcase.yaml index 254300f282d1..c05baf7ff7c8 100644 --- a/tests/subsys/partition_manager/static_pm_file/testcase.yaml +++ b/tests/subsys/partition_manager/static_pm_file/testcase.yaml @@ -9,9 +9,3 @@ tests: extra_args: - PM_STATIC_YML_FILE=test_file.yml tags: sysbuild - static_pm_file.child_parent: - platform_allow: nrf5340dk/nrf5340/cpuapp - integration_platforms: - - nrf5340dk/nrf5340/cpuapp - extra_args: - - PM_STATIC_YML_FILE=${CMAKE_CURRENT_SOURCE_DIR}/test_file.yml diff --git a/tests/subsys/pcd/child_image/hello_world.conf b/tests/subsys/pcd/child_image/hello_world.conf deleted file mode 100644 index 9059875e8efc..000000000000 --- a/tests/subsys/pcd/child_image/hello_world.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Enable B0N on the network core -CONFIG_SECURE_BOOT=y diff --git a/tests/subsys/pcd/testcase.yaml b/tests/subsys/pcd/testcase.yaml index 03728688ee7a..687ac46ddb42 100644 --- a/tests/subsys/pcd/testcase.yaml +++ b/tests/subsys/pcd/testcase.yaml @@ -5,10 +5,3 @@ tests: integration_platforms: - nrf5340dk/nrf5340/cpuapp tags: pcd sysbuild ci_tests_subsys_pcd - # Deprecated child and parent build to ensure feature does not break until it is removed - dfu.pcd.sysbuild.child_parent: - sysbuild: false - platform_allow: nrf5340dk/nrf5340/cpuapp - integration_platforms: - - nrf5340dk/nrf5340/cpuapp - tags: pcd child_parent deprecated ci_tests_subsys_pcd