7 printf(
"=== Clear nonces app ===");
11 uint32_t nonces_addr = 2200;
13 const size_t nonces_size = 14;
15 uint8_t nonces[nonces_size] = {};
18 status =
fram_read(nonces_addr, nonces_size, nonces);
20 printf(
"Error! Could not read current nonces.\n");
22 printf(
"Current nonces buffer:");
23 for (
size_t i = 0;
i < nonces_size;
i++) {
24 printf(
"%02x ", nonces[
i]);
29 memset(nonces, 0, nonces_size);
30 status =
fram_write(nonces_addr, nonces, nonces_size);
32 printf(
"Error could not write to nonces.\n");
35 status =
fram_read(nonces_addr, nonces_size, nonces);
37 printf(
"Error! Could not read current nonces.\n");
39 printf(
"New nonces buffer:");
40 for (
size_t i = 0;
i < nonces_size;
i++) {
41 printf(
"%02x ", nonces[
i]);
45 printf(
"New nonces buffer should be all zeros.\n");
fram_status fram_write(fram_addr addr, const uint8_t *data, size_t len)
Write bytes at the given address.
fram_status fram_read(fram_addr addr, size_t len, uint8_t *data)
Read bytes at the given address.