![](http://datasheet.mmic.net.cn/20000/MQ80C52CXXX-36SBR_datasheet_1389801/MQ80C52CXXX-36SBR_61.png)
61
6437E–ATARM–23-Apr-13
SAM9M11
Figure 11-3. Remap Action after Download Completion
The NVM bootloader program initializes the NVM. It initializes the required PIO. It sets the right
peripheral depending on the NVM and tries to access the memory. If the initialization fails, it
restores the reset values for the PIO and peripherals and then the next NVM bootloader program
is executed.
If the initialization is successful, the NVM bootloader program reads the beginning of the NVM
and determines if the NVM contains valid code.
If the NVM does not contain valid code, the NVM bootloader program restores the reset value for
the peripherals and then the next NVM bootloader program is executed.
If valid code is found, this code is loaded from NVM into internal SRAM and executed by branch-
ing at address 0x0000_0000 after remap. This code may be the application code or a second-
level bootloader. All the calls to functions are PC relative and do not use absolute addresses.
11.4.2
Valid Code Detection
There are two kinds of valid code detection. Depending on the NVM bootloader, either one or
both of them is used.
11.4.2.1
ARM Exception Vectors Check
The NVM bootloader program reads and analyzes the first 28 bytes corresponding to the first
seven ARM exception vectors. Except for the sixth vector, these bytes must implement the ARM
instructions for either branch or load PC with PC relative addressing.
Figure 11-4. LDR Opcode
REMAP
Internal
ROM
Internal
SRAM
0x0030_0000
0x0000_0000
Internal
ROM
0x0040_0000
Internal
SRAM
Internal
SRAM
0x0030_0000
0x0000_0000
Internal
ROM
0x0040_0000
31
28 27
24 23
20 19
16 15
12 11
0
111001
I
P
U
1
W
0
Rn
Rd
O set