Datasheet

SAM3X / SAM3A [DATASHEET]
Atmel-11057C-ATARM-SAM3X-SAM3A-Datasheet_23-Mar-15
318
20. SAM3X/A Boot Program
20.1 Description
The SAM-BA Boot Program integrates an array of programs permitting download and/or upload into the different
memories of the product.
20.2 Flow Diagram
The Boot Program implements the algorithm illustrated in Figure 20-1.
Figure 20-1. Boot Program Algorithm Flow Diagram
The SAM-BA Boot program seeks to detect a source clock either from the embedded main oscillator with external
crystal (main oscillator enabled) or from a 12 MHz signal applied to the XIN pin (Main oscillator in Bypass mode).
If a clock is found from the two possible sources above, the boot program checks to verify that the frequency is 12
MHz (taking into account the frequency range of the 32 kHz RC oscillator). If the frequency is 12 MHz, USB
activation is allowed, else (no clock or frequency other than 12 MHz), the internal 12 MHz RC oscillator is used as
main clock and USB clock is not allowed due to frequency drift of the 12 MHz RC oscillator.
20.3 Device Initialization
The initialization sequence is the following:
1. Stack setup
2. Set up the Embedded Flash Controller
3. External Clock detection (quartz or external clock on XIN)
4. If quartz or external clock is 12.000 MHz, allow USB activation
5. Else, does not allow USB activation and use internal RC 12 MHz
6. Main oscillator frequency detection if no external clock detected
7. Switch Master Clock on Main Oscillator
8. C variable initialization
9. PLLA setup: PLLA is initialized to generate a 48 MHz clock
10. UPLL setup in case of USB activation allowed
11. Disable of the Watchdog
12. Initialization of the UART (115200 bauds, 8, N, 1)
13. Initialization of the USB Device Port (in case of USB activation allowed)
14. Wait for one of the following events
a.Check if USB device enumeration has occurred
b.Check if characters have been received in the UART
15. Jump to SAM-BA Monitor (see Section 20.4 ”SAM-BA Monitor”)
Device
Setup
Character # received
from UART?
Run SAM-BA Monitor
USB Enumeration
Successful ?
Ye s
Run SAM-BA Monitor
Ye s
No
No