Skip to content

Commit

Permalink
suit: Update nRF9280 SUIT templates
Browse files Browse the repository at this point in the history
Update nRF9280 SUIT tempaltes to use sysbuild dictionary.

Signed-off-by: Tuomas Parttimaa <[email protected]>
  • Loading branch information
parttimaa committed Jan 9, 2025
1 parent 9896610 commit 63692db
Show file tree
Hide file tree
Showing 10 changed files with 399 additions and 169 deletions.
7 changes: 5 additions & 2 deletions cmake/sysbuild/suit_provisioning.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,15 @@ function (generate_mpi_area area)
message(INFO " Generate merged MPI for ${area} (${output})")
endfunction()

if(DEFINED SB_CONFIG_SOC_SERIES_NRF54HX)
if((DEFINED SB_CONFIG_SOC_SERIES_NRF54HX) OR
(DEFINED SB_CONFIG_SOC_SERIES_NRF92X))
configure_storage_address_cache()
endif() # SB_CONFIG_SOC_SERIES_NRF54HX
endif() # SB_CONFIG_SOC_SERIES_NRF54HX OR SB_CONFIG_SOC_SERIES_NRF92X

if(DEFINED SB_CONFIG_SUIT_MPI_GENERATE)
if(DEFINED SB_CONFIG_SUIT_MPI_SOC_NRF54H20)
include(${CMAKE_CURRENT_LIST_DIR}/suit_provisioning_nrf54h20.cmake)
elseif(DEFINED SB_CONFIG_SUIT_MPI_SOC_NRF9280)
include(${CMAKE_CURRENT_LIST_DIR}/suit_provisioning_nrf9280.cmake)
endif() # SB_CONFIG_SUIT_MPI_SOC_NRF54H20
endif() # SB_CONFIG_SUIT_MPI_GENERATE
47 changes: 47 additions & 0 deletions cmake/sysbuild/suit_provisioning_nrf9280.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# 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.
# If role is enabled, the function verifies if all required options are defined.

generate_mpi_hex(ROOT)
generate_mpi_hex(APP_RECOVERY)
generate_mpi_hex(APP_LOCAL_1)
generate_mpi_hex(APP_LOCAL_2)
generate_mpi_hex(APP_LOCAL_3)
generate_mpi_area(
APP_AREA
ROOT
APP_RECOVERY
APP_LOCAL_1
APP_LOCAL_2
APP_LOCAL_3
)

generate_mpi_hex(RAD_RECOVERY)
generate_mpi_hex(RAD_LOCAL_1)
generate_mpi_hex(RAD_LOCAL_2)
generate_mpi_area(
RAD_AREA
RAD_RECOVERY
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()
Original file line number Diff line number Diff line change
@@ -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('nRF9280_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('nRF9280_sample_app') %}
SUIT_Envelope_Tagged:
suit-authentication-wrapper:
SuitDigest:
Expand Down Expand Up @@ -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'] != '' %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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('nRF9280_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('nRF9280_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('nRF9280_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('nRF9280_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('nRF9280_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('nRF9280_sample_app_2') %}
SUIT_Envelope_Tagged:
suit-authentication-wrapper:
SuitDigest:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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('nRF9280_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('nRF9280_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('nRF9280_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('nRF9280_rad_recovery') %}
SUIT_Envelope_Tagged:
suit-authentication-wrapper:
SuitDigest:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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('nRF9280_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('nRF9280_sample_app_3') %}
SUIT_Envelope_Tagged:
suit-authentication-wrapper:
SuitDigest:
Expand Down Expand Up @@ -65,6 +65,12 @@ SUIT_Envelope_Tagged:
- suit-send-sysinfo-failure
suit-invoke:
- suit-directive-set-component-index: 0
{%- if '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] != '' %}
- suit-directive-override-parameters:
suit-parameter-invoke-args:
suit-synchronous-invoke: True
suit-timeout: 1000
{%- endif %}
- suit-directive-invoke:
- suit-send-record-failure

Expand All @@ -74,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'] != '' %}
Expand Down
14 changes: 2 additions & 12 deletions config/suit/templates/nrf9280/default/v1/rad_envelope.yaml.jinja2
Original file line number Diff line number Diff line change
@@ -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('nRF9280_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('nRF9280_sample_rad') %}
SUIT_Envelope_Tagged:
suit-authentication-wrapper:
SuitDigest:
Expand Down Expand Up @@ -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'] != '' %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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('nRF9280_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('nRF9280_sample_rad_recovery') %}
SUIT_Envelope_Tagged:
suit-authentication-wrapper:
SuitDigest:
Expand Down Expand Up @@ -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'] }}'
Expand Down
Loading

0 comments on commit 63692db

Please sign in to comment.