36.5.3.7.3 Writing a Packet from the Client Key Bus
To write a packet from the client key bus interface (payload only), follow the steps below:
- Write OTPC_MR.ADDR to ‘0’ and set
NPCKT.
Depending on the content of the temporary registers, an automatic flush can be triggered. If an automatic flush is started, OTPC_SR.FLUSH is set and OTPC_ISR.EOF is raised at the completion of the flush. It is mandatory to wait for the end of the flush.
- Write the header value in the OTPC_HR register. The value of PACKET must be KEY.
- Initiate a data transfer to the OTP memory through the TRNG host key bus.
- Wait for the data transfer completion.
- Check that no error happened during the key transfer (OTPC_ISR.KBERR must be cleared).
- Write 0x7167 in the OTPC_CR.KEY field and ‘1’ to OTPC_CR.PGM.
- Before the write operation in the OTP memory, the OTPC checks the consistency of the packet and that the packet does not overlap on any existing packet. In case of error, OTPC_ISR.WERR is set and the write operation is cancelled. The end of the programming operation is indicated by OTPC_ISR.EOP=1 and/or OTPC_SR.PGM=0.
If the PACKET field is changed before programming, the payload is erased (and lost).