Hi,
I've just stared working on a feature that uses the PUF, and I wanted to store the AC in FFR to make sure I don't accidentally erase it when I erase my application settings which I keep in a designated part of the normal flash.
Since I don't (yet) use secure boot or PRINCE, I didn't create any keycodes for the key slots of the key code storage - I just put the AC and the magic value that indicates a valid AC into a 3*512 buffer and called ffr_keystore_write() on it.
Now my CPU doesn't boot up properly, which I assume is due to some sanity check in the boot ROM freaking out about the unexpected contents of the keystore flash.
Now, on to my questions:
* Is the non-booting due to the missing keys?
* Would it have worked properly if I had filled in the PRINCE0-2 keycode slots before writing the flash, or is there something else needed in addition to that?
* Is there any way to erase the relevant part of the flash to get my CPU up and running again?
The USB bootloader doesn't work, so I guess it stops early in the boot process. I haven't made any changes to the CMPA page (secure boot, PRINCE settings, etc), they should all be at their default values.
This is the code I used to write the AC to flash:
uint8_t keystore[512*3];
memset(keystore, 0, sizeof(keystore));
*((uint32_t*)&keystore[0]) = 0x95959595; // marker indicating AC is valid
*((uint32_t*)&keystore[4]) = 0; // PUF discharge time in ms, 0 is default
memmove(&keystore[8], ac, sizeof(ac));
// TODO what about the other keys, do we want to set them too?
result = FFR_KeystoreWrite(&flash_config, (void*)keystore);