Datasheet

79
SAM9261 [DATASHEET]
Atmel-6062O-ATARM-SAM9261-Datasheet_21-Jun-16
12.4 Valid Image Detection
The boot software looks for a valid application by analyzing the first 28 bytes corresponding to the ARM exception
vectors. These bytes must implement ARM instructions for either branch or load PC with PC relative addressing.
The sixth vector, at offset 0x14, contains the size of the image to download. The user must replace this vector with
his own vector (see Section 12.4.2 “Structure of ARM Vector 6”).
12.4.1 Valid ARM Exception Vectors
Figure 12-3. LDR Opcode
Figure 12-4. B Opcode
Unconditional instruction: 0xE for bits 31 to 28
Load PC with PC relative addressing instruction:
Rn = Rd = PC = 0xF
I==0
P==1
U offset added (U==1) or subtracted (U==0)
W==1
12.4.2 Structure of ARM Vector 6
The ARM exception vector 6 is used to store information needed by the boot program. This information is
described below.
Figure 12-5. Structure of the ARM Vector 6
12.4.2.1 Example
An example of valid vectors follows:
Address Value Code
00 ea000006 B 0x20
04 eafffffe B 0x04
08 ea00002f B _main
0c eafffffe B 0x0c
10 eafffffe B 0x10
14 00001000
Code size = 4096 bytes (less than or equal to 156 Kbytes)
18 eafffffe B 0x18
The size of the image to load into SRAM is contained in the location of the sixth ARM vector. Thus the user must
replace this vector by the correct size of his application.
31 28 27 24 23 20 19 16 15 12 11 0
111001IPU0W1 Rn Rd
31 28 27 24 23 0
11101010 Offset (24 bits)
31 0
Size of the code to download in bytes