Skip to content

Commit 4bda366

Browse files
committed
Add PSA support in old update client
1. Add configuration UPDATE_CLIENT_STORAGE_PSA for PSA Firmware Update 2. Fix compile errors for PSA targets having no ARM_UC_FEATURE_PAL_FLASHIAP support 3. Support in-transit hash validation for targets like PSA having no read permission and unable to do read-back hash validation from storage
1 parent d7edc52 commit 4bda366

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

update-client-hub/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
"delta-storage-size": {
6767
"help": "Total storage allocated for delta image. This config item is only for multicast update.",
6868
"value": null
69+
},
70+
"in-transit-hash-validation": {
71+
"help": "Calculate payload hash in transit and not by reading back from storage. Useful on platforms without read permission.",
72+
"value": 0
6973
}
7074
}
7175
}

update-client-hub/modules/common/update-client-common/arm_uc_config.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,18 @@ ARM_UC_FEATURE_SIMPLE_COAP_SOURCE
357357
#define ARM_UC_FEATURE_PAL_LINUX 0
358358
#define ARM_UC_FEATURE_PAL_RTL8195AM 1
359359

360+
#elif defined(UPDATE_CLIENT_STORAGE_PSA)
361+
#define ARM_UC_FEATURE_PAL_FLASHIAP 0
362+
#define ARM_UC_FEATURE_PAL_FLASHIAP_MCUBOOT 0
363+
#define ARM_UC_FEATURE_PAL_BLOCKDEVICE 0
364+
#define ARM_UC_FEATURE_PAL_FILESYSTEM 0
365+
#define ARM_UC_FEATURE_PAL_LINUX 0
366+
#define ARM_UC_FEATURE_PAL_RTL8195AM 0
367+
#define ARM_UC_FEATURE_PAL_PSA 1
368+
/* Disable ARM_UC_FEATURE_DELTA_PAAL which relies on ARM_UC_FEATURE_PAL_FLASHIAP */
369+
#undef ARM_UC_FEATURE_DELTA_PAAL
370+
#define ARM_UC_FEATURE_DELTA_PAAL 0
371+
360372
#else /* support legacy configuration method for storage */
361373

362374
#if defined(ARM_UC_USE_PAL_BLOCKDEVICE) && (ARM_UC_USE_PAL_BLOCKDEVICE == 1)

update-client-hub/modules/firmware-manager/source/arm_uc_firmware_manager.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,14 @@ static void arm_uc_internal_event_handler(uintptr_t event)
300300
{
301301
switch (event) {
302302
case ARM_UC_PAAL_EVENT_FINALIZE_DONE:
303+
#if defined(ARM_UC_FEATURE_PAL_PSA) && (ARM_UC_FEATURE_PAL_PSA == 1)
304+
/* PAL using like PSA FWU API doesn't support storage read of firmware candidate (no psa_fwu_read()).
305+
* Disable storage hash validation. */
306+
event = UCFM_EVENT_FINALIZE_DONE;
307+
arm_uc_signal_ucfm_handler(event);
308+
#else
303309
event_handler_finalize();
310+
#endif
304311
break;
305312
case ARM_UC_PAAL_EVENT_READ_DONE:
306313
if (ARM_UC_HUB_getState() == ARM_UC_HUB_STATE_WAIT_FOR_MULTICAST ||

0 commit comments

Comments
 (0)