29
- AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

- AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

Embed Size (px)

Citation preview

Page 1: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

- AT91SAM Training

SAM9 Boot Strategies

Frederic BOYER

AT91 Support Group.Version 1.0 October 2006

AT91 Support Group.Version 2.0.2 June 2007

Page 2: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

2

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9 BootROM Memory

SAM9 devices feature on-chip BootROM memory

BootROM memory can contain up to 4 applications:

SAM-BA Boot

- Provides In-System Programming Solutions through serial or USB communication channels

DataFlash-Boot

NandFlash-Boot

SDCard-Boot

Page 3: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

- AT91SAM Training

SAM9261

Page 4: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

4

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9261 Internal Memory Mapping (for Master 0 & 1*)

ROM mapped by default

RAM

Undefined Area(No abort)

ROM

ROM

0x0000_0000

0x0010_0000

0x0020_0000

0x0030_0000

0x0040_0000

0x0050_0000

RAM

EBI NCS0

ROM

0x0000_0000

0x0010_0000

0x0020_0000

0x0030_0000

0x0040_0000

0x0050_0000

* Master 0 ARM926 Instruction & Master 1 ARM926 Data

16-bit non-volatile Memory

BMS=1 BMS=0

Undefined Area(No abort)

Undefined Area(No abort)

Undefined Area(No abort)

Page 5: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

5

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9261 Embedded ROM

SAM-BA Boot

Power Up

BMS = 1

Boot From External Memory on EBI Chip Select 0

User Application

Yes No

DataFlash-Booton

SPI0 Chip Select 0

Valid Code ?(SPI0 NPCS0)

Yes

No

Downloads and runs code from Dataflash into SRAM

Boot From ROM Boot From External Flash

Page 6: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

- AT91SAM Training

SAM9260

Page 7: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

7

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9260 Internal Memory Mapping (for Master 0 & 1*)

ROM mapped by default

SRAM1 4KB

ROM

ROM

SRAM0 4KB

0x0000_0000

0x0010_0000

0x0020_0000

0x0030_0000

0x0040_0000

SRAM1 4KB

ROM

EBI NCS0

SRAM0 4KB

0x0000_0000

0x0010_0000

0x0020_0000

0x0030_0000

0x0040_0000

16-bit non-volatile Memory

BMS = 1BMS = 0

* Master 0 ARM926 Instruction & Master 1 ARM926 Data

Page 8: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

8

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9260 Embedded ROM

SAM-BA Boot

Power Up

BMS = 1

Boot From External Memory

on EBI Chip Select 0

User Application

Yes NoBoot From ROM

NandFlash-Booton

EBI Chip Select 3

DataFlash-Booton

SPI0 Chip Select 0

DataFlash-Booton

SPI0 Chip Select 1

Optional

Boot From External Flash

Page 9: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

9

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9260 Embedded ROM (cont.)

Yes

NoDownloads and runs

code into SRAM

Yes

No

No

Yes

Yes

Valid Code ?(SPI0 NPCS0)

Valid Code ?(SPI0 NPCS1)

Valid FAT12/16 ?(EBI NCS3)

Valid Code ?(EBI NCS3)

No

Boot From ROM

SAM-BA Boot

DataFlash-Boot

NandFlash-Boot

SAM-BA Boot

Page 10: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

- AT91SAM Training

SAM9263

Page 11: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

11

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9263 Internal Memory Mapping (for Master 7 & 8*)

ROM mapped by default

80kB SRAM

Undefined Area(No abort)

ROM

ROM

0x0000_0000

0x0010_0000

0x0020_0000

0x0030_0000

0x0040_0000

0x0050_0000

80kB SRAM

EBI NCS0

ROM

0x0000_0000

0x0010_0000

0x0020_0000

0x0030_0000

0x0040_0000

0x0050_0000

* Master 8 ARM926 Instruction & Master 7 ARM926 Data

16-bit non-volatile Memory

BMS=1 BMS=0

Undefined Area(No abort)

Undefined Area(No abort)

Undefined Area(No abort)

0x0060_000016kB SRAM

0x0060_000016kB SRAM

Page 12: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

12

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9263 Embedded ROM

SAM-BA Boot

Power Up

BMS = 1

Boot From External Memory

on EBI0 Chip Select 0

User Application

Yes NoBoot From ROM

NandFlash-Booton

EBI0 Chip Select 3

SD Card Booton

MCI1

DataFlash-Booton

SPI0 Chip Select 0 Optional

Boot From External Flash

Not Supported on SAM9263 rev A

Not Supported on SAM9263 rev A

Page 13: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

- AT91SAM Training

SAM-BA BootDataFlash-BootNandFlash-BootSDCard-Boot

Page 14: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

14

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM9 SAM-BA Boot

1. Device Initialization

2. Check if USB Device enumeration (End of Bus Reset) has occured

3. Check for a received character on the DBGUorCheck if the AutoBaudrate sequence has succeeded

4. Step 2. and 3. until one occurs

5. Once the communication interface is identified, the application runs in an infinite loop waiting for different commands

AT91SAM Dependant

Page 15: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

15

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)

AT91SAM9261 & AT91SAM9263:

No AutoBaudrate

See. SAM9261 & SAM9263 SAM-BA Boot Requirements

Page 16: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

16

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)

SAM9261 SAM-BA Boot Requirements:

Supported Quartz (MHz)(Main Oscillator Enabled)

Supported Ext. Clocks (MHz)(Main Oscillator Bypassed)

None

USB Device (UDP) Pull-up Management

Handled by SAM-BA Boot

No PIO drivenInternal UDP Pull-up Enabled

DBGU & USB

Page 17: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

17

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)

SAM9263 SAM-BA Boot Requirements:

Supported Quartz (MHz)(Main Oscillator Enabled)

Supported Ext. Clocks (MHz)(Main Oscillator Bypassed)

1 to 50MHz

USB Device (UDP) Pull-up Management

Handled by SAM-BA Boot

No PIO drivenInternal UDP Pull-up Enabled

DBGU & USB

Page 18: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

18

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)AT91SAM9260: See. SAM9260 SAM-BA Boot RequirementsOn-chip RC (OSCSEL=0):

32768 Hz Oscillator (OSCSEL=1):

No AutoBaudrate

AutoBaudrate Detection

Page 19: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

19

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)SAM-BA Boot AutoBaudrate Sequence:

SAM9260 with On-chip RC Only

Page 20: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

20

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)

On-chip RC (OSCSEL=0)

Main Oscillator Enabled (MOSCEN=1)

SAM9260 SAM-BA Boot Requirements:Any other crystal (3-20MHz) can be used, but it prevents using USB

On-chip RC (OSCSEL=0)

Main Oscillator Bypassed (OSCBYPASS=1)

Any other input frequency (1-50MHz)

can be used, but it prevents using USB

DBGU & USB

Page 21: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

21

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)

32768 Hz Oscillator (OSCSEL=1) / Main Oscillator Enabled (MOSCEN=1)

32768 Hz Oscillator (OSCSEL=1) / Main Oscillator Bypassed (OSCBYPASS=1)

SAM9260 SAM-BA Boot Requirements:DBGU & USB

Page 22: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

22

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SAM-BA Boot (cont.)

SAM9260 SAM-BA Boot USB Requirements:

USB Device (UDP) Pull-up Management

Handled by SAM-BA Boot

No PIO drivenInternal UDP Pull-up Enabled

Page 23: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

23

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

DataFlash-Boot

Device Initialization

Search for valid code:• First 8th arm vectors must be valid

• Decode the 6th vector (used to store code size)

If valid code found:• Download code into the internal SRAM

• Reset peripherals

• Perform a remap

• Set PC at address 0x0000_0000

Page 24: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

24

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

DataFlash-Boot Requirements

µC SAM9260 SAM9261 SAM9263

MOSI SPI0_PIOA1 SPI0_PIOA1 SPI0_PIOA1

MISO SPI0_PIOA0 SPI0_PIOA0 SPI0_PIOA0

SPCK SPI0_PIOA2 SPI0_PIOA2 SPI0_PIOA2

NPCS0 SPI0_PIOA3 SPI0_PIOA3 SPI0_PIOA5

NPCS1 SPI0_PIOC11 - -

Maximum Downloadable Code Size 4 kB 156kB 72kB

Page 25: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

25

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

NandFlash-Boot

Device Initialization

Search for Boot.bin file in the root directory or in the FIRMWARE directory of a FAT12/16 formatted NandFlash

If valid file found:• Download code into the internal SRAM

• Reset peripherals

• Perform a remap and set PC at address 0x0000_0000

If no FAT12/16 file system, search for valid code:• First 8th arm vectors must be valid

• Decode the 6th vector (used to store code size)

If valid code found:• Download code into the internal SRAM

• Reset peripherals

• Perform a remap and set PC at address 0x0000_0000

8-bit & 16-bit NandFlash Support

Small & Large Blocks Support

Not Supported on SAM9263 rev A

Page 26: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

26

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

NandFlash-Boot Requirements

µC SAM9260 SAM9263

NandFlash Ready/Busy PIOC13 PA22

NandFlash Chip Enable (NANDCS) PIOC14 PD15

Address Bus (NAND CLE) A22 A22

Address Bus (NAND ALE) A21 A21

Maximum Downloadable Code Size

(Minimum Nandflash First Block Size)4 kB 72kB

Not Supported on SAM9263 rev A

Page 27: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

27

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

NandFlash-Boot Requirements (cont.)

NandFlash first block must be guaranteed to be valid without ECC

(generally up to 1,000 Program/Erase cycles)

Supported NandFlash Manufacturers:

Not Supported on SAM9263 rev A

Page 28: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

28

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SD Card Boot

Device Initialization

Search for Boot.bin file in the root directory or in the FIRMWARE directory of a FAT12/16 formatted SD Card

If valid file found:• Download code into the internal SRAM

• Reset peripherals

• Perform a remap and set PC at address 0x0000_0000

If no FAT12/16 file system, search for valid code:• First 8th arm vectors must be valid

• Decode the 6th vector (used to store code size)

If valid code found:• Download code into the internal SRAM

• Reset peripherals

• Perform a remap and set PC at address 0x0000_0000

Not Supported on SAM9263 rev A

Page 29: - AT91SAM Training SAM9 Boot Strategies Frederic BOYER AT91 Support Group. Version 1.0 October 2006 AT91 Support Group. Version 2.0.2 June 2007

29

- AT91SAM Training

ARM-Based Products GroupARM-Based Products Group

SD Card-Boot Requirements

µC SAM9263

MCCK PA6

MCCDA PA7

MCDA0 PA8

MCDA1 PA9

MCDA2 PA10

MCDA3 PA11

Maximum Downloadable Code Size

(Minimum Nandflash First Block Size)72kB

Not Supported on SAM9263 rev A