30.5.4 OTP Emulation Mode
The OTPC features an Emulation mode. This Emulation mode can be used to test all the operations allowed by the controller on a backed-up memory instead of the real OTP memory.
When Emulation mode is enabled, the controller has the same behavior. The Emulation mode is enabled only when the OTP memory has not been previously programmed.
To enable/disable Emulation mode on the User area, follow the steps below:
- Set OTPC_MR.EMUL to ‘1’ (to enable) or to ‘0’ (to disable).
- Refresh the User area by writing a ‘1’ to OTPC_CR.REFRESH and 0x7167 in OTPC_CR.KEY.
- Wait for the refresh completion by polling OTPC_ISR.EORF.
The current running mode of the User area can be observed by reading OTPC_SR.EMUL. If EMUL is set to ‘1’, Emulation mode is enabled; if it is set to ‘0’, Emulation mode is disabled.
After a reset, Emulation mode is disabled.