Skip to content

Commit c6a3f97

Browse files
adsz-nordicrlubos
authored andcommitted
suit: Rework SDFW and SDFW Recovery sinks
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ł <[email protected]>
1 parent 409e92b commit c6a3f97

File tree

7 files changed

+284
-321
lines changed

7 files changed

+284
-321
lines changed

subsys/suit/plat_err/include/suit_plat_err.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ typedef int suit_plat_err_t;
9797
#define SUIT_PLAT_ERR_UNSUPPORTED -2010 /**< Attempt to perform an unsupported operation */
9898
#define SUIT_PLAT_ERR_IPC -2011 /**< IPC error */
9999
#define SUIT_PLAT_ERR_NO_RESOURCES -2012 /**< Not enough resources */
100+
#define SUIT_PLAT_ERR_SDRFW_FAILURE -2013 /**< Failure during SDFW Recovery update */
100101

101102
/**
102103
* If the error code is a common platform error code return it.

subsys/suit/platform/sdfw/src/suit_plat_copy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,11 @@ int suit_plat_copy(suit_component_t dst_handle, suit_component_t src_handle,
363363
}
364364

365365
if (ret == SUIT_SUCCESS) {
366-
ret = suit_generic_address_streamer_stream(payload_ptr, payload_size, &dst_sink);
367-
if (ret != SUIT_PLAT_SUCCESS) {
368-
LOG_ERR("memptr_streamer failed - error %i", ret);
366+
plat_ret =
367+
suit_generic_address_streamer_stream(payload_ptr, payload_size, &dst_sink);
368+
if (plat_ret != SUIT_PLAT_SUCCESS) {
369+
LOG_ERR("memptr_streamer failed - error %i", plat_ret);
370+
ret = suit_plat_err_to_processor_err_convert(plat_ret);
369371
}
370372
}
371373
#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */

subsys/suit/platform/src/suit_plat_error_convert.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ int suit_plat_err_to_processor_err_convert(suit_plat_err_t plat_err)
2424
case SUIT_PLAT_ERR_CBOR_DECODING:
2525
proc_err = SUIT_ERR_DECODING;
2626
break;
27+
case SUIT_PLAT_ERR_SDRFW_FAILURE:
28+
proc_err = SUIT_FAIL_CONDITION;
29+
break;
2730
/* To be extended */
2831
default:
2932
/* Return SUIT_ERR_CRASH */

0 commit comments

Comments
 (0)