diff --git a/CODEOWNERS b/CODEOWNERS index 92ed317d4245..ddfe726966be 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -71,6 +71,8 @@ /cmake/ @nrfconnect/ncs-co-build-system /cmake/sysbuild/suit.cmake @nrfconnect/ncs-charon /cmake/sysbuild/suit_utilities.cmake @nrfconnect/ncs-charon +/cmake/sysbuild/suit_provisioning.cmake @nrfconnect/ncs-charon +/cmake/sysbuild/suit_provisioning_nrf54h20.cmake @nrfconnect/ncs-charon # All doc related files /doc/_zoomin/ @nrfconnect/ncs-co-doc @nrfconnect/ncs-doc-leads @@ -774,6 +776,8 @@ # Sysbuild /sysbuild/ @nrfconnect/ncs-co-build-system /sysbuild/Kconfig.suit @nrfconnect/ncs-charon +/sysbuild/Kconfig.suit_provisioning @nrfconnect/ncs-charon +/sysbuild/suit_provisioning/ @nrfconnect/ncs-charon /sysbuild/suit.cmake @nrfconnect/ncs-charon # Tests diff --git a/applications/machine_learning/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/applications/machine_learning/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf index a99f4f4a2bb3..adec495f3583 100644 --- a/applications/machine_learning/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ b/applications/machine_learning/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -31,8 +31,6 @@ CONFIG_EVENT_MANAGER_PROXY_BIND_TIMEOUT_MS=4000 CONFIG_GPIO=y -CONFIG_SUIT_MPI_GENERATE=n - ################################################################################ # Debug configuration CONFIG_LOG=y diff --git a/cmake/sysbuild/suit.cmake b/cmake/sysbuild/suit.cmake index 819d3f7a7d0b..d7c2e92fbb38 100644 --- a/cmake/sysbuild/suit.cmake +++ b/cmake/sysbuild/suit.cmake @@ -509,7 +509,6 @@ function(suit_create_package) endif() # Read SUIT storage addresses, set during MPI generation - sysbuild_get(SUIT_STORAGE_ADDRESS IMAGE ${DEFAULT_IMAGE} VAR SUIT_STORAGE_ADDRESS CACHE) if(DEFINED SUIT_STORAGE_ADDRESS) list(APPEND STORAGE_BOOT_ARGS --storage-address ${SUIT_STORAGE_ADDRESS}) else() @@ -521,7 +520,7 @@ function(suit_create_package) --storage-output-directory "${DEFAULT_BINARY_DIR}/zephyr" --zephyr-base ${ZEPHYR_BASE} - --config-file "${DEFAULT_BINARY_DIR}/zephyr/.config" + --config-file "${PROJECT_BINARY_DIR}/.config" ${CORE_ARGS} ) set_property( @@ -568,19 +567,13 @@ function(suit_setup_merge) list(APPEND ARTIFACTS_TO_MERGE ${IMAGE_BINARY_DIR}/zephyr/${IMAGE_BINARY_FILE}.hex) list(APPEND ARTIFACTS_TO_MERGE ${IMAGE_BINARY_DIR}/zephyr/uicr.hex) - unset(CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE) - sysbuild_get(CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE KCONFIG) - if(CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE) - list(APPEND ARTIFACTS_TO_MERGE ${BINARY_DIR}/zephyr/suit_mpi_${IMAGE_TARGET_NAME}_merged.hex) - endif() - - if(${IMAGE_TARGET_NAME} STREQUAL "application") - # Get a list of files (and their dependencies) which need merging into the uicr merged file - # and add them at the end of the list, allowing for overwriting, this only applies to the - # application core image - get_property(merge_files GLOBAL PROPERTY SUIT_MERGE_FILE) - get_property(merge_dependencies GLOBAL PROPERTY SUIT_MERGE_DEPENDENCIES) - else() + # Get a list of files (and their dependencies) which need merging into the uicr merged file + # and add them at the end of the list, allowing for overwriting + unset(merge_files) + unset(merge_dependencies) + get_property(merge_files GLOBAL PROPERTY SUIT_MERGE_${IMAGE_TARGET_NAME}_FILE) + get_property(merge_dependencies GLOBAL PROPERTY SUIT_MERGE_${IMAGE_TARGET_NAME}_DEPENDENCIES) + if(NOT DEFINED merge_files) set(merge_files) set(merge_dependencies) endif() @@ -595,7 +588,7 @@ function(suit_setup_merge) # fixme: uicr_merged is overwritten by new content, runners_yaml_props_target could be used to define # what shall be flashed, but not sure where to set this! Remove --overlap if ready! # example usage: set_property(TARGET runners_yaml_props_target PROPERTY hex_file ${merged_hex_file}) - COMMAND ${CMAKE_COMMAND} -E copy ${OUTPUT_HEX_FILE} ${IMAGE_BINARY_DIR}/zephyr/uicr_merged.hex + COMMAND ${CMAKE_COMMAND} -E copy ${OUTPUT_HEX_FILE} ${IMAGE_BINARY_DIR}/zephyr/uicr_merged.hex ) endforeach() endfunction() diff --git a/cmake/sysbuild/suit_provisioning.cmake b/cmake/sysbuild/suit_provisioning.cmake new file mode 100644 index 000000000000..52c802cfb1d2 --- /dev/null +++ b/cmake/sysbuild/suit_provisioning.cmake @@ -0,0 +1,238 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(SUIT_GENERATOR_CLI_SCRIPT "${ZEPHYR_SUIT_GENERATOR_MODULE_DIR}/suit_generator/cli.py") +sysbuild_get(DEFAULT_BINARY_DIR IMAGE ${DEFAULT_IMAGE} VAR APPLICATION_BINARY_DIR CACHE) +set(MPI_BINARY_DIR ${DEFAULT_BINARY_DIR}/zephyr) + +# Usage: +# configure_storage_address_cache() +# +# Store the absolute address of the SUIT storage inside CMake cache. +# +function(configure_storage_address_cache) + sysbuild_dt_nodelabel( + suit_storage_dev + IMAGE + ${DEFAULT_IMAGE} + NODELABEL + "suit_storage_partition" + ) + + if(NOT DEFINED suit_storage_dev) + message(WARNING "Unable to read SUIT storage address from DTS - nodes undefined") + return() + endif() + + # Calculate SUIT storage address, based on the DTS + sysbuild_dt_reg_addr( + suit_storage_address + IMAGE + ${DEFAULT_IMAGE} + PATH + "${suit_storage_dev}" + ) + + set(SUIT_STORAGE_ADDRESS ${suit_storage_address} CACHE STRING "SUIT storage address") +endfunction() + +# Usage: +# generate_mpi_hex() +# +# Will generate HEX file for a single manifest role, based on Kconfigs defined by the template. +# +# : The role that was used to generate a set of Kconfigs, defined by the +# Kconfig.template.manifest_config. +# +# Required Kconfigs: +# - SUIT_MPI__VENDOR_NAME +# - SUIT_MPI__CLASS_NAME +# - SUIT_MPI__OFFSET +# - SUIT_MPI__PATH +# - SUIT_MPI_SLOT_SIZE +# +function(generate_mpi_hex manifest_role) + set(generate_args "") + set(descr_args "") + + if(NOT DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}) + return() + endif() + + if((NOT DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_VENDOR_NAME) OR + (NOT DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_CLASS_NAME) OR + (NOT DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_OFFSET) OR + (NOT DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_PATH) OR + (NOT DEFINED SB_CONFIG_SUIT_MPI_SLOT_SIZE) + ) + message(FATAL_ERROR "Malformed configuration for: ${manifest_role}") + return() + endif() + + if(SB_CONFIG_SUIT_MPI_${manifest_role}_VENDOR_NAME STREQUAL "nordicsemi.com") + message(WARNING " + ----------------------------------------------------------- + --- WARNING: Using default Vendor ID (nordicsemi.com). --- + --- It should not be used for production. --- + --- See SB_CONFIG_SUIT_MPI_${manifest_role}_VENDOR_NAME \t--- + --- and SB_CONFIG_SUIT_MPI_${manifest_role}_CLASS_NAME \t--- + ----------------------------------------------------------- + \n" + ) + endif() + + MATH( + EXPR + SUIT_MPI_${manifest_role}_ADDRESS + "${SUIT_STORAGE_ADDRESS} + + ${SB_CONFIG_SUIT_MPI_${manifest_role}_OFFSET}" + OUTPUT_FORMAT HEXADECIMAL + ) + + list(APPEND generate_args + --vendor-name ${SB_CONFIG_SUIT_MPI_${manifest_role}_VENDOR_NAME} + --class-name ${SB_CONFIG_SUIT_MPI_${manifest_role}_CLASS_NAME} + --address ${SUIT_MPI_${manifest_role}_ADDRESS} + --size ${SB_CONFIG_SUIT_MPI_SLOT_SIZE} + --output-file ${SB_CONFIG_SUIT_MPI_${manifest_role}_PATH} + ) + + list(APPEND descr_args + ${SB_CONFIG_SUIT_MPI_${manifest_role}_PATH} + ${SB_CONFIG_SUIT_MPI_${manifest_role}_VENDOR_NAME} + ${SB_CONFIG_SUIT_MPI_${manifest_role}_CLASS_NAME} + "address=${SUIT_MPI_${manifest_role}_ADDRESS}" + ) + + if(DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_DOWNGRADE_PREVENTION) + list(APPEND generate_args + --downgrade-prevention-enabled + ) + list(APPEND descr_args + downgrade-prevention-enabled + ) + endif() + + if(DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_INDEPENDENT_UPDATE) + list(APPEND generate_args + --independent-updates + ) + list(APPEND descr_args + "independent updates" + ) + endif() + + if(DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_SIGNATURE_CHECK_ENABLED_ON_UPDATE) + list(APPEND generate_args + --signature-verification update + ) + list(APPEND descr_args + "signed updates" + ) + elseif(DEFINED SB_CONFIG_SUIT_MPI_${manifest_role}_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT) + list(APPEND generate_args + --signature-verification update-and-boot + ) + list(APPEND descr_args + "signed updates" + "signed boot" + ) + endif() + + add_custom_target( + create_suit_mpi_${manifest_role} + COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} + mpi + generate + ${generate_args} + BYPRODUCTS ${SB_CONFIG_SUIT_MPI_${manifest_role}_PATH} + COMMENT "Create SUIT artifacts" + ) + message(INFO " Generate MPI for ${manifest_role} manifest (${descr_args})") +endfunction() + +# Usage: +# generate_mpi_area( [...]) +# +# Will generate HEX file for an MPI area attached to a single domain. +# At the end of the merging process, a digest of the resulting binary will be +# calculated and appended at the end of it. +# +# : Name of the area. A valid area must define output file path, address and size. +# : The role that was used to generate a set of Kconfigs, defined by the +# Kconfig.template.manifest_config. +# Used to extract the HEX file path containing the MPI configuration. +# +# Required Kconfigs: +# - SUIT_MPI__PATH +# - SUIT_MPI__OFFSET +# - SUIT_MPI__SIZE +# - SUIT_MPI__PATH +# +function (generate_mpi_area area) + set(merge_args "") + set(dependencies "") + + if((NOT DEFINED SB_CONFIG_SUIT_MPI_${area}_PATH) OR + (NOT DEFINED SB_CONFIG_SUIT_MPI_${area}_OFFSET) OR + (NOT DEFINED SB_CONFIG_SUIT_MPI_${area}_SIZE) + ) + message(FATAL_ERROR "Malformed configuration for: ${area}") + return() + endif() + + # Calculate the absolute address of the MPI area. + MATH( + EXPR + SUIT_MPI_${area}_ADDRESS + "${SUIT_STORAGE_ADDRESS} + + ${SB_CONFIG_SUIT_MPI_${area}_OFFSET}" + OUTPUT_FORMAT HEXADECIMAL + ) + + set(output ${MPI_BINARY_DIR}/${SB_CONFIG_SUIT_MPI_${area}_PATH}) + set(address ${SUIT_MPI_${area}_ADDRESS}) + set(size ${SB_CONFIG_SUIT_MPI_${area}_SIZE}) + + list(APPEND merge_args + --output-file ${output} + --address ${address} + --size ${size} + ) + + foreach(role ${ARGN}) + if(NOT DEFINED SB_CONFIG_SUIT_MPI_${role}_PATH) + continue() + endif() + + list(APPEND merge_args "--file" "${SB_CONFIG_SUIT_MPI_${role}_PATH}") + list(APPEND dependencies "${SB_CONFIG_SUIT_MPI_${role}_PATH}") + endforeach() + + add_custom_target( + create_suit_mpi_area_${area} + ALL + COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} + mpi + merge + ${merge_args} + DEPENDS ${dependencies} + BYPRODUCTS ${output} + COMMENT "Create SUIT artifacts" + ) + + message(INFO " Generate merged MPI for ${area} (${output})") +endfunction() + +if(DEFINED SB_CONFIG_SOC_SERIES_NRF54HX) + configure_storage_address_cache() +endif() # SB_CONFIG_SOC_SERIES_NRF54HX + +if(DEFINED SB_CONFIG_SUIT_MPI_GENERATE) + if(DEFINED SB_CONFIG_SUIT_MPI_SOC_NRF54H20) + include(${CMAKE_CURRENT_LIST_DIR}/suit_provisioning_nrf54h20.cmake) + endif() # SB_CONFIG_SUIT_MPI_SOC_NRF54H20 +endif() # SB_CONFIG_SUIT_MPI_GENERATE diff --git a/subsys/suit/provisioning/soc/nrf54h20.cmake b/cmake/sysbuild/suit_provisioning_nrf54h20.cmake similarity index 58% rename from subsys/suit/provisioning/soc/nrf54h20.cmake rename to cmake/sysbuild/suit_provisioning_nrf54h20.cmake index 3ab5ec5c4024..743ced78e575 100644 --- a/subsys/suit/provisioning/soc/nrf54h20.cmake +++ b/cmake/sysbuild/suit_provisioning_nrf54h20.cmake @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +include(${CMAKE_CURRENT_LIST_DIR}/suit_utilities.cmake) # List all manifest roles. # The function internally checks if the enabling symbol is defined. @@ -31,3 +32,16 @@ generate_mpi_area( RAD_LOCAL_1 RAD_LOCAL_2 ) + +if(SB_CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE) + suit_add_merge_hex_file( + FILES ${MPI_BINARY_DIR}/${SB_CONFIG_SUIT_MPI_APP_AREA_PATH} + DEPENDENCIES ${MPI_BINARY_DIR}/${SB_CONFIG_SUIT_MPI_APP_AREA_PATH} + TARGET "application" + ) + suit_add_merge_hex_file( + FILES ${MPI_BINARY_DIR}/${SB_CONFIG_SUIT_MPI_RAD_AREA_PATH} + DEPENDENCIES ${MPI_BINARY_DIR}/${SB_CONFIG_SUIT_MPI_RAD_AREA_PATH} + TARGET "radio" + ) +endif() diff --git a/cmake/sysbuild/suit_utilities.cmake b/cmake/sysbuild/suit_utilities.cmake index 22e2378ab043..2d5fbd7eb253 100644 --- a/cmake/sysbuild/suit_utilities.cmake +++ b/cmake/sysbuild/suit_utilities.cmake @@ -126,15 +126,20 @@ function(suit_create_nordic_cache_partition args output_file) endfunction() # Usage: -# suit_add_merge_hex_file(FILES [DEPENDENCIES ] +# suit_add_merge_hex_file(FILES [DEPENDENCIES ] [TARGET ] # # Add files which should be merged into the uicr_merged.hex output file, respecting any # dependencies that need to be generated before hand. This will overwrite existing data if it is # present in other files function(suit_add_merge_hex_file) - cmake_parse_arguments(arg "" "" "FILES;DEPENDENCIES" ${ARGN}) + cmake_parse_arguments(arg "" "TARGET" "FILES;DEPENDENCIES" ${ARGN}) zephyr_check_arguments_required(${CMAKE_CURRENT_FUNCTION} arg FILES) - set_property(GLOBAL APPEND PROPERTY SUIT_MERGE_FILE ${arg_FILES}) - set_property(GLOBAL APPEND PROPERTY SUIT_MERGE_DEPENDENCIES ${arg_DEPENDENCIES}) + if(DEFINED arg_TARGET) + set_property(GLOBAL APPEND PROPERTY SUIT_MERGE_${arg_TARGET}_FILE ${arg_FILES}) + set_property(GLOBAL APPEND PROPERTY SUIT_MERGE_${arg_TARGET}_DEPENDENCIES ${arg_DEPENDENCIES}) + else() + set_property(GLOBAL APPEND PROPERTY SUIT_MERGE_application_FILE ${arg_FILES}) + set_property(GLOBAL APPEND PROPERTY SUIT_MERGE_application_DEPENDENCIES ${arg_DEPENDENCIES}) +endif() endfunction() diff --git a/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 index d47f93979790..f62c41f49672 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 @@ -1,5 +1,5 @@ -{%- set mpi_application_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_application_class_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} +{%- set mpi_application_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_application_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -74,12 +74,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Application DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in application['config'] and application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_app_local.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_app_local.yaml.jinja2 index ae0b09f67740..1d6ece68ae2b 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_app_local.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_app_local.yaml.jinja2 @@ -1,12 +1,12 @@ {%- set component_index = 0 %} {%- set component_list = [] %} {%- set dependencies_list = [] %} -{%- set mpi_app_recovery_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_app_recovery_class_name = application['config']['CONFIG_SUIT_MPI_APP_RECOVERY_CLASS_NAME']|default('nRF54H20_app_recovery') %} -{%- set mpi_rad_recovery_vendor_name = application['config']['CONFIG_SUIT_MPI_RAD_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_rad_recovery_class_name = application['config']['CONFIG_SUIT_MPI_RAD_RECOVERY_CLASS_NAME']|default('nRF54H20_rad_recovery') %} -{%- set mpi_app_recovery_local_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_app_recovery_local_class_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_2') %} +{%- set mpi_app_recovery_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_app_recovery_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_RECOVERY_CLASS_NAME']|default('nRF54H20_app_recovery') %} +{%- set mpi_rad_recovery_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_rad_recovery_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_RECOVERY_CLASS_NAME']|default('nRF54H20_rad_recovery') %} +{%- set mpi_app_recovery_local_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_app_recovery_local_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_2') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -122,12 +122,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Application DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} {%- if rad_recovery is defined %} - suit-directive-set-component-index: 0 - suit-directive-override-parameters: diff --git a/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_direct.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_direct.yaml.jinja2 index 93cd5b6a593b..5b996a62f4e3 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_direct.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope_direct.yaml.jinja2 @@ -1,10 +1,10 @@ {%- set component_index = 0 %} {%- set component_list = [] %} {%- set dependencies_list = [] %} -{%- set mpi_app_recovery_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_app_recovery_class_name = application['config']['CONFIG_SUIT_MPI_APP_RECOVERY_CLASS_NAME']|default('nRF54H20_app_recovery') %} -{%- set mpi_rad_recovery_vendor_name = application['config']['CONFIG_SUIT_MPI_RAD_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_rad_recovery_class_name = application['config']['CONFIG_SUIT_MPI_RAD_RECOVERY_CLASS_NAME']|default('nRF54H20_rad_recovery') %} +{%- set mpi_app_recovery_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_app_recovery_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_RECOVERY_CLASS_NAME']|default('nRF54H20_app_recovery') %} +{%- set mpi_rad_recovery_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_rad_recovery_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_RECOVERY_CLASS_NAME']|default('nRF54H20_rad_recovery') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -141,12 +141,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Application DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} {%- if rad_recovery is defined %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: diff --git a/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 index 6198ff8a3b19..65a47dc9ec9e 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 @@ -1,5 +1,5 @@ -{%- set mpi_app_recovery_local_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_app_recovery_local_class_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %} +{%- set mpi_app_recovery_local_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_app_recovery_local_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -80,12 +80,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Application DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in app_recovery_img['config'] and app_recovery_img['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 index 0ffbeb1b7ae7..e9bfc83a8a9a 100644 --- a/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 @@ -1,10 +1,5 @@ -{%- if application is defined %} - {%- set main_config = application %} -{%- else %} - {%- set main_config = radio %} -{%- endif %} -{%- set mpi_radio_vendor_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_radio_class_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} +{%- set mpi_radio_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_radio_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -79,12 +74,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Radio DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 index 7f9beec0eb61..5c83a8de39b3 100644 --- a/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 @@ -1,5 +1,5 @@ -{%- set mpi_rad_recovery_vendor_name = application['config']['CONFIG_SUIT_MPI_RAD_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_rad_recovery_class_name = application['config']['CONFIG_SUIT_MPI_RAD_RECOVERY_CLASS_NAME']|default('nRF54H20_sample_rad_recovery') %} +{%- set mpi_rad_recovery_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_RECOVERY_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_rad_recovery_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_RECOVERY_CLASS_NAME']|default('nRF54H20_sample_rad_recovery') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -70,12 +70,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Radio DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: suit-parameter-uri: '#{{ rad_recovery['name'] }}' diff --git a/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 index c7205e671aa0..60ce97526c75 100644 --- a/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 @@ -1,24 +1,19 @@ {%- set component_index = 0 %} {%- set component_list = [] %} -{%- if application is not defined %} - {%- set main_config = radio %} -{%- else %} - {%- set main_config = application %} -{%- endif %} -{%- set mpi_root_vendor_name = main_config['config']['CONFIG_SUIT_MPI_ROOT_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_root_class_name = main_config['config']['CONFIG_SUIT_MPI_ROOT_CLASS_NAME']|default('nRF54H20_sample_root') %} -{%- set mpi_application_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_application_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} -{%- set mpi_radio_vendor_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_radio_class_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} +{%- set mpi_root_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_ROOT_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_root_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_ROOT_CLASS_NAME']|default('nRF54H20_sample_root') %} +{%- set mpi_application_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_application_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} +{%- set mpi_radio_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_radio_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} {%- if 'SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY' in sysbuild['config'] and sysbuild['config']['SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY'] != '' %} {%- set nordic_top = True %} {%- else %} {%- set nordic_top = False %} {%- endif %} {%- if 'SB_CONFIG_SUIT_RECOVERY_APPLICATION_IMAGE_MANIFEST_APP_LOCAL_3' in sysbuild['config'] and sysbuild['config']['SB_CONFIG_SUIT_RECOVERY_APPLICATION_IMAGE_MANIFEST_APP_LOCAL_3'] != '' %} - {%- set mpi_app_recovery_local_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} - {%- set mpi_app_recovery_local_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %} + {%- set mpi_app_recovery_local_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} + {%- set mpi_app_recovery_local_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %} {%- endif %} {%- if app_recovery_img is defined and 'CONFIG_SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP] != '' %} {%- set recovery_button_check_on_invoke = True %} @@ -138,12 +133,7 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} -{%- if main_config['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Main DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 0 {%- if radio is defined %} - suit-directive-override-parameters: diff --git a/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 index 42c89a1ecc62..5778233a3ccd 100644 --- a/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 @@ -1,5 +1,5 @@ -{%- set mpi_application_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_application_class_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} +{%- set mpi_application_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_application_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -97,12 +97,7 @@ SUIT_Envelope_Tagged: - suit-send-record-failure {%- endif %} -{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Application DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in application['config'] and application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 index de625ee37655..3de138321759 100644 --- a/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 @@ -1,10 +1,5 @@ -{%- if application is defined %} - {%- set main_config = application %} -{%- else %} - {%- set main_config = radio %} -{%- endif %} -{%- set mpi_radio_vendor_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_radio_class_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} +{%- set mpi_radio_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_radio_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -88,12 +83,7 @@ SUIT_Envelope_Tagged: - suit-send-record-failure {%- endif %} -{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Radio DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 b/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 index ada7e8b29b56..4d87ba30b031 100644 --- a/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 @@ -1,16 +1,11 @@ {%- set component_index = 0 %} {%- set component_list = [] %} -{%- if application is not defined %} - {%- set main_config = radio %} -{%- else %} - {%- set main_config = application %} -{%- endif %} -{%- set mpi_root_vendor_name = main_config['config']['CONFIG_SUIT_MPI_ROOT_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_root_class_name = main_config['config']['CONFIG_SUIT_MPI_ROOT_CLASS_NAME']|default('nRF54H20_sample_root') %} -{%- set mpi_application_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_application_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} -{%- set mpi_radio_vendor_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_radio_class_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} +{%- set mpi_root_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_ROOT_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_root_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_ROOT_CLASS_NAME']|default('nRF54H20_sample_root') %} +{%- set mpi_application_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_application_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} +{%- set mpi_radio_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_radio_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} {%- if 'SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY' in sysbuild['config'] and sysbuild['config']['SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY'] != '' %} {%- set nordic_top = True %} {%- else %} @@ -156,12 +151,7 @@ SUIT_Envelope_Tagged: - suit-send-sysinfo-failure {%- endif %} -{%- if main_config['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Main DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 0 {%- if application is defined %} - suit-directive-override-parameters: diff --git a/doc/nrf/app_dev/config_and_build/sysbuild/sysbuild_forced_options.rst b/doc/nrf/app_dev/config_and_build/sysbuild/sysbuild_forced_options.rst index 2768ae589ff0..b2f4773cefff 100644 --- a/doc/nrf/app_dev/config_and_build/sysbuild/sysbuild_forced_options.rst +++ b/doc/nrf/app_dev/config_and_build/sysbuild/sysbuild_forced_options.rst @@ -64,10 +64,6 @@ Trying to change them directly in an image will result in the new value being ov | :kconfig:option:`CONFIG_CHIP_OTA_REQUESTOR` + ``SB_CONFIG_MATTER_OTA`` | | +-------------------------------------------------------------------------+ | | | :kconfig:option:`CONFIG_CHIP_OTA_IMAGE_BUILD` + | | -+-------------------------------------------------------------------------+---------------------------------------------------------------------------+ | -| :kconfig:option:`CONFIG_SUIT_MPI_APP_RECOVERY` + ``SB_CONFIG_SUIT_BUILD_RECOVERY`` | | -+-------------------------------------------------------------------------+ | | -| :kconfig:option:`CONFIG_SUIT_MPI_RAD_RECOVERY` + | | +-------------------------------------------------------------------------+---------------------------------------------------------------------------+-------------------------+ | :kconfig:option:`CONFIG_SINGLE_APPLICATION_SLOT` + ``SB_CONFIG_MCUBOOT_MODE_SINGLE_APP`` | MCUboot | +-------------------------------------------------------------------------+---------------------------------------------------------------------------+ | diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_dfu.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_dfu.rst index aac67e9d2f1a..da0864b9ab5f 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_dfu.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_dfu.rst @@ -184,25 +184,25 @@ Customize Vendor and Class UUIDs -------------------------------- Customizing UUIDs used for class and vendor IDs enhances security and is recommended for specific use cases. -Values for ``class-identifier`` and ``vendor-identifier`` in the manifest are created based on the ``CONFIG_SUIT_MPI__VENDOR_NAME`` and ``CONFIG_SUIT_MPI__CLASS_NAME`` Kconfig options. +Values for ``class-identifier`` and ``vendor-identifier`` in the manifest are created based on the ``SB_CONFIG_SUIT_MPI__VENDOR_NAME`` and ``SB_CONFIG_SUIT_MPI__CLASS_NAME`` sysbuild Kconfig options. Specifically, in the basic case: -* :kconfig:option:`CONFIG_SUIT_MPI_ROOT_VENDOR_NAME` -* :kconfig:option:`CONFIG_SUIT_MPI_ROOT_CLASS_NAME` -* :kconfig:option:`CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME` -* :kconfig:option:`CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME` -* :kconfig:option:`CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME` -* :kconfig:option:`CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME` +* :kconfig:option:`SB_CONFIG_SUIT_MPI_ROOT_VENDOR_NAME` +* :kconfig:option:`SB_CONFIG_SUIT_MPI_ROOT_CLASS_NAME` +* :kconfig:option:`SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME` +* :kconfig:option:`SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME` +* :kconfig:option:`SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME` +* :kconfig:option:`SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME` These Kconfig options are used during Manifest Provisioning Information (MPI) generation. After the MPI has been flashed, it is read by the Secure Domain Firmware, which can then use it to verify if the UUIDs in a manifest are correct, -As an example, after adding the following lines to the :file:`prj.conf` file: +As an example, after adding the following lines to the :file:`sysbuild.conf` file: .. code-block:: - CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME="ACME Corp" - CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME="Light bulb" + SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME="ACME Corp" + SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME="Light bulb" You will find the following lines in the generated manifest .yaml file :file:`build/DFU/application.yaml` @@ -265,7 +265,7 @@ With the Python dictionary you are able to, for example: * Obtain the size of partition with ``application['dt'].chosen_nodes['zephyr,code-partition'].regs[0].size`` * Get the pair of URI name and the binary path by using ``'#{{ application['name'] }}': {{ application['binary'] }}`` * Get the root manifest sequence number with ``suit-manifest-sequence-number: {{ APP_ROOT_SEQ_NUM }}`` -* Get the vendor name by using ``application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']`` +* Get the vendor name by using ``sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']`` Additionally, the **get_absolute_address** method is available to recalculate the absolute address of the partition. With these variables and methods, you can define templates which will next be filled out by the build system and use them to prepare the output binary SUIT envelope. diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_qsg.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_qsg.rst index 03d8f69f2a07..f36baea88961 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_qsg.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_customize_qsg.rst @@ -86,14 +86,14 @@ Modifying class and vendor identifiers Replacing and using the correct class and vendor UUIDs prevents conflicts in the DFU process. The UUIDs allow to ensure that the firmware is compatible with a given device. -This can be done by changing the class and vendor names using Kconfig options (for example in the :file:`prj.conf` file): +This can be done by changing the class and vendor names using sysbuild Kconfig options (for example in the :file:`sysbuild.conf` file): .. code-block:: - CONFIG_SUIT_MPI_ROOT_VENDOR_NAME="ACME Corp" - CONFIG_SUIT_MPI_ROOT_CLASS_NAME="Light bulb root" - CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME="ACME Corp" - CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME="Light bulb" + SB_CONFIG_SUIT_MPI_ROOT_VENDOR_NAME="ACME Corp" + SB_CONFIG_SUIT_MPI_ROOT_CLASS_NAME="Light bulb root" + SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME="ACME Corp" + SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME="Light bulb" After rebuilding you can find the following part in the :file:`./build/DFU/application.yaml` file. diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_recovery.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_recovery.rst index f0d407431c93..312b7bd20add 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_recovery.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_suit_recovery.rst @@ -128,8 +128,6 @@ To turn an application into a recovery application, the following steps have to 1. For each of the images defined by the custom recovery application, ensure the following configuration is present: * :kconfig:option:`CONFIG_SUIT_RECOVERY` set to ``y`` - * :kconfig:option:`CONFIG_SUIT_MPI_GENERATE` set to ``n`` - * :kconfig:option:`CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE` set to ``n`` * :kconfig:option:`CONFIG_NRF_REGTOOL_GENERATE_UICR` set to ``n`` * :kconfig:option:`CONFIG_NRF_REGTOOL_GENERATE_BICR` set to ``n`` @@ -138,8 +136,6 @@ To turn an application into a recovery application, the following steps have to .. code-block:: cfg CONFIG_SUIT_RECOVERY=y - CONFIG_SUIT_MPI_GENERATE=n - CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE=n CONFIG_NRF_REGTOOL_GENERATE_UICR=n CONFIG_NRF_REGTOOL_GENERATE_BICR=n diff --git a/samples/suit/flash_companion/prj.conf b/samples/suit/flash_companion/prj.conf index 96ae996bc4ae..3422f8d9ebd2 100644 --- a/samples/suit/flash_companion/prj.conf +++ b/samples/suit/flash_companion/prj.conf @@ -62,11 +62,6 @@ CONFIG_SUIT_ENVELOPE_TARGET="" CONFIG_NRF_REGTOOL_GENERATE_UICR=n CONFIG_NRF_REGTOOL_GENERATE_BICR=n -# The MPI has to be generated from the top level application, not from -# the flash companion application. -CONFIG_SUIT_MPI_GENERATE=n -CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE=n - # Enable canonical zcbor encoding CONFIG_ZCBOR_CANONICAL=y diff --git a/samples/suit/recovery/prj.conf b/samples/suit/recovery/prj.conf index 9ae6263e72db..559fd3df352f 100644 --- a/samples/suit/recovery/prj.conf +++ b/samples/suit/recovery/prj.conf @@ -8,12 +8,6 @@ CONFIG_SUIT_RECOVERY=y -# The MPI has to be generated from the top level application, not from -# the recovery application. This is because the digests of the main application MPI -# and the recovery application MPI is calculated together for a given domain. -CONFIG_SUIT_MPI_GENERATE=n -CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE=n - # It is the main application which is responsible for flashing and generating the UICR # configuration - the recovery application should not do it. CONFIG_NRF_REGTOOL_GENERATE_UICR=n diff --git a/samples/suit/recovery/sysbuild/hci_ipc.conf b/samples/suit/recovery/sysbuild/hci_ipc.conf index b9717e74971c..c2f546c93beb 100644 --- a/samples/suit/recovery/sysbuild/hci_ipc.conf +++ b/samples/suit/recovery/sysbuild/hci_ipc.conf @@ -8,12 +8,6 @@ CONFIG_SUIT_RECOVERY=y -# The MPI has to be generated from the top level application, not from -# the recovery application. This is because the digests of the main application MPI -# and the recovery application MPI is calculated together for a given domain. -CONFIG_SUIT_MPI_GENERATE=n -CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE=n - # It is the main application which is responsible for flashing and generating the UICR # configuration - the recovery application should not do it. CONFIG_NRF_REGTOOL_GENERATE_UICR=n diff --git a/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 b/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 index 1b87c8f9638a..c681c18a0675 100644 --- a/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 +++ b/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 @@ -1,5 +1,5 @@ -{%- set mpi_application_vendor_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_application_class_name = application['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} +{%- set mpi_application_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_application_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -99,12 +99,7 @@ SUIT_Envelope_Tagged: - suit-send-record-failure {%- endif %} -{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Application DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} {%- if flash_companion is defined %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: diff --git a/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 b/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 index a3caaaec7c10..e81c10f3a50c 100644 --- a/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 +++ b/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 @@ -1,10 +1,5 @@ -{%- if application is defined %} - {%- set main_config = application %} -{%- else %} - {%- set main_config = radio %} -{%- endif %} -{%- set mpi_radio_vendor_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_radio_class_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} +{%- set mpi_radio_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_radio_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} SUIT_Envelope_Tagged: suit-authentication-wrapper: SuitDigest: @@ -90,12 +85,7 @@ SUIT_Envelope_Tagged: - suit-send-record-failure {%- endif %} -{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Radio DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 b/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 index 57b3feed79fd..a12bfa2efc1f 100644 --- a/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 +++ b/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 @@ -1,16 +1,11 @@ {%- set component_index = 0 %} {%- set component_list = [] %} -{%- if application is not defined %} - {%- set main_config = radio %} -{%- else %} - {%- set main_config = application %} -{%- endif %} -{%- set mpi_root_vendor_name = main_config['config']['CONFIG_SUIT_MPI_ROOT_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_root_class_name = main_config['config']['CONFIG_SUIT_MPI_ROOT_CLASS_NAME']|default('nRF54H20_sample_root') %} -{%- set mpi_application_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_application_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} -{%- set mpi_radio_vendor_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} -{%- set mpi_radio_class_name = main_config['config']['CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} +{%- set mpi_root_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_ROOT_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_root_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_ROOT_CLASS_NAME']|default('nRF54H20_sample_root') %} +{%- set mpi_application_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_application_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_APP_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_app') %} +{%- set mpi_radio_vendor_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_VENDOR_NAME']|default('nordicsemi.com') %} +{%- set mpi_radio_class_name = sysbuild['config']['SB_CONFIG_SUIT_MPI_RAD_LOCAL_1_CLASS_NAME']|default('nRF54H20_sample_rad') %} {%- if 'SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY' in sysbuild['config'] and sysbuild['config']['SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY'] != '' %} {%- set nordic_top = True %} {%- else %} @@ -156,12 +151,7 @@ SUIT_Envelope_Tagged: - suit-send-sysinfo-failure {%- endif %} -{%- if main_config['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} - # Main DTS contains larger SUIT storage - use legacy encoding - suit-install-legacy: -{%- else %} suit-install: -{%- endif %} - suit-directive-set-component-index: 0 {%- if nordic_top %} - suit-directive-override-parameters: diff --git a/samples/suit/smp_transfer/sysbuild/hci_ipc.conf b/samples/suit/smp_transfer/sysbuild/hci_ipc.conf index bbefd40d1b04..2528a1a2679c 100644 --- a/samples/suit/smp_transfer/sysbuild/hci_ipc.conf +++ b/samples/suit/smp_transfer/sysbuild/hci_ipc.conf @@ -12,8 +12,3 @@ CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_LOG=n CONFIG_LOG_PRINTK=n CONFIG_UART_CONSOLE=n - -# Do not generate or merge the MPI generated by the hci_ipc image. -# It would result in the MPI configuration managed by the application core (main) -# image to be overwritten by the default configuration from hci_ipc. -CONFIG_SUIT_MPI_GENERATE=n diff --git a/subsys/suit/CMakeLists.txt b/subsys/suit/CMakeLists.txt index 8f4c3aba6d95..9d66d39a5943 100644 --- a/subsys/suit/CMakeLists.txt +++ b/subsys/suit/CMakeLists.txt @@ -4,7 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -add_subdirectory(provisioning) add_subdirectory(app_tools) add_subdirectory_ifdef(CONFIG_SUIT plat_err) add_subdirectory_ifdef(CONFIG_SUIT memory_layout) diff --git a/subsys/suit/Kconfig b/subsys/suit/Kconfig index e1f23ba342e4..c6175ccba083 100644 --- a/subsys/suit/Kconfig +++ b/subsys/suit/Kconfig @@ -4,8 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -rsource "provisioning/Kconfig" - menuconfig SUIT bool "Enable SUIT modules" @@ -48,7 +46,6 @@ config SUIT_DFU_CANDIDATE_PROCESSING_MINIMAL imply SUIT_UTILS imply SUIT_METADATA imply SSF_SUIT_SERVICE_ENABLED - imply SUIT_MPI_GENERATE config SUIT_DFU_CANDIDATE_PROCESSING_FULL bool "Application defaults for support of full SUIT envelope processing by the local domain" @@ -84,7 +81,6 @@ config SUIT_DFU_CANDIDATE_PROCESSING_FULL imply SUIT_PLATFORM imply SUIT_PROCESSOR imply SUIT_MANIFEST_VARIABLES - imply SUIT_MPI_GENERATE imply SUIT_SINK_SELECTOR config SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE @@ -95,7 +91,6 @@ config SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE imply SUIT_UTILS imply SUIT_METADATA imply SSF_SUIT_SERVICE_ENABLED - imply SUIT_MPI_GENERATE imply SUIT_CACHE imply SUIT_CACHE_RW imply SUIT_MEMPTR_STORAGE @@ -113,7 +108,6 @@ config SUIT_DFU_CANDIDATE_PROCESSING_NONE used by the Secure Domain to fetch additional data with the use of the application core. imply SUIT_ORCHESTRATOR_APP - imply SUIT_MPI_GENERATE endchoice # SUIT_APP_ENVELOPE_PROCESSING_LEVEL diff --git a/subsys/suit/provisioning/CMakeLists.txt b/subsys/suit/provisioning/CMakeLists.txt deleted file mode 100644 index 26d30977e8d6..000000000000 --- a/subsys/suit/provisioning/CMakeLists.txt +++ /dev/null @@ -1,204 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -set(SUIT_GENERATOR_CLI_SCRIPT "${ZEPHYR_SUIT_GENERATOR_MODULE_DIR}/suit_generator/cli.py") - -# Usage: -# configure_storage_address_cache() -# -# Store the absolute address of the SUIT storage inside CMake cache. -# -function(configure_storage_address_cache) - # Calculate SUIT storage address, based on the DTS - dt_nodelabel(suit_storage_dev NODELABEL suit_storage_partition) - - if (NOT DEFINED suit_storage_dev) - message(WARNING "Unable to read SUIT storage address from DTS - nodes undefined") - return() - endif() - - dt_reg_addr(SUIT_STORAGE_ADDRESS PATH ${suit_storage_dev}) - set(SUIT_STORAGE_ADDRESS ${SUIT_STORAGE_ADDRESS} CACHE STRING "SUIT storage address") -endfunction() - -# Usage: -# generate_mpi_hex() -# -# Will generate HEX file for a single manifest role, based on Kconfigs defined by the template. -# -# : The role that was used to generate a set of Kconfigs, defined by the -# Kconfig.template.manifest_config. -# -# Required Kconfigs: -# - SUIT_MPI__VENDOR_NAME -# - SUIT_MPI__CLASS_NAME -# - SUIT_MPI__OFFSET -# - SUIT_MPI__PATH -# - SUIT_MPI_SLOT_SIZE -# -function(generate_mpi_hex MANIFEST_ROLE) - set(GENERATE_ARGS "") - set(DESCR_ARGS "") - - if (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}) - return() - endif() - - if ((NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_VENDOR_NAME) OR - (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_CLASS_NAME) OR - (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_OFFSET) OR - (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_PATH) OR - (NOT DEFINED CONFIG_SUIT_MPI_SLOT_SIZE) - ) - message(FATAL_ERROR "Malformed configuration for: ${MANIFEST_ROLE}") - return() - endif() - - MATH( - EXPR - SUIT_MPI_${MANIFEST_ROLE}_ADDRESS - "${SUIT_STORAGE_ADDRESS} - + ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_OFFSET}" - OUTPUT_FORMAT HEXADECIMAL - ) - - list(APPEND GENERATE_ARGS - --vendor-name ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_VENDOR_NAME} - --class-name ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_CLASS_NAME} - --address ${SUIT_MPI_${MANIFEST_ROLE}_ADDRESS} - --size ${CONFIG_SUIT_MPI_SLOT_SIZE} - --output-file ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_PATH} - ) - - list(APPEND DESCR_ARGS - ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_PATH} - ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_VENDOR_NAME} - ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_CLASS_NAME} - "address=${SUIT_MPI_${MANIFEST_ROLE}_ADDRESS}" - ) - - if(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_DOWNGRADE_PREVENTION) - list(APPEND GENERATE_ARGS - --downgrade-prevention-enabled - ) - list(APPEND DESCR_ARGS - downgrade-prevention-enabled - ) - endif() - - if(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_INDEPENDENT_UPDATE) - list(APPEND GENERATE_ARGS - --independent-updates - ) - list(APPEND DESCR_ARGS - "independent updates" - ) - endif() - - if(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_SIGNATURE_CHECK_ENABLED_ON_UPDATE) - list(APPEND GENERATE_ARGS - --signature-verification update - ) - list(APPEND DESCR_ARGS - "signed updates" - ) - elseif(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT) - list(APPEND GENERATE_ARGS - --signature-verification update-and-boot - ) - list(APPEND DESCR_ARGS - "signed updates" - "signed boot" - ) - endif() - - set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} - mpi - generate - ${GENERATE_ARGS} - ) - - message(INFO " Generate MPI for ${MANIFEST_ROLE} manifest (${DESCR_ARGS})") -endfunction() - -# Usage: -# generate_mpi_area( [...]) -# -# Will generate HEX file for an MPI area attached to a single domain. -# At the end of the merging process, a digest of the resulting binary will be -# calculated and appended at the end of it. -# -# : Name of the area. A valid area must define output file path, address and size. -# : The role that was used to generate a set of Kconfigs, defined by the -# Kconfig.template.manifest_config. -# Used to extract the HEX file path containing the MPI configuration. -# -# Required Kconfigs: -# - SUIT_MPI__PATH -# - SUIT_MPI__OFFSET -# - SUIT_MPI__SIZE -# - SUIT_MPI__PATH -# -function (generate_mpi_area area) - set(MERGE_ARGS "") - - if ((NOT DEFINED CONFIG_SUIT_MPI_${area}_PATH) OR - (NOT DEFINED CONFIG_SUIT_MPI_${area}_OFFSET) OR - (NOT DEFINED CONFIG_SUIT_MPI_${area}_SIZE) - ) - message(FATAL_ERROR "Malformed configuration for: ${area}") - return() - endif() - - # Calculate the absolute address of the MPI area. - MATH( - EXPR - SUIT_MPI_${area}_ADDRESS - "${SUIT_STORAGE_ADDRESS} - + ${CONFIG_SUIT_MPI_${area}_OFFSET}" - OUTPUT_FORMAT HEXADECIMAL - ) - - set(output ${CONFIG_SUIT_MPI_${area}_PATH}) - set(address ${SUIT_MPI_${area}_ADDRESS}) - set(size ${CONFIG_SUIT_MPI_${area}_SIZE}) - - list(APPEND MERGE_ARGS - --output-file ${output} - --address ${address} - --size ${size} - ) - - foreach(role ${ARGN}) - if(NOT DEFINED CONFIG_SUIT_MPI_${role}_PATH) - continue() - endif() - - list(APPEND MERGE_ARGS "--file" "${CONFIG_SUIT_MPI_${role}_PATH}") - endforeach() - - set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} - mpi - merge - ${MERGE_ARGS} - ) - - message(INFO " Generate merged MPI for ${area} (${output})") -endfunction() - -if(DEFINED CONFIG_SOC_SERIES_NRF54HX) -configure_storage_address_cache() -endif() # CONFIG_SOC_SERIES_NRF54HX - -if(DEFINED CONFIG_SUIT_MPI_GENERATE) - -if(DEFINED CONFIG_SUIT_MPI_SOC_NRF54H20) -include(soc/nrf54h20.cmake) -endif() # CONFIG_SUIT_MPI_SOC_NRF54H20 - -endif() # CONFIG_SUIT_MPI_GENERATE diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index b960f8dba7fa..2763eeddf753 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -59,6 +59,10 @@ function(include_suit) include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/suit.cmake) endfunction() +function(include_suit_provisioning) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/suit_provisioning.cmake) +endfunction() + function(include_packaging) include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/b0_mcuboot_signing.cmake) include(${ZEPHYR_NRF_MODULE_DIR}/subsys/bootloader/cmake/packaging.cmake) @@ -571,15 +575,6 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) endif() endif() - if(SB_CONFIG_SUIT_BUILD_RECOVERY) - set_config_bool(${DEFAULT_IMAGE} CONFIG_SUIT_MPI_APP_RECOVERY y) - set_config_bool(${DEFAULT_IMAGE} CONFIG_SUIT_MPI_RAD_RECOVERY y) - - if(SB_CONFIG_SUIT_RECOVERY_APPLICATION_IMAGE_MANIFEST_APP_LOCAL_3) - set_config_bool(${DEFAULT_IMAGE} CONFIG_SUIT_MPI_APP_LOCAL_3 y) - endif() - endif() - if(SB_CONFIG_SDP) include_sdp() endif() @@ -661,6 +656,7 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake) endif() include_packaging() + include_suit_provisioning() include_suit() if(SB_CONFIG_SECURE_BOOT OR SB_CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) diff --git a/subsys/suit/provisioning/Kconfig b/sysbuild/Kconfig.suit_provisioning similarity index 65% rename from subsys/suit/provisioning/Kconfig rename to sysbuild/Kconfig.suit_provisioning index 3d5e0ab7dd2c..b9967a6c1c68 100644 --- a/subsys/suit/provisioning/Kconfig +++ b/sysbuild/Kconfig.suit_provisioning @@ -12,7 +12,11 @@ config SUIT_MPI_GENERATE if SUIT_MPI_GENERATE -rsource "soc/Kconfig.nrf54h20" +config SUIT_ENVELOPE_OUTPUT_MPI_MERGE + bool "Merge MPI files into final SUIT_ENVELOPE_OUTPUT_ARTIFACT" + default y + +rsource "suit_provisioning/Kconfig.nrf54h20" endif # SUIT_MPI_GENERATE diff --git a/sysbuild/Kconfig.sysbuild b/sysbuild/Kconfig.sysbuild index 37a8907deaf2..958e7080ffcd 100644 --- a/sysbuild/Kconfig.sysbuild +++ b/sysbuild/Kconfig.sysbuild @@ -79,6 +79,7 @@ rsource "Kconfig.zip" rsource "Kconfig.matter" rsource "Kconfig.wifi" rsource "Kconfig.suit" +rsource "Kconfig.suit_provisioning" rsource "Kconfig.sdp" rsource "Kconfig.approtect" rsource "Kconfig.lwm2m_carrier" diff --git a/subsys/suit/provisioning/soc/Kconfig.nrf54h20 b/sysbuild/suit_provisioning/Kconfig.nrf54h20 similarity index 96% rename from subsys/suit/provisioning/soc/Kconfig.nrf54h20 rename to sysbuild/suit_provisioning/Kconfig.nrf54h20 index 7d0e7edf7c4a..ee65d88c0a94 100644 --- a/subsys/suit/provisioning/soc/Kconfig.nrf54h20 +++ b/sysbuild/suit_provisioning/Kconfig.nrf54h20 @@ -47,6 +47,7 @@ manifest-mpi-offset=0x2030 menuconfig SUIT_MPI_$(manifest) bool "Application recovery manifest configuration" + default y if SUIT_BUILD_RECOVERY rsource "Kconfig.template.manifest_config" @@ -84,6 +85,7 @@ manifest-mpi-offset=0x20c0 menuconfig SUIT_MPI_$(manifest) bool "Application local (3) manifest configuration" + default y if SUIT_RECOVERY_APPLICATION_IMAGE_MANIFEST_APP_LOCAL_3 rsource "Kconfig.template.manifest_config" @@ -113,6 +115,7 @@ manifest-mpi-offset=0x1000 menuconfig SUIT_MPI_$(manifest) bool "Radio recovery manifest configuration" + default y if SUIT_BUILD_RECOVERY rsource "Kconfig.template.manifest_config" diff --git a/subsys/suit/provisioning/soc/Kconfig.template.manifest_config b/sysbuild/suit_provisioning/Kconfig.template.manifest_config similarity index 100% rename from subsys/suit/provisioning/soc/Kconfig.template.manifest_config rename to sysbuild/suit_provisioning/Kconfig.template.manifest_config diff --git a/west.yml b/west.yml index 20a443a6e307..87bcac2f8433 100644 --- a/west.yml +++ b/west.yml @@ -69,7 +69,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 711346aa377a65263784cd0d37efc9230e68229b + revision: 6e53c5702ecb1f3dddfdc051ff487550d6c24672 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -242,7 +242,7 @@ manifest: upstream-sha: c6eaeda5a1c1c5dbb24dce7e027340cb8893a77b compare-by-default: false - name: suit-generator - revision: 0e660519a58adba119d552e90fcbca8e430490a4 + revision: 9bd5f35396bea61f6c8e6aaebc00635364522ce6 path: modules/lib/suit-generator - name: suit-processor revision: a499bcadceff8877da63a0a140c6a91ff2f87b25