-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SUIT support for nRF9280 EngB product. Signed-off-by: Tuomas Parttimaa <[email protected]>
- Loading branch information
Showing
31 changed files
with
3,686 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
177 changes: 177 additions & 0 deletions
177
config/suit/templates/nrf9280/default/v1/app_envelope.yaml.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
{%- 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') %} | ||
SUIT_Envelope_Tagged: | ||
suit-authentication-wrapper: | ||
SuitDigest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-manifest: | ||
suit-manifest-version: 1 | ||
{%- if APP_LOCAL_1_SEQ_NUM is defined %} | ||
suit-manifest-sequence-number: {{ APP_LOCAL_1_SEQ_NUM }} | ||
{%- elif DEFAULT_SEQ_NUM is defined %} | ||
suit-manifest-sequence-number: {{ DEFAULT_SEQ_NUM }} | ||
{%- else %} | ||
suit-manifest-sequence-number: 1 | ||
{%- endif %} | ||
suit-common: | ||
suit-components: | ||
- - MEM | ||
- {{ application['dt'].label2node['cpu'].unit_addr }} | ||
- {{ get_absolute_address(application['dt'].chosen_nodes['zephyr,code-partition']) }} | ||
- {{ application['dt'].chosen_nodes['zephyr,code-partition'].regs[0].size }} | ||
- - CAND_IMG | ||
- 0 | ||
suit-shared-sequence: | ||
- suit-directive-set-component-index: 0 | ||
- suit-directive-override-parameters: | ||
suit-parameter-vendor-identifier: | ||
RFC4122_UUID: {{ mpi_application_vendor_name }} | ||
suit-parameter-class-identifier: | ||
RFC4122_UUID: | ||
namespace: {{ mpi_application_vendor_name }} | ||
name: {{ mpi_application_class_name }} | ||
suit-parameter-image-digest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-digest-bytes: | ||
file: {{ application['binary'] }} | ||
suit-parameter-image-size: | ||
file: {{ application['binary'] }} | ||
- suit-condition-vendor-identifier: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-condition-class-identifier: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
suit-validate: | ||
- suit-directive-set-component-index: 0 | ||
# In the case of streaming operations it is worth to retry them at least once. | ||
# This increases the robustness against bit flips on the transport, | ||
# for example when storing the data on an external memory device. | ||
# The suit-directive-try-each will complete on the first successful subsequence. | ||
- suit-directive-try-each: | ||
- - suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- - suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
suit-invoke: | ||
- suit-directive-set-component-index: 0 | ||
- suit-directive-invoke: | ||
- suit-send-record-failure | ||
|
||
{%- if APP_LOCAL_1_VERSION is defined %} | ||
suit-current-version: {{ APP_LOCAL_1_VERSION }} | ||
{%- elif DEFAULT_VERSION is defined %} | ||
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'] != '' %} | ||
suit-parameter-uri: '{{ application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' | ||
{%- else %} | ||
suit-parameter-uri: '#{{ application['name'] }}' | ||
{%- endif %} | ||
suit-parameter-image-digest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-digest-bytes: | ||
file: {{ application['binary'] }} | ||
- suit-directive-fetch: | ||
- suit-send-record-failure | ||
- suit-directive-try-each: | ||
- - suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- - suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-directive-set-component-index: 0 | ||
- suit-directive-override-parameters: | ||
suit-parameter-source-component: 1 | ||
# When copying the data it is worth to retry the sequence of | ||
# suit-directive-copy and suit-condition-image-match at least once. | ||
# If a bit flip occurs, it might be due to a transport issue, not | ||
# a corrupted candidate image. In this case the bit flip is recoverable | ||
# and it is worth retrying the operation. | ||
# The suit-directive-try-each will complete on the first successful subsequence. | ||
- suit-directive-try-each: | ||
- - suit-directive-copy: | ||
- suit-send-record-failure | ||
- suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- - suit-directive-copy: | ||
- suit-send-record-failure | ||
- suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
suit-text: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
|
||
suit-candidate-verification: | ||
- 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'] != '' %} | ||
suit-parameter-uri: '{{ application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' | ||
{%- else %} | ||
suit-parameter-uri: '#{{ application['name'] }}' | ||
{%- endif %} | ||
suit-parameter-image-digest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-digest-bytes: | ||
file: {{ application['binary'] }} | ||
- suit-directive-fetch: | ||
- suit-send-record-failure | ||
- suit-directive-try-each: | ||
- - suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- - suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
|
||
suit-manifest-component-id: | ||
- INSTLD_MFST | ||
- RFC4122_UUID: | ||
namespace: {{ mpi_application_vendor_name }} | ||
name: {{ mpi_application_class_name }} | ||
suit-text: | ||
en: | ||
'["MEM", {{ application['dt'].label2node['cpu'].unit_addr }}, {{ get_absolute_address(application['dt'].chosen_nodes['zephyr,code-partition']) }}, {{ application['dt'].chosen_nodes['zephyr,code-partition'].regs[0].size }}]': | ||
suit-text-vendor-name: Nordic Semiconductor ASA | ||
suit-text-model-name: nRF9280_cpuapp | ||
suit-text-vendor-domain: nordicsemi.com | ||
suit-text-model-info: The nRF9280 application core | ||
suit-text-component-description: Sample application core FW | ||
suit-text-component-version: v1.0.0 | ||
{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in application['config'] or application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} | ||
suit-integrated-payloads: | ||
'#{{ application['name'] }}': {{ application['binary'] }} | ||
{%- endif %} |
194 changes: 194 additions & 0 deletions
194
config/suit/templates/nrf9280/default/v1/app_recovery_envelope_app_local.yaml.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
{%- 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') %} | ||
SUIT_Envelope_Tagged: | ||
suit-authentication-wrapper: | ||
SuitDigest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-manifest: | ||
suit-manifest-version: 1 | ||
{%- if APP_RECOVERY_SEQ_NUM is defined %} | ||
suit-manifest-sequence-number: {{ APP_RECOVERY_SEQ_NUM }} | ||
{%- elif DEFAULT_SEQ_NUM is defined %} | ||
suit-manifest-sequence-number: {{ DEFAULT_SEQ_NUM }} | ||
{%- else %} | ||
suit-manifest-sequence-number: 1 | ||
{%- endif %} | ||
suit-common: | ||
suit-components: | ||
{%- set component_index = 0 %} | ||
- - CAND_MFST | ||
- 0 | ||
{%- set component_index = component_index + 1 %} | ||
{%- if app_recovery_img is defined %} | ||
{%- set app_recovery_local_instld_mfst_component_index = component_index %} | ||
{{- component_list.append( app_recovery_local_instld_mfst_component_index ) or ""}} | ||
{{- dependencies_list.append( app_recovery_local_instld_mfst_component_index ) or ""}} | ||
- - INSTLD_MFST | ||
- RFC4122_UUID: | ||
namespace: {{ mpi_app_recovery_local_vendor_name }} | ||
name: {{ mpi_app_recovery_local_class_name }} | ||
{%- set component_index = component_index + 1 %} | ||
{%- endif %} | ||
{%- if rad_recovery is defined %} | ||
{%- set rad_instld_mfst_component_index = component_index %} | ||
{{- component_list.append( rad_instld_mfst_component_index ) or ""}} | ||
{{- dependencies_list.append( rad_instld_mfst_component_index ) or ""}} | ||
- - INSTLD_MFST | ||
- RFC4122_UUID: | ||
namespace: {{ mpi_rad_recovery_vendor_name }} | ||
name: {{ mpi_rad_recovery_class_name }} | ||
{%- set component_index = component_index + 1 %} | ||
{%- endif %} | ||
|
||
suit-shared-sequence: | ||
{%- if rad_recovery is defined %} | ||
- suit-directive-set-component-index: {{ rad_instld_mfst_component_index }} | ||
- suit-directive-override-parameters: | ||
suit-parameter-vendor-identifier: | ||
RFC4122_UUID: {{ mpi_app_recovery_vendor_name }} | ||
suit-parameter-class-identifier: | ||
RFC4122_UUID: | ||
namespace: {{ mpi_app_recovery_vendor_name }} | ||
name: {{ mpi_app_recovery_class_name }} | ||
{%- endif %} | ||
{%- if app_recovery_img is defined %} | ||
- suit-directive-set-component-index: {{ app_recovery_local_instld_mfst_component_index }} | ||
- suit-directive-override-parameters: | ||
suit-parameter-vendor-identifier: | ||
RFC4122_UUID: {{ mpi_app_recovery_local_vendor_name }} | ||
suit-parameter-class-identifier: | ||
RFC4122_UUID: | ||
namespace: {{ mpi_app_recovery_local_vendor_name }} | ||
name: {{ mpi_app_recovery_class_name }} | ||
{%- endif %} | ||
- suit-directive-set-component-index: [{{ component_list|join(',') }}] | ||
- suit-condition-vendor-identifier: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-condition-class-identifier: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
suit-dependencies: | ||
# Key is the index of suit-components that describe the dependency manifest | ||
"0": {} | ||
{%- for component_element in dependencies_list %} | ||
"{{ component_element }}": {} | ||
{%- endfor %} | ||
|
||
suit-validate: | ||
{% if dependencies_list|length > 0 %} | ||
- suit-directive-set-component-index: [{{ dependencies_list|join(',') }}] | ||
- suit-condition-dependency-integrity: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-directive-process-dependency: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
{% endif %} | ||
|
||
suit-invoke: | ||
{% if dependencies_list|length > 0 %} | ||
- suit-directive-set-component-index: [{{ dependencies_list|join(',') }}] | ||
- suit-condition-dependency-integrity: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-directive-process-dependency: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
{% endif %} | ||
|
||
{%- if APP_RECOVERY_VERSION is defined %} | ||
suit-current-version: {{ APP_RECOVERY_VERSION }} | ||
{%- elif DEFAULT_VERSION is defined %} | ||
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: | ||
suit-parameter-uri: '#{{ rad_recovery['name'] }}' | ||
suit-parameter-image-digest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-digest-bytes: | ||
envelope: {{ artifacts_folder ~ rad_recovery['name'] }}.suit | ||
- suit-directive-fetch: | ||
- suit-send-record-failure | ||
- suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-condition-dependency-integrity: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-directive-process-dependency: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
{%- endif %} | ||
{%- if app_recovery_img is defined %} | ||
- suit-directive-set-component-index: 0 | ||
- suit-directive-override-parameters: | ||
suit-parameter-uri: '#{{ app_recovery_img['name'] }}' | ||
suit-parameter-image-digest: | ||
suit-digest-algorithm-id: cose-alg-sha-256 | ||
suit-digest-bytes: | ||
envelope: {{ artifacts_folder ~ app_recovery_img['name'] }}.suit | ||
- suit-directive-fetch: | ||
- suit-send-record-failure | ||
- suit-condition-image-match: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-condition-dependency-integrity: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
- suit-directive-process-dependency: | ||
- suit-send-record-success | ||
- suit-send-record-failure | ||
- suit-send-sysinfo-success | ||
- suit-send-sysinfo-failure | ||
{%- endif %} | ||
suit-manifest-component-id: | ||
- INSTLD_MFST | ||
- RFC4122_UUID: | ||
namespace: {{ mpi_app_recovery_vendor_name }} | ||
name: {{ mpi_app_recovery_class_name }} | ||
suit-integrated-dependencies: | ||
{%- if rad_recovery is defined %} | ||
'#{{ rad_recovery['name'] }}': {{ artifacts_folder ~ rad_recovery['name'] }}.suit | ||
{%- endif %} | ||
{%- if app_recovery_img is defined %} | ||
'#{{ app_recovery_img['name'] }}': {{ artifacts_folder ~ app_recovery_img['name'] }}.suit | ||
{%- endif %} |
Oops, something went wrong.