Skip to content

Commit

Permalink
suit: Move recovery button to app tools
Browse files Browse the repository at this point in the history
Created a SUIT app_tools directory and moved
the recovery button subsys into this directory

Signed-off-by: Artur Hadasz <[email protected]>
  • Loading branch information
ahasztag authored and nordicjm committed Dec 6, 2024
1 parent 438cbea commit 8528b92
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SUIT_Envelope_Tagged:
- suit-send-sysinfo-failure
suit-invoke:
- suit-directive-set-component-index: 0
{%- if 'CONFIG_SUIT_RECOVERY_BUTTON' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_RECOVERY_BUTTON] != '' %}
{%- 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{%- set mpi_app_recovery_local_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %}
{%- set mpi_app_recovery_local_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %}
{%- endif %}
{%- 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] != '' %}
{%- 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] != '' %}
{%- set recovery_button_check_on_invoke = True %}
{%- else %}
{%- set recovery_button_check_on_invoke = False %}
Expand Down
2 changes: 1 addition & 1 deletion subsys/suit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#

add_subdirectory(provisioning)
add_subdirectory(app_tools)
add_subdirectory_ifdef(CONFIG_SUIT plat_err)
add_subdirectory_ifdef(CONFIG_SUIT memory_layout)
add_subdirectory_ifdef(CONFIG_SUIT_ORCHESTRATOR orchestrator)
Expand All @@ -21,5 +22,4 @@ add_subdirectory_ifdef(CONFIG_SUIT_ENVELOPE_INFO envelope_info)
add_subdirectory_ifdef(CONFIG_SUIT_EXECUTION_MODE execution_mode)
add_subdirectory_ifdef(CONFIG_SUIT_VALIDATOR validator)
add_subdirectory_ifdef(CONFIG_SUIT_EVENTS events)
add_subdirectory_ifdef(CONFIG_SUIT_RECOVERY_BUTTON recovery_button)
add_subdirectory_ifdef(CONFIG_SUIT_MANIFEST_VARIABLES manifest_variables)
2 changes: 1 addition & 1 deletion subsys/suit/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ rsource "execution_mode/Kconfig"
rsource "memory_layout/Kconfig"
rsource "validator/Kconfig"
rsource "events/Kconfig"
rsource "recovery_button/Kconfig"
rsource "app_tools/Kconfig"
rsource "manifest_variables/Kconfig"

# Configure SUIT_LOG_LEVEL
Expand Down
7 changes: 7 additions & 0 deletions subsys/suit/app_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

add_subdirectory_ifdef(CONFIG_SUIT_RECOVERY_BUTTON recovery_button)
16 changes: 16 additions & 0 deletions subsys/suit/app_tools/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP
bool "Run recovery before main application on startup"
help
This Kconfig option should be set if the app_local_3 manifest application should be invoked
on startup before the main application.
This is useful if a companion image (most commonly the same iamge as the recovery application
core image) is to be used for checking conditions (such as checking
if a button is pressed) and optionally entering the recovery mode.

rsource "recovery_button/Kconfig"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ DT_CHOSEN_NCS_RECOVERY_BUTTON := ncs,recovery-button
config SUIT_RECOVERY_BUTTON
bool "Enable SUIT enter recovery button checking on startup"
depends on $(dt_chosen_enabled,$(DT_CHOSEN_NCS_RECOVERY_BUTTON))
default y
select SSF_SUIT_SERVICE_ENABLED
select SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP
help
This will make the firmware check if the recovery button specified in the
device tree is pressed on startup. If it is, the firmware will enter
Expand Down

0 comments on commit 8528b92

Please sign in to comment.