Hi Javier,
Upon my understanding for your application, i guessed that you don't want to use ROM bootloader, then questions answer as below:
1. Firstly, i want you to pay attention on the below description in K82's RM.
34.3.3 Program Flash Erasable IFR Map
The program flash erasable IFR is nonvolatile information memory that can be erased but
has limited program capabilities and limited read access. The contents of the program
flash erasable IFR fields are summarized in the table found here.
34.3.3.1 Erasable Program Once Field
The Program Once Field in the program flash erasable IFR with indexes 0x20 - 0x23
provides 16 bytes of user data storage that can be programmed using the Program Once
command but cannot be read using the Read Once command. The Program Once Field in
the program flash erasable IFR with indexes 0x30 - 0x33 provides 16 bytes of user data
storage that can be programmed using the Program Once command and read using the
Read Once command. The program flash erasable IFR is erased using the Erase All
Blocks command, Erase All Blocks Unsecure command, and using the external erase all
feature (mass erase).
- How can I verify the current value of [0x20 - 0x23] ?
[Q/A] You can't verify them, because they can only be read by ROM bootlaoder.
- Is there an alternative to the elftosb tools?
[Q/A] No, there isn't.
- Can my application write the KEK at runtime?
[Q/A] No, you can't. [0x20 - 0x23] can only be programed once after using erase all block (Flash unsesure) or mass erase (Flash secured and Mass erase enabled).
- If the KEK is programmed using elftosb tools (or any existing alternative), is there ANY way to erase/reset it?
[Q/A] yes, there is. you could use "erase all block command (Flash unsesure) " or "mass erase command (Flash secured and Mass erase enabled)" .
Summary:
KEK placed in [0x20 - 0x23] can't be read by application firmware except for ROM bootloader (because of considering KEK's security).
Upon your application requirement and K82's features, i proposed that your KEK is same with SB Key placed in [0x30 - 0x33] . Your application must read it, then use it to decrypt keyblob, finally config OTFAD.
Note:
5. Because the OTFAD is configured, encrypted data form the QSPI can be read (because it is decrypted on the fly).
- Data that will be written to the QSPI needs to be encrypted by my application before the writing operation.
OTFAD is one-way, in other word, it can only read data from QSPI and can't write to QSPI.
Best regards,
Juying