Skip to content

Commit

Permalink
suit: Allow for recovery with external flash
Browse files Browse the repository at this point in the history
Added modifications allowing for SUIT recovery to
be used with external flash

Signed-off-by: Artur Hadasz <[email protected]>
  • Loading branch information
ahasztag committed Dec 10, 2024
1 parent 50719b8 commit 31c7919
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
22 changes: 22 additions & 0 deletions samples/suit/recovery/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config SUIT_RECOVERY_EXTMEM
bool "External memory support for recovery application"
depends on $(dt_chosen_enabled,extmem-device)
default y
select GPIO

if SUIT_RECOVERY_EXTMEM

choice SUIT_DFU_CANDIDATE_PROCESSING_LEVEL
default SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE

endchoice # SUIT_APP_ENVELOPE_PROCESSING_LEVEL

endif # SUIT_RECOVERY_EXTMEM

source "Kconfig.zephyr"
2 changes: 1 addition & 1 deletion samples/suit/recovery/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Testing

.. code-block:: console
nrfutil device x-write --address 0xE0A5000 --value 0xFFFF --serial-port COM7
nrfutil device x-write --address 0xE0BA000 --value 0xFFFF --serial-number <segger_id>
#. Reset the device to enter the recovery path:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,22 @@
};
};
};

&cpuapp_rx_partitions {
/delete-node/ partition@b7000;
/delete-node/ cpuapp_recovery_partition;
cpuapp_recovery_partition: partition@a5000 {
reg = <0xa5000 DT_SIZE_K(84)>;
};

cpuapp_slot0_partition: partition@ba000 {
reg = <0xba000 DT_SIZE_K(792)>;
};
};

&cpuapp_rw_partitions {
/delete-node/ partition@100000;
dfu_partition: partition@180000 {
reg = < 0x180000 DT_SIZE_K(396) >;
};
};
4 changes: 4 additions & 0 deletions samples/suit/smp_transfer/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ tests:
- FILE_SUFFIX=bt
- EXTRA_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_extflash.overlay"
- SB_CONFIG_SUIT_BUILD_FLASH_COMPANION=y
- SB_CONFIG_SUIT_BUILD_RECOVERY=y
- recovery_TARGET_EXTRA_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_extflash.overlay"
# Workaround for sample.yaml - problems with strings. In the command line simply use:
# -D'SB_CONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE_FILENAME="root_with_binary_nordic_top_extflash.yaml.jinja2"'
- SB_EXTRA_CONF_FILE="sysbuild_extflash_template.conf"
Expand Down Expand Up @@ -86,8 +88,10 @@ tests:
extra_args:
- FILE_SUFFIX=bt
- EXTRA_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_extflash.overlay"
- recovery_TARGET_EXTRA_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_extflash.overlay"
- SUIT_DFU_CACHE_PARTITION_1_EB_SIZE=4096
- SB_CONFIG_SUIT_BUILD_FLASH_COMPANION=y
- SB_CONFIG_SUIT_BUILD_RECOVERY=y
# Workaround for sample.yaml - problems with strings. In the command line simply use:
# -D'SB_CONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE_FILENAME="root_with_binary_nordic_top_extflash.yaml.jinja2"'
- SB_EXTRA_CONF_FILE="sysbuild_extflash_template.conf"
Expand Down
8 changes: 7 additions & 1 deletion samples/suit/smp_transfer/sysbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ if(DEFINED hci_ipc_TARGET_EXTRA_CONF_FILE)
list(APPEND hci_ipc_EXTRA_CONF_FILE "${CMAKE_CURRENT_LIST_DIR}/${hci_ipc_TARGET_EXTRA_CONF_FILE}")
list(REMOVE_DUPLICATES hci_ipc_EXTRA_CONF_FILE)
set(hci_ipc_EXTRA_CONF_FILE "${hci_ipc_EXTRA_CONF_FILE}" CACHE INTERNAL "")
endif()
endif()

if(DEFINED recovery_TARGET_EXTRA_DTC_OVERLAY_FILE)
list(APPEND recovery_EXTRA_DTC_OVERLAY_FILE "${CMAKE_CURRENT_LIST_DIR}/${recovery_TARGET_EXTRA_DTC_OVERLAY_FILE}")
list(REMOVE_DUPLICATES recovery_EXTRA_DTC_OVERLAY_FILE)
set(recovery_EXTRA_DTC_OVERLAY_FILE "${recovery_EXTRA_DTC_OVERLAY_FILE}" CACHE INTERNAL "")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

&cpuapp_rx_partitions {
/delete-node/ partition@a6000;
cpuapp_slot0_partition: partition@a5000 {
reg = <0xa5000 DT_SIZE_K(256)>;
cpuapp_recovery_partition: partition@a5000 {
reg = <0xa5000 DT_SIZE_K(72)>;
};

cpuapp_recovery_partition: partition@e5000 {
reg = <0xe5000 DT_SIZE_K(72)>;
cpuapp_slot0_partition: partition@b7000 {
reg = <0xb7000 DT_SIZE_K(256)>;
};

/* Delete PPR code partition */
Expand Down

0 comments on commit 31c7919

Please sign in to comment.