Skip to content

Commit

Permalink
suit: use SUIT boot by default for nrf54h20
Browse files Browse the repository at this point in the history
Use SUIT envelopes to boot the nrf54h20 samples.

Ref: NCSDK-27372

Signed-off-by: Robert Stypa <[email protected]>
  • Loading branch information
robertstypa committed May 29, 2024
1 parent 0e99b70 commit 8cca80f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
19 changes: 17 additions & 2 deletions cmake/sysbuild/suit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ function(suit_create_package)

suit_set_absolute_or_relative_path(${SB_CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION} ${PROJECT_BINARY_DIR} INPUT_TEMPLATES_DIRECTORY)
set(ENVELOPE_SHALL_BE_SIGNED ${SB_CONFIG_SUIT_ENVELOPE_SIGN})
if(NOT DEFINED west_realpath)
# Twister build - ignore and store in the build folder!
set(SB_CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION "./")
endif()
sysbuild_get(ENVELOPE_SHALL_BE_SIGNED IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_SIGN KCONFIG)
if(NOT DEFINED ENVELOPE_SHALL_BE_SIGNED)
set(ENVELOPE_SHALL_BE_SIGNED FALSE)
endif()
Expand Down Expand Up @@ -202,9 +207,14 @@ function(suit_create_package)
unset(GENERATE_LOCAL_ENVELOPE)

sysbuild_get(INPUT_ENVELOPE_JINJA_FILE IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TEMPLATE KCONFIG)
sysbuild_get(target IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TARGET KCONFIG)
suit_set_absolute_or_relative_path(${INPUT_ENVELOPE_JINJA_FILE} ${PROJECT_BINARY_DIR} INPUT_ENVELOPE_JINJA_FILE)

sysbuild_get(target IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TARGET KCONFIG)
sysbuild_get(BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE)
sysbuild_get(BINARY_FILE IMAGE ${image} VAR CONFIG_KERNEL_BIN_NAME KCONFIG)
if (NOT DEFINED INPUT_ENVELOPE_JINJA_FILE OR INPUT_ENVELOPE_JINJA_FILE STREQUAL "")
message(STATUS "DFU: Input SUIT template for ${image} is not defined. Skipping.")
continue()
endif()
suit_copy_input_template(${INPUT_TEMPLATES_DIRECTORY} "${INPUT_ENVELOPE_JINJA_FILE}" ENVELOPE_JINJA_FILE)
if(NOT DEFINED ENVELOPE_JINJA_FILE)
message(SEND_ERROR "DFU: Creation of SUIT artifacts failed.")
Expand All @@ -223,6 +233,7 @@ function(suit_create_package)
endforeach()

set(INPUT_ROOT_ENVELOPE_JINJA_FILE ${SB_CONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE})
suit_set_absolute_or_relative_path(${INPUT_ROOT_ENVELOPE_JINJA_FILE} ${PROJECT_BINARY_DIR} INPUT_ROOT_ENVELOPE_JINJA_FILE)

# create root envelope if defined
if(DEFINED INPUT_ROOT_ENVELOPE_JINJA_FILE AND NOT INPUT_ROOT_ENVELOPE_JINJA_FILE STREQUAL "")
Expand Down Expand Up @@ -287,6 +298,10 @@ function(suit_setup_merge)
sysbuild_get(IMAGE_BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE)
sysbuild_get(IMAGE_BINARY_FILE IMAGE ${image} VAR CONFIG_KERNEL_BIN_NAME KCONFIG)
sysbuild_get(IMAGE_TARGET_NAME IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TARGET KCONFIG)
if (NOT DEFINED IMAGE_TARGET_NAME OR IMAGE_TARGET_NAME STREQUAL "")
message(STATUS "DFU: Target name for ${image} is not defined. Skipping.")
continue()
endif()

sysbuild_get(CONFIG_SUIT_ENVELOPE_OUTPUT_ARTIFACT IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_OUTPUT_ARTIFACT KCONFIG)
sysbuild_get(CONFIG_NRF_REGTOOL_GENERATE_UICR IMAGE ${image} VAR CONFIG_NRF_REGTOOL_GENERATE_UICR KCONFIG)
Expand Down
1 change: 1 addition & 0 deletions subsys/suit/provisioning/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ menu "SUIT provisioning"

config SUIT_MPI_GENERATE
bool "Generate SUIT Manifest Provisioning Information binary"
default y if SOC_SERIES_NRF54HX

if SUIT_MPI_GENERATE

Expand Down
2 changes: 1 addition & 1 deletion sysbuild/Kconfig.suit
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

menu "SUIT"

# 'default y if SOC_SERIES_NRF54HX' to be added when SUIT is to be enabled globally.
menuconfig SUIT_ENVELOPE
bool "Create SUIT envelope"
default y if SOC_SERIES_NRF54HX
help
Enable DFU SUIT envelope creation

Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ manifest:
upstream-sha: c6eaeda5a1c1c5dbb24dce7e027340cb8893a77b
compare-by-default: false
- name: suit-generator
revision: 93f1fbba4283da95479cafb7e59b7fea11cbda07
revision: 72e873da8201d8f48e2821ee0ae1b076e081cc5d
path: modules/lib/suit-generator
- name: suit-processor
revision: dcb84006795fe99b497e044f3435988d206ac177
Expand Down

0 comments on commit 8cca80f

Please sign in to comment.