2.9.3 Booting with OTP Emulation Mode

The OTP Emulation mode can be used to test boot configuration options, including the Secure Boot mode (see Secure Boot Strategy), without programming permanently the real OTP memory.

Out of the factory, no Boot Configuration Packet is written in the OTP memory. During the prototyping phase, the Boot Configuration packet and the Secure Boot Configuration packet can be written in a backed-up SRAM instead of the real OTP memory. This is done via the OTP Emulation mode of the OTPC. For more information, refer to OTP Emulation Mode in the section OTP Memory Controller (OTPC).

To instruct the ROM code to configure the OTPC in Emulation mode at start-up, use the BSC_CR register: when BSC_CR.EMUL_EN is set, the ROM code sets OTPC_MR.EMUL and then launches a refresh of the User Area. In such a configuration, the ROM code gets the required boot-related packets (Boot Configuration Packet, Secure Boot Configuration Packet, Customer Key Packet, etc.) from the emulation SRAM and not from the real OTP. To return to a standard operating mode, clear BSC_CR.EMUL_EN. Then, the ROM code will no longer enable OTPC Emulation mode at start-up and will get the required packets from the real OTP.

Note: Since the OTP emulation SRAM is backed up, if the VDDBU power is supplied, all the packets in the emulated User Area are kept when the device in not powered on.
Warning: Once a real packet is written in the real OTP User Area, the OTP Emulation mode cannot be used anymore. Even if BSC_CR.EMUL_EN is set, the ROM code cannot set the OTPC Emulation mode at start-up because that is prevented by the OTPC. In such case, the ROM code gets the packets required for the boot sequence from the real OTP memory.
Warning: It is highly recommended to use the OTP Emulation mode only for testing and prototyping purpose, and not for production. In Production mode, the data should be stored and secured in the real OTP memory.
Figure 2-28. Boot Configuration Loading