Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
AT91SAM Boot Strategies Application Deployment Frederic BOYER Support & Training Group Engineer AT91 Training Coordinator ...
Outline <ul><li>Introduction </li></ul><ul><li>Boot Solutions </li></ul><ul><li>Application Deployment </li></ul><ul><li>N...
1. Introduction
NAND vs. NOR Flash Advantage of NAND High Speed Program/Erase Low Cost-per-bit High Capacity Disadvantage of NAND Slow Ran...
NOR vs. NAND Boot Considerations <ul><li>NOR Flash </li></ul><ul><ul><li>Used as an  eXecute In Place (XIP) memory : no ne...
AT91SAM Boot Strategies Introduction GPNVM bit ( Embedded   Flash  based µC) BMS pin ( Flashless  µC) OR Boot Memory Selec...
AT91SAM Boot Strategies Introduction (cont.) <ul><li>Regarding  GPNVM bit  or  BMS pin  state, the µC will either: </li></...
Boot Memory Selection for Flash  based µC (SAM7 and SAM9XE) <ul><li>GPNVM bit is sampled when VDDCORE is powered. </li></u...
Boot Memory Selection for Flashless  µC (SAM926x, SAM9R(L), SAM9G20) <ul><li>BMS pin is sampled when VDDCORE is powered. <...
2. Boot Solutions
Booting From an eXecute In Place Memory <ul><li>XIP Memories used for booting purpose are: </li></ul><ul><ul><li>Embedded ...
NVM Memory Bootloader SAM-BA Boot FFPI IAP Function 2 nd  Level Bootloader ISP Gang  Programmer Interface IAP 2. Boot Solu...
BootROM Applications 2. Boot Solutions X X X - SAM9XE - X X - SAM7SE - X X - SAM7X/XC - X X - SAM7S X X X - SAM7L SAM-BA B...
NVM Memory Bootloader Application <ul><li>Contrary to XIP memories, it is not possible to boot directly from a DataFlash, ...
Supported NVM Memories <ul><li>Serial DataFlash: ATMEL  AT45D  and  AT45DCB </li></ul><ul><li>Serial Flash: Industry’s mos...
What is a valid code? <ul><li>SD Card Example : </li></ul><ul><li>boot.bin file in the root directory of any  FAT12/16/32 ...
<ul><li>DataFlash, NAND Flash, Serial Flash & EEPROM example: </li></ul><ul><li>The ARM exception vectors must have valid ...
NVM Memory Bootloader Support <ul><li>H/W (driven pins, clocks) & S/W (max downloadable code size) constraints can be foun...
No Valid Code Found <ul><ul><li>As soon as valid code is found in a bootable memory, </li></ul></ul><ul><li>the boot ROM s...
AT91SAM9R(L)64  Boot ROM Sequence NandFlash-Boot on EBI Chip Select 3 SD Card Boot on MCI DataFlash-Boot on SPI Chip Selec...
SAM-BA Boot  Application <ul><li>SAM-BA Boot is a little monitor that provides In-System Programming Solutions through dif...
AT91SAM7 L & AT91SAM9XE   IAP Function <ul><li>IAP: In Application Programming </li></ul><ul><ul><li>IAP feature is a func...
FFPI – Fast Flash Programming Interface Application <ul><li>Provides programming solutions for high volume programming, wi...
3. AT91SAM  Application Deployment
Standard Application Deployment 1st Level Bootloader (NVM Memory Bootloader) 2nd Level Bootloader (Optional) 3rd Level Boo...
<ul><li>Free  2 nd  Level Bootloader for AT91SAM9 </li></ul><ul><li>AT91Bootstrap integrates several sets of algorithms: <...
Getting Started NVM Boot AT91Bootstrap 0x0000 0x8400 D ATA  F LASH AT91Bootstrap SRAM DataFlash Boot SAMBA Boot ROM SDRAM ...
NVM Boot NAND FLASH Boot Example SRAM NandFlash-Boot SAMBA Boot ROM SDRAM NandFlash-Boot 0x300000 0x20000000 Current runni...
AT91SAM  NVM Programming Solutions
<ul><li>Development Tools such as IAR, Keil integrate their own flash loaders utility to flash the application during debu...
SAM-BA GUI (AT91 ISP) <ul><li>Customizing SAM-BA is possible by adding or modifying TCL scripts files </li></ul><ul><li>Co...
Appendix AT91SAM  Boot Program Algorithm Flow Diagrams
AT91SAM7X/XC/SE Boot Sequence No Yes PA0=PA1=1 PA2 = 0 Yes Power Up No Yes FFPI Boot From Flash User Application Boot From...
AT91SAM7S Boot Sequence No TST = 1 Yes PA0=PA1=1 Power Up PA2 = 1 Yes No Power Up with TST=0 Yes Boot From Flash User Appl...
SAM-BA Boot Recovery  Application ( SAM7S only) <ul><li>AT91SAM7S ROM is not mapped by default </li></ul><ul><li>SAM-BA Bo...
AT91SAM7L Boot Sequence No Yes PC0=PC1=1 Yes Power Up No Yes FFPI Boot From Flash User Application Boot From ROM SAM-BA Bo...
AT91SAM9XE Boot Sequence No Yes Yes Power Up No Yes FFPI Boot From Flash User Application Boot From ROM SAM-BA Boot Securi...
AT91SAM9260 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM DataFlash-Boot on SPI0 Chip Select 1 DataFlash-Boot on SPI...
AT91SAM9261(S) Boot Sequence Power Up BMS = 1 Yes No Boot From ROM DataFlash-Boot on SPI0 Chip Select 0 SerialFlash-Boot o...
AT91SAM9263 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM Boot From  External Memory on EBI0 Chip Select 0 User Appl...
AT91SAM9R(L)64  Boot Sequence Power Up BMS = 1 Yes No Boot From ROM EBI Chip Select 0 User Application NandFlash-Boot on E...
AT91SAM9G20 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM NandFlash-Boot on EBI Chip Select 3 SAM-BA Boot Boot From ...
Upcoming SlideShare
Loading in …5
×

SAM9_Boot_Strategies.ppt

3,689 views

Published on

  • Be the first to comment

SAM9_Boot_Strategies.ppt

  1. 1. AT91SAM Boot Strategies Application Deployment Frederic BOYER Support & Training Group Engineer AT91 Training Coordinator ARM MCU & MPU
  2. 2. Outline <ul><li>Introduction </li></ul><ul><li>Boot Solutions </li></ul><ul><li>Application Deployment </li></ul><ul><li>NVM Programming Solutions </li></ul>
  3. 3. 1. Introduction
  4. 4. NAND vs. NOR Flash Advantage of NAND High Speed Program/Erase Low Cost-per-bit High Capacity Disadvantage of NAND Slow Random Access Time Difficulty of Byte Programming Advantage of NOR High Speed Random Access Byte Programming Code execution Disadvantage of NOR Slow Program Speed Slow Erase Speed Applications Suitable for Data Memory Program/Data Mass Storage Applications Suitable for Code Memory eXecute In Place (XIP) 1. Introduction
  5. 5. NOR vs. NAND Boot Considerations <ul><li>NOR Flash </li></ul><ul><ul><li>Used as an eXecute In Place (XIP) memory : no need to copy the program into RAM </li></ul></ul><ul><ul><li>Used to replace ROM </li></ul></ul><ul><li>NAND Flash </li></ul><ul><ul><li>Programs stored cannot be executed directly </li></ul></ul><ul><ul><li>Code Shadowing must be performed: memory contents must be first copied into memory-mapped RAM and executed there </li></ul></ul><ul><ul><li>Used to replace Hard Disk Drive </li></ul></ul>1. Introduction
  6. 6. AT91SAM Boot Strategies Introduction GPNVM bit ( Embedded Flash based µC) BMS pin ( Flashless µC) OR Boot Memory Selection Power Up <ul><li>To ensure maximum boot possibilities, memory layout can be changed with different parameters. </li></ul><ul><li>On our AT91SAM, either GPNVM bit or BMS pin is responsible for the boot memory selection: </li></ul><ul><ul><li>GPNVM bit for embedded flash µC: SAM7, SAM9XE. </li></ul></ul><ul><ul><li>BMS pin for the others: SAM926x, SAM9G20, SAM9R(L)… </li></ul></ul>1. Introduction
  7. 7. AT91SAM Boot Strategies Introduction (cont.) <ul><li>Regarding GPNVM bit or BMS pin state, the µC will either: </li></ul><ul><ul><li>Boot from ROM </li></ul></ul><ul><ul><li>Or Boot from the XIP memory (internal or external Flash) </li></ul></ul>Boot From (Int. or Ext.) Flash Boot From ROM OR Boot Memory Selection 1. Introduction
  8. 8. Boot Memory Selection for Flash based µC (SAM7 and SAM9XE) <ul><li>GPNVM bit is sampled when VDDCORE is powered. </li></ul><ul><li>GPNVM can be: </li></ul><ul><ul><li>Set thanks to the EFC Controller </li></ul></ul><ul><ul><li>Cleared thanks to the EFC Controller or by asserting the ERASE pin. </li></ul></ul>Boot From Embedded Flash Boot From ROM No Yes Power Up 1. Introduction GPNVM bit = 1
  9. 9. Boot Memory Selection for Flashless µC (SAM926x, SAM9R(L), SAM9G20) <ul><li>BMS pin is sampled when VDDCORE is powered. </li></ul>Boot From External 16-bit Flash Boot From ROM Yes No Power Up 1. Introduction BMS pin = 1
  10. 10. 2. Boot Solutions
  11. 11. Booting From an eXecute In Place Memory <ul><li>XIP Memories used for booting purpose are: </li></ul><ul><ul><li>Embedded Flash (SAM7, SAM9XE) </li></ul></ul><ul><ul><li>External 16-bit Flash (SAM926x, SAM9R(L), SAM9G20…) </li></ul></ul><ul><li>No boot program is executed, no initialization performed </li></ul><ul><li>Whole microcontroller configuration must be made in the application, such as: </li></ul><ul><ul><li>Clocks configuration: Main Oscillator, PLL </li></ul></ul><ul><ul><li>Embedded Flash Controller configuration (Wait States…) </li></ul></ul><ul><ul><li>External Bus Interface configuration (Setup, Hold…) </li></ul></ul>2. Boot Solutions
  12. 12. NVM Memory Bootloader SAM-BA Boot FFPI IAP Function 2 nd Level Bootloader ISP Gang Programmer Interface IAP 2. Boot Solutions Booting from ROM AT91SAM Boot ROM supports numerous applications AT91SAM BootROM
  13. 13. BootROM Applications 2. Boot Solutions X X X - SAM9XE - X X - SAM7SE - X X - SAM7X/XC - X X - SAM7S X X X - SAM7L SAM-BA Boot NVM Bootloader IAP Function FFPI Flash AT91 µC - - X X SAM9G10 - - X X SAM9G20 FlashLess AT91 µC - - X X SAM9R(L)64 - - X X SAM9263 - - X X SAM9G45 X X - - X SAM9261(S) X - - SAM9260
  14. 14. NVM Memory Bootloader Application <ul><li>Contrary to XIP memories, it is not possible to boot directly from a DataFlash, serial Flash, NAND Flash, SDCard or EEPROM </li></ul><ul><li>NVM Memory content must be first copied into memory-mapped RAM and executed there </li></ul><ul><li>NMV Memory Bootloader called “NVM -Boot ” is responsible for this copy </li></ul>Valid Code ? Yes No NVM-Boot Next NVM-Boot Copy code from NVM memory into SRAM Reset Peripherals, remap and execute code out of SRAM No need for external NOR Flash memory ! 1st Level Bootloader 2. Boot Solutions
  15. 15. Supported NVM Memories <ul><li>Serial DataFlash: ATMEL AT45D and AT45DCB </li></ul><ul><li>Serial Flash: Industry’s most advanced 25xxx compatible serial Flash (ATMEL AT25/26, SST, ST, Winbond…) </li></ul><ul><li>SLC NandFlash: 8- and 16-bit, small and large blocks </li></ul><ul><li>SDCard: any FAT12/16/32 formatted SD Cards which are not High Capacity SDHC </li></ul><ul><li>EEPROM: any I²C Memory EEPROM </li></ul>One NVM memory for a whole application !!! 2. Boot Solutions
  16. 16. What is a valid code? <ul><li>SD Card Example : </li></ul><ul><li>boot.bin file in the root directory of any FAT12/16/32 formatted SD Cards </li></ul><ul><li>Code size < AT91SAM internal SRAM size* </li></ul>2. Boot Solutions * Max code size value must be checked in the Boot Program section of each product datasheet
  17. 17. <ul><li>DataFlash, NAND Flash, Serial Flash & EEPROM example: </li></ul><ul><li>The ARM exception vectors must have valid ARM instructions (B or LDR), excluding the 6 th vector </li></ul><ul><li>The 6 th vector ( reserved vector @ 0x14), must correspond to the size of the image to be copied in internal SRAM . </li></ul><ul><li>Code size < AT91SAM internal SRAM size* </li></ul>What is a valid code (cont’d)? Vector 1 Vector 2 Vector 3 Vector 4 Vector 5 Vector 6 Vector 7 Vector 8 ‘ e59’  LDR opcode 00 e59 ff074 04 e59 ff014 08 e59 ff014 0c e59 ff014 10 e59 ff014 14 00000800 18 e59 ff060 1C e59 ff00C ARM exception vectors 2. Boot Solutions * Max code size value must be checked in the Boot Program section of each product datasheet Reset Undefined Instruction Software Interrupt Prefect Abort Data abort Reserved: SIZE OF THE IMAGE Normal interrupt Fast interrupt
  18. 18. NVM Memory Bootloader Support <ul><li>H/W (driven pins, clocks) & S/W (max downloadable code size) constraints can be found in the Boot Program section of the product. </li></ul>2. Boot Solutions X X X X X X X X X X SAM9G20 rev A SAM9G20 rev B - X X - X SAM9R(L)64 rev A - X - X - X - X X X SAM9261(S) rev A SAM9261 rev B X X X X X SAM9G10 rev A X X X X X SAM9G45 rev A - - - - Serial Flash (SPI) - - - X - X X X SAM9263 rev A SAM9263 rev B - - EEPROM (TWI) X X DataFlash (SPI) - - - X SAM9260 rev A SAM9260 rev B Standard SDCard (MCI) SLC NandFlash (EBI) AT91 NVM
  19. 19. No Valid Code Found <ul><ul><li>As soon as valid code is found in a bootable memory, </li></ul></ul><ul><li>the boot ROM sequence is completed. </li></ul>If no valid code is found, what is the next step? 2. Boot Solutions
  20. 20. AT91SAM9R(L)64 Boot ROM Sequence NandFlash-Boot on EBI Chip Select 3 SD Card Boot on MCI DataFlash-Boot on SPI Chip Select 0 SAM-BA Boot 2. Boot Solutions
  21. 21. SAM-BA Boot Application <ul><li>SAM-BA Boot is a little monitor that provides In-System Programming Solutions through different communication channels: </li></ul><ul><ul><li>DBGU Serial port interface </li></ul></ul><ul><ul><li>USB Device port </li></ul></ul><ul><li>Used to interface ISP Software such as SAM-BA GUI. </li></ul><ul><li>Check Boot Program section of the product datasheet for H/W and S/W constraints such as crystals/clocks support. </li></ul>Free AT91 ISP Programming Solutions 2. Boot Solutions
  22. 22. AT91SAM7 L & AT91SAM9XE IAP Function <ul><li>IAP: In Application Programming </li></ul><ul><ul><li>IAP feature is a function located in ROM, that can be called by any software application </li></ul></ul><ul><ul><li>When called, this function sends the desired FLASH command to the EFC and waits for the FLASH to be ready </li></ul></ul><ul><ul><li>Executed from ROM, allows FLASH programming by code running out of FLASH </li></ul></ul><ul><ul><li>This function takes one argument in parameter: the command to be sent to the EFC </li></ul></ul>Ease IAP Development 2. Boot Solutions
  23. 23. FFPI – Fast Flash Programming Interface Application <ul><li>Provides programming solutions for high volume programming, with two interface options </li></ul><ul><ul><li>Serial: JTAG interface </li></ul></ul><ul><ul><li>Parallel: 8-bit (AT91SAM7S16/32) or 16-bit (other AT91SAM) </li></ul></ul>Serial (JTAG) Parallel (8- or 16-bit) Security Bit Must Be Cleared TST=1 H/W Programming Solution For Gang Prog. 2. Boot Solutions
  24. 24. 3. AT91SAM Application Deployment
  25. 25. Standard Application Deployment 1st Level Bootloader (NVM Memory Bootloader) 2nd Level Bootloader (Optional) 3rd Level Bootloader Main Application AT91 Bootstrap U-boot E-boot Linux WinCE Standalone App FLASH Media(s) 3. Application Deployment
  26. 26. <ul><li>Free 2 nd Level Bootloader for AT91SAM9 </li></ul><ul><li>AT91Bootstrap integrates several sets of algorithms: </li></ul><ul><ul><li>Device initialization such as clock speed configuration, PIO settings, SDRAM initialization </li></ul></ul><ul><ul><li>Physical media algorithms such as DataFlash, NAND Flash, etc . </li></ul></ul><ul><li>Loaded thanks to NVM Memory Bootloader located in ROM </li></ul><ul><li>Current Version is 1.11 and is integrated in our software packages </li></ul>AT91 Bootstrap Free 3. Application Deployment In Dev IAR In Dev In Dev I 2 C EEPROM GNU Keil SD Card 25xxx Serial Flash AT45 DataFlash CFI NOR Flash NAND Flash NVM Memory Bootloader Support
  27. 27. Getting Started NVM Boot AT91Bootstrap 0x0000 0x8400 D ATA F LASH AT91Bootstrap SRAM DataFlash Boot SAMBA Boot ROM SDRAM AT91Bootstrap AT91Bootstrap 0x300000 Application 0x20000000 AT91Bootstrap Application Application Current running Application in Red D ATA FL ASH Boot Example 3. Application Deployment DataFlash Boot
  28. 28. NVM Boot NAND FLASH Boot Example SRAM NandFlash-Boot SAMBA Boot ROM SDRAM NandFlash-Boot 0x300000 0x20000000 Current running Application in Red U-Boot 0x0000 0x60000 0x20000 NAND FLASH Linux Kernel AT91Bootstrap AT91Bootstrap Linux Kernel U-Boot AT91Bootstrap U-Boot Linux Kernel 0x22200000 3. Application Deployment
  29. 29. AT91SAM NVM Programming Solutions
  30. 30. <ul><li>Development Tools such as IAR, Keil integrate their own flash loaders utility to flash the application during debug phase </li></ul><ul><li>SAM-BA GUI: Atmel’s Free programming solution for on-chip and on-board memories </li></ul><ul><ul><li>Serial port, USB and JTAG SAM-ICE support </li></ul></ul><ul><ul><li>Graphical or command line interface </li></ul></ul><ul><ul><li>Easy customization to create a custom board, add new memories, etc. </li></ul></ul><ul><li>AT91Boot_DLL.dll: Atmel’s Free solution for customers to create their own GUI Interfaces </li></ul><ul><li>Gang Programmers: support for all AT91SAM flash-based microcontrollers thanks to FFPI </li></ul>NVM Programming Solutions Free Free 4. NVM Programming Solutions
  31. 31. SAM-BA GUI (AT91 ISP) <ul><li>Customizing SAM-BA is possible by adding or modifying TCL scripts files </li></ul><ul><li>Command Line Mode: allows memory programming without any GUI interaction </li></ul>Create your own board Add memory modules Modify Memory Algorithms <ul><li>Enable the NAND Flash, then Use the Sendboot file script </li></ul>4. NVM Programming Solutions
  32. 32. Appendix AT91SAM Boot Program Algorithm Flow Diagrams
  33. 33. AT91SAM7X/XC/SE Boot Sequence No Yes PA0=PA1=1 PA2 = 0 Yes Power Up No Yes FFPI Boot From Flash User Application Boot From ROM SAM-BA Boot Security Bit Must Be Cleared TST = 1 GPNVM2 = 1
  34. 34. AT91SAM7S Boot Sequence No TST = 1 Yes PA0=PA1=1 Power Up PA2 = 1 Yes No Power Up with TST=0 Yes Boot From Flash User Application Boot From Flash SAM-BA Boot SAM-BA Boot Recovery ≈ 10 seconds FFPI Security Bit Must Be Cleared Boot From ROM
  35. 35. SAM-BA Boot Recovery Application ( SAM7S only) <ul><li>AT91SAM7S ROM is not mapped by default </li></ul><ul><li>SAM-BA Boot Recovery Application is responsible for copying SAM-BA Boot into Flash </li></ul><ul><li>10 seconds necessary for the copy </li></ul><ul><li>Needs a power up sequence to run SAM-BA Boot (TST=0) </li></ul>Unlock Sectors 0 & 1 Copy SAM-BA Boot from ROM to FLASH while(1); Security Bit Must Be Cleared TST=1 Power Up
  36. 36. AT91SAM7L Boot Sequence No Yes PC0=PC1=1 Yes Power Up No Yes FFPI Boot From Flash User Application Boot From ROM SAM-BA Boot Security Bit Must Be Cleared IAP Function TST = 1 GPNVM1 = 1
  37. 37. AT91SAM9XE Boot Sequence No Yes Yes Power Up No Yes FFPI Boot From Flash User Application Boot From ROM SAM-BA Boot Security Bit Must Be Cleared IAP Function PA0=PA1=1 PA2 = 0 TST = 1 GPNVM3 = 1
  38. 38. AT91SAM9260 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM DataFlash-Boot on SPI0 Chip Select 1 DataFlash-Boot on SPI0 Chip Select 0 NandFlash-Boot on EBI Chip Select 3 SAM-BA Boot Boot From External Memory on EBI Chip Select 0 User Application Boot From External 16-bit Flash Not Supported On revision A Optional
  39. 39. AT91SAM9261(S) Boot Sequence Power Up BMS = 1 Yes No Boot From ROM DataFlash-Boot on SPI0 Chip Select 0 SerialFlash-Boot on SPI0 Chip Select 0 NandFlash-Boot on EBI Chip Select 3 SAM-BA Boot Boot From External Memory on EBI Chip Select 0 User Application SDCard-Boot on MCI EEPROM-Boot on TWI Boot From External 16-bit Flash Not Supported On revision A Optional
  40. 40. AT91SAM9263 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM Boot From External Memory on EBI0 Chip Select 0 User Application NandFlash-Boot on EBI0 Chip Select 3 SD Card Boot on MCI1 DataFlash-Boot on SPI0 Chip Select 0 SAM-BA Boot Boot From External 16-bit Flash Not Supported On revision A Optional
  41. 41. AT91SAM9R(L)64 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM EBI Chip Select 0 User Application NandFlash-Boot on EBI Chip Select 3 SD Card Boot on MCI DataFlash-Boot on SPI Chip Select 0 SAM-BA Boot Boot From External 16-bit Flash Optional
  42. 42. AT91SAM9G20 Boot Sequence Power Up BMS = 1 Yes No Boot From ROM NandFlash-Boot on EBI Chip Select 3 SAM-BA Boot Boot From External Memory on EBI Chip Select 0 User Application SDCard-Boot on MCI EEPROM-Boot on TWI Boot From External 16-bit Flash SerialFlash-Boot then DataFlash-Boot on SPI0 Chip Select 0 SerialFlash-Boot then DataFlash-Boot on SPI0 Chip Select 1 Optional

×