Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions boot/cypress/MCUBootApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Given solution demonstrates operation of MCUboot on Cypress' PSoC6 device.

The bundled `cy_security_cnt.c` does not implement persistent security counter
storage and fails closed. Replace it with a monotonic, power-fail-safe backend,
as required by `boot/bootutil/include/bootutil/security_cnt.h`, before enabling
`MCUBOOT_HW_ROLLBACK_PROT`.

There are two applications implemented:
* MCUBootApp - PSoC6 MCUboot-based bootloading application;
* BlinkyApp - simple PSoC6 blinking LED application which is a target of BOOT/UPGRADE;
Expand Down
12 changes: 6 additions & 6 deletions boot/cypress/MCUBootApp/cy_security_cnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@
#include "bootutil/security_cnt.h"
#include <stdint.h>

/* No persistent counter storage; see README.md. */

fih_ret
boot_nv_security_counter_init(void)
{
/* Do nothing. */
return FIH_SUCCESS;
return FIH_FAILURE;
}

fih_ret
boot_nv_security_counter_get(uint32_t image_id, fih_int *security_cnt)
{
(void)image_id;
*security_cnt = 30;
(void)security_cnt;

return FIH_SUCCESS;
FIH_RET(FIH_FAILURE);
}

int32_t
Expand All @@ -39,6 +40,5 @@ boot_nv_security_counter_update(uint32_t image_id, uint32_t img_security_cnt)
(void)image_id;
(void)img_security_cnt;

/* Do nothing. */
return 0;
return -1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- The Cypress security counter example backend now fails closed. It
previously reported a fixed counter value and discarded updates while
reporting success, so `MCUBOOT_HW_ROLLBACK_PROT` builds using it ran with
a rollback floor that never advanced.
Loading