Skip to content

Commit

Permalink
suit: Rework SDFW and SDFW Recovery sinks
Browse files Browse the repository at this point in the history
New implementation of SDFW and SDFW Recovery sinks.
Supports fixed installation order (SDFW, then SDFW Recovery).
Treats SDFW Recovery installation as optional.
Envelope is saved when SDFW slot is successfully installed.

Ref: NCSDK-29561

Signed-off-by: Adam Szczygieł <adam.szczygiel@nordicsemi.no>
  • Loading branch information
adsz-nordic committed Nov 5, 2024
1 parent cd64ee9 commit 5db4710
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 321 deletions.
1 change: 1 addition & 0 deletions subsys/suit/plat_err/include/suit_plat_err.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ typedef int suit_plat_err_t;
#define SUIT_PLAT_ERR_UNSUPPORTED -2010 /**< Attempt to perform an unsupported operation */
#define SUIT_PLAT_ERR_IPC -2011 /**< IPC error */
#define SUIT_PLAT_ERR_NO_RESOURCES -2012 /**< Not enough resources */
#define SUIT_PLAT_ERR_SDRFW_FAILURE -2013 /**< Failure during SDFW Recovery update */

/**
* If the error code is a common platform error code return it.
Expand Down
8 changes: 5 additions & 3 deletions subsys/suit/platform/sdfw/src/suit_plat_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ int suit_plat_copy(suit_component_t dst_handle, suit_component_t src_handle,
}

if (ret == SUIT_SUCCESS) {
ret = suit_generic_address_streamer_stream(payload_ptr, payload_size, &dst_sink);
if (ret != SUIT_PLAT_SUCCESS) {
LOG_ERR("memptr_streamer failed - error %i", ret);
plat_ret =
suit_generic_address_streamer_stream(payload_ptr, payload_size, &dst_sink);
if (plat_ret != SUIT_PLAT_SUCCESS) {
LOG_ERR("memptr_streamer failed - error %i", plat_ret);
ret = suit_plat_err_to_processor_err_convert(plat_ret);
}
}
#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */
Expand Down
3 changes: 3 additions & 0 deletions subsys/suit/platform/src/suit_plat_error_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ int suit_plat_err_to_processor_err_convert(suit_plat_err_t plat_err)
case SUIT_PLAT_ERR_CBOR_DECODING:
proc_err = SUIT_ERR_DECODING;
break;
case SUIT_PLAT_ERR_SDRFW_FAILURE:
proc_err = SUIT_FAIL_CONDITION;
break;
/* To be extended */
default:
/* Return SUIT_ERR_CRASH */
Expand Down
Loading

0 comments on commit 5db4710

Please sign in to comment.