From 4dc75a302169f3e4d9a3297ef28e55ea2ff38ebe Mon Sep 17 00:00:00 2001 From: Artur Hadasz Date: Tue, 3 Sep 2024 14:46:43 +0200 Subject: [PATCH] samples: suit: smp_transfer: Images flashed separately to ext flash This commit adds configurations to the smp_transfer sample, which allow separating the firmware images from the root envelope and sending them separately to the external flash. The manifests templates was modified so that such update works. Signed-off-by: Artur Hadasz --- samples/suit/smp_transfer/sample.yaml | 19 +++++++++++++++++++ .../app_envelope_extflash.yaml.jinja2 | 6 ++++++ .../rad_envelope_extflash.yaml.jinja2 | 6 ++++++ 3 files changed, 31 insertions(+) diff --git a/samples/suit/smp_transfer/sample.yaml b/samples/suit/smp_transfer/sample.yaml index 34fc5c59bbd..e05b216343c 100644 --- a/samples/suit/smp_transfer/sample.yaml +++ b/samples/suit/smp_transfer/sample.yaml @@ -52,3 +52,22 @@ tests: - OVERLAY_CONFIG="sysbuild/smp_transfer_bt.conf" - SB_OVERLAY_CONFIG="sysbuild_bt.conf" tags: suit bluetooth ci_samples_suit + + sample.suit.smp_transfer.full.extflash.extracted_cache: + extra_args: + - FILE_SUFFIX=extflash + - SUIT_DFU_CACHE_PARTITION_1_EB_SIZE=4096 + extra_configs: + - CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE=y + tags: suit ci_samples_suit + + sample.suit.smp_transfer.full.extflash.bt.extracted_cache: + extra_args: + - FILE_SUFFIX=extflash + - OVERLAY_CONFIG="sysbuild/smp_transfer_bt.conf" + - SB_OVERLAY_CONFIG="sysbuild_bt.conf" + - SUIT_DFU_CACHE_PARTITION_1_EB_SIZE=4096 + - hci_ipc_CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE=y + extra_configs: + - CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE=y + tags: suit bluetooth ci_samples_suit 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 5b5ebc196ee..c699ebe37a7 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 @@ -86,12 +86,14 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} +{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in application['config'] or application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} suit-payload-fetch: - suit-directive-set-component-index: 2 - suit-directive-override-parameters: suit-parameter-uri: 'file://{{ application['filename'] }}' - suit-directive-fetch: - suit-send-record-failure +{%- endif %} suit-install: {%- if flash_companion is defined %} - suit-directive-set-component-index: 1 @@ -123,7 +125,11 @@ SUIT_Envelope_Tagged: {%- 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: 'file://{{ application['filename'] }}' +{%- endif %} suit-parameter-image-digest: suit-digest-algorithm-id: cose-alg-sha-256 suit-digest-bytes: 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 29b34a4e87b..e8c9374b976 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 @@ -77,16 +77,22 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} +{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in radio['config'] or radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} suit-payload-fetch: - suit-directive-set-component-index: 2 - suit-directive-override-parameters: suit-parameter-uri: 'file://{{ radio['filename'] }}' - suit-directive-fetch: - suit-send-record-failure +{%- endif %} suit-install: - 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'] != '' %} + suit-parameter-uri: '{{ radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' +{%- else %} suit-parameter-uri: 'file://{{ radio['filename'] }}' +{%- endif %} - suit-directive-fetch: - suit-send-record-failure - suit-condition-image-match: