12.1.4.5 NVM Boot Sequence

For each memory listed in the default boot sequence or enabled in the Boot Configuration Packet, the ROM code performs the flash initialization and valid code detection as described below.

Figure 12-3. NVM Bootloader Program
Figure 12-4. NVM Boot Diagram

The NVM bootloader program first initializes the PIOs related to the NVM device. Then it configures the right peripheral depending on the NVM and tries to access this memory. If the initialization fails, it restores the reset values for the PIO and the peripheral, and then tries to perform the same operations on the next NVM of the sequence.

If the initialization is successful, the NVM bootloader program reads the beginning of the NVM and determines if the NVM contains a valid code.

If the NVM does not contain a valid code, the NVM bootloader program restores the reset value for the peripherals and then tries to perform the same operations on the next NVM of the sequence.

If a valid code is found, this code is loaded from the NVM into the internal SRAM0 and executed by branching at address 0x0000_0000 after remap. This code may be the application code or a second-level bootloader. The code size must be lower than 32 KB.

Figure 12-5. Remap Action after Download Completion