Skip to content

Commit 8528b92

Browse files
ahasztagnordicjm
authored andcommitted
suit: Move recovery button to app tools
Created a SUIT app_tools directory and moved the recovery button subsys into this directory Signed-off-by: Artur Hadasz <[email protected]>
1 parent 438cbea commit 8528b92

File tree

9 files changed

+29
-4
lines changed

9 files changed

+29
-4
lines changed

config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ SUIT_Envelope_Tagged:
6565
- suit-send-sysinfo-failure
6666
suit-invoke:
6767
- suit-directive-set-component-index: 0
68-
{%- if 'CONFIG_SUIT_RECOVERY_BUTTON' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_RECOVERY_BUTTON] != '' %}
68+
{%- 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] != '' %}
6969
- suit-directive-override-parameters:
7070
suit-parameter-invoke-args:
7171
suit-synchronous-invoke: True

config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{%- set mpi_app_recovery_local_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %}
2121
{%- set mpi_app_recovery_local_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %}
2222
{%- endif %}
23-
{%- if app_recovery_img is defined and 'CONFIG_SUIT_RECOVERY_BUTTON' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_RECOVERY_BUTTON] != '' %}
23+
{%- 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] != '' %}
2424
{%- set recovery_button_check_on_invoke = True %}
2525
{%- else %}
2626
{%- set recovery_button_check_on_invoke = False %}

subsys/suit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66

77
add_subdirectory(provisioning)
8+
add_subdirectory(app_tools)
89
add_subdirectory_ifdef(CONFIG_SUIT plat_err)
910
add_subdirectory_ifdef(CONFIG_SUIT memory_layout)
1011
add_subdirectory_ifdef(CONFIG_SUIT_ORCHESTRATOR orchestrator)
@@ -21,5 +22,4 @@ add_subdirectory_ifdef(CONFIG_SUIT_ENVELOPE_INFO envelope_info)
2122
add_subdirectory_ifdef(CONFIG_SUIT_EXECUTION_MODE execution_mode)
2223
add_subdirectory_ifdef(CONFIG_SUIT_VALIDATOR validator)
2324
add_subdirectory_ifdef(CONFIG_SUIT_EVENTS events)
24-
add_subdirectory_ifdef(CONFIG_SUIT_RECOVERY_BUTTON recovery_button)
2525
add_subdirectory_ifdef(CONFIG_SUIT_MANIFEST_VARIABLES manifest_variables)

subsys/suit/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ rsource "execution_mode/Kconfig"
200200
rsource "memory_layout/Kconfig"
201201
rsource "validator/Kconfig"
202202
rsource "events/Kconfig"
203-
rsource "recovery_button/Kconfig"
203+
rsource "app_tools/Kconfig"
204204
rsource "manifest_variables/Kconfig"
205205

206206
# Configure SUIT_LOG_LEVEL
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
add_subdirectory_ifdef(CONFIG_SUIT_RECOVERY_BUTTON recovery_button)

subsys/suit/app_tools/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP
8+
bool "Run recovery before main application on startup"
9+
help
10+
This Kconfig option should be set if the app_local_3 manifest application should be invoked
11+
on startup before the main application.
12+
This is useful if a companion image (most commonly the same iamge as the recovery application
13+
core image) is to be used for checking conditions (such as checking
14+
if a button is pressed) and optionally entering the recovery mode.
15+
16+
rsource "recovery_button/Kconfig"

subsys/suit/recovery_button/Kconfig renamed to subsys/suit/app_tools/recovery_button/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ DT_CHOSEN_NCS_RECOVERY_BUTTON := ncs,recovery-button
99
config SUIT_RECOVERY_BUTTON
1010
bool "Enable SUIT enter recovery button checking on startup"
1111
depends on $(dt_chosen_enabled,$(DT_CHOSEN_NCS_RECOVERY_BUTTON))
12+
default y
1213
select SSF_SUIT_SERVICE_ENABLED
14+
select SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP
1315
help
1416
This will make the firmware check if the recovery button specified in the
1517
device tree is pressed on startup. If it is, the firmware will enter

0 commit comments

Comments
 (0)