#include <include/bl_storage.h>
Set the current HW monotonic counter.
- Note
- FYI for users looking at the values directly in flash: Values are stored with their bits flipped. This is to squeeze one more value out of the counter.
- Parameters
-
[in] | counter_desc | Counter description. |
[in] | new_counter | The new counter value. Must be larger than the current value. |
- Return values
-
0 | The counter was updated successfully. |
-EINVAL | new_counter is invalid (must be larger than current counter, and cannot be 0xFFFF). |
-ENOMEM | There are no more free counter slots (see embed:rst:inline :kconfig:option:`CONFIG_SB_NUM_VER_COUNTER_SLOTS` ). |