AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · -...

25
AT91SAM9RL64 Hands-on 03: Deploy an application thanks to the AT91SAM9RL64 BootROM loaders and at91bootstrap Prerequisites Hands-On - AT91SAM9RL64 Hands-on 01: Getting Started with the AT91LIB - AT91SAM9RL64 Hands-on 02: Create a Multimedia based application with the AT91LIB Knowledge Requirements - Basic understanding of microcontrollers - Basic knowledge of the C language - Basic knowledge of Integrated Development Tools - Basic knowledge of the AT91LIB - Basic knowledge of the AT91SAM9RL64 Boot Solutions PC Platform - Windows ® 2000, Windows ® XP, Windows ® Vista Software Requirements - IAR EWARM 5.20 - SAM-ICE Drivers Hardware - AT91SAM9RL-EK - SAM-ICE (JTAG probe) - Null modem serial cable - SD Card and SD Card Reader Skill Level - Beginner to Advanced Estimated Completion Time - 30 minutes Introduction The purpose of this hands-on is to deploy the final customer application on the AT91SAM9RL-EK board with the help of the embedded BootRom loaders and a second level bootloader called at91bootstrap. All exercises are based on our AT91SAM9RL Evaluation Kit and the IAR tool- chain. 32-bit AT91SAM Microcontrollers Training AT91-0003

Transcript of AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · -...

Page 1: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91SAM9RL64 Hands-on 03: Deploy an application thanks to the

AT91SAM9RL64 BootROM loaders and at91bootstrap

Prerequisites • Hands-On

- AT91SAM9RL64 Hands-on 01: Getting Started with the A T91LIB - AT91SAM9RL64 Hands-on 02: Create a Multimedia based application with the

AT91LIB • Knowledge Requirements

- Basic understanding of microcontrollers - Basic knowledge of the C language - Basic knowledge of Integrated Development Tools - Basic knowledge of the AT91LIB - Basic knowledge of the AT91SAM9RL64 Boot Solutions

• PC Platform - Windows ® 2000, Windows ® XP, Windows ® Vista

• Software Requirements - IAR EWARM 5.20 - SAM-ICE Drivers

• Hardware - AT91SAM9RL-EK - SAM-ICE (JTAG probe) - Null modem serial cable - SD Card and SD Card Reader

• Skill Level - Beginner to Advanced

• Estimated Completion Time - 30 minutes

Introduction The purpose of this hands-on is to deploy the final customer application on the AT91SAM9RL-EK board with the help of the embedded BootRom loaders and a second level bootloader called at91bootstrap.

All exercises are based on our AT91SAM9RL Evaluation Kit and the IAR tool-chain.

32-bit AT91SAM

Microcontrollers

Training AT91-0003

Page 2: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

2 AT91 Hands-On

Training AT91-0003

Document Overview The hands-on is split into several different assignments. Each assignment is further divided into individual sections to simplify understanding.

Throughout this document you will find some special icons. These icons are used to identify different sections of assignments and ease complexity.

Information Delivers contextual information about a specific topic

Tip Highlights useful tips and techniques

To do Highlights objectives to be completed in italicized text

Result Highlights the expected result of an assignment step

Warning Indicates important information

Abbreviations • NVM: Non Volatile Memory

• BMS: Boot Mode Select

Page 3: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

3

Training AT91-0003

Table of Contents Prerequisites ...................................... ................................................. 1

Introduction ....................................... .................................................. 1

Document Overview .................................. ......................................... 2

Abbreviations...................................... ................................................ 2

Table of Contents.................................. .............................................. 3

1 Hardware Requirement............................. ....................................... 4

1.1 Evaluation Kit....................................................................................................... 4

1.2 Emulator .............................................................................................................. 4

2 Software Requirement............................. ........................................ 5

2.1 Development tools............................................................................................... 5

3 Hands-On Setup................................... ............................................ 6

3.1 Setup ................................................................................................................... 6 3.1.1 Evaluation Kit Setup .................................................................................................. 6 3.1.2 SAM-ICE Setup ......................................................................................................... 6 3.1.3 RS232 & HyperTerminal Setup ................................................................................. 6 3.1.4 Project Setup............................................................................................................. 6

4 Hands-On - Assignment 1 .......................... ..................................... 7

4.1 Objectives............................................................................................................ 7

4.2 Exercises ............................................................................................................. 7 4.2.1 A1 – Step 0................................................................................................................ 7 4.2.2 A1 – Step 1................................................................................................................ 9

4.3 Summary ........................................................................................................... 13

5 Hands-On - Assignment 2 .......................... ................................... 14

5.1 Objectives.......................................................................................................... 14

5.2 Exercises ........................................................................................................... 14 5.2.1 A2 – Step 1.............................................................................................................. 14 5.2.2 A2 – Step 2.............................................................................................................. 17

5.3 Summary ........................................................................................................... 20

6 Hands-On - Assignment 3 (Optional) ............... ............................ 21

6.1 Objectives.......................................................................................................... 21

6.2 Exercises ........................................................................................................... 21 6.2.1 A3 – Step 1.............................................................................................................. 21 6.2.2 A3 – Step 2.............................................................................................................. 22

6.3 Summary ........................................................................................................... 23

7 Hands-On Summary ................................. ..................................... 24

8 Resources........................................ ............................................... 25

9 Atmel Technical Support Resources ................ ........................... 25

Page 4: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

4 AT91 Hands-On

Training AT91-0003

1 Hardware Requirement

1.1 Evaluation Kit

• AT91SAM9RL-EK

The AT91SAM9RL-EK is the AT91SAM9RL product series evaluation kit.

1.2 Emulator

• SAM-ICE JTAG Probe

SAM-ICE is a JTAG emulator designed for all ATMEL AT91SAM ARM7/ARM9 cores. USB driver files to support the SAM-ICE are part of the SAM-ICE Software.

Page 5: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

5

Training AT91-0003

2 Software Requirement

2.1 Development tools

IAR EWARM 5.20

As stated in the Prerequisites section, the install ation of the IAR tool-chain must be done prior to the beginning of this hands-o n session. The license is free for the IAR EWARM 5.20 KickStart edition.

The IAR EWARM 5.20 KickStart edition can be downloaded to the http://www.iar.com/ website using the following link:

http://supp.iar.com/Download/SW/?item=EWARM-KS32

SAM-ICE Software SAM-ICE (J-Link) software includes:

• USB driver

• J-Mem

• jlink.exe and jlinkarm.dll

• J-Flash*

• J-Link RDI (includes flash downloader* and support unlimited number of flash breakpoints*)

• GDB server

* (license required) The SAM-ICE software can be downloaded to the http://www.segger.com website using the following link:

http://www.segger.com/download_jlink.html

Page 6: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

6 AT91 Hands-On

Training AT91-0003

3 Hands-On Setup

3.1 Setup

3.1.1 Evaluation Kit Setup

Check the following Jumpers connection: J11 Position 1-2 (3v3-BMS)

J12 Open

J13 Open

All other Jumpers must be closed

Power the board • Connect wall plugged power supply to the board

3.1.2 SAM-ICE Setup

Connect the SAM-ICE: • Connect the SAM-ICE to the AT91SAM9RL-EK ensuring the proper orientation of

the JTAG connector

• Connect the SAM-ICE to the PC (USB port)

3.1.3 RS232 & HyperTerminal Setup

Connect the RS232 cable to one RS232 computer Port. • Connect the RS232 cable to the DBGU connector

• Launch HyperTerminal application with the 115200 ba uds – 8 – N – 1 – no flow control) configuration

3.1.4 Project Setup

You will work on a project which is not integrated in the IAR tool-chain.

To do so, unzip the AT91SAM9RL64 Hands-On 03.zip (find it within the Hands-On\03\setup directory provided to you). In the following examp le, the project is specified to be stored under the loc ation: C:\AT91\

J12 & J13

J11

LED - DS1/2/3 BP1 & BP2

DBGU JTAG

Interface

Page 7: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

7

Training AT91-0003

4 Hands-On - Assignment 1

4.1 Objectives

The goal of this assignment is to discover the at91bootstrap application and how to use it to deploy an application.

In this Assignment you will:

• Using IAR and the at91bootstrap project:

� Understand which at91bootstrap parameters need to be correctly set to deploy the final application.

� Build the at91bootstrap for the final application.

4.2 Exercises

4.2.1 A1 – Step 0

You will now start the IAR EWARM and open a new workspace which is not integrated in the IAR tool-chain.

Launch IAR EWARM: • Select “Open existing workspace”

Page 8: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

8 AT91 Hands-On

Training AT91-0003

• Search for the workspace called hands-on-sam9rl-project.eww in the following path: C:\AT91\AT91SAM9RL64 Hands-On 03\at91sam9rl-ek

Then click on OPEN.

This workspace is based on a beta version of the AT91LIB and so is not integrated within the EWARM 5.20 current release .

Both at91bootstrap and the final application projects are now well configured.

at91bootstrap Project

Final Application Project

Page 9: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

9

Training AT91-0003

4.2.2 A1 – Step 1

You will now work with the at91bootstrap application.

We will use the at91bootstrap application as the 2nd level bootloader for our final application.

Application Deployment on a serial DataFlash (AT45)

The first level bootloader used for this hands-on is called DataFlash-Boot and is stored in the embedded BootROM of the microcontroller.

It can be used to load a small code from a DataFlash into the internal SRAM of the device that is then executed.

DataFlash-Boot downloaded code size for the AT91SAM 9RL64 must be smaller than 56kBytes.

In this hands-on, the program that will be loaded i n internal SRAM is the at91bootstrap.

The at91bootstrap will then be used as a second level bootloader to load the final application from the DataFlash into the on-board SDRAM.

Page 10: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

10 AT91 Hands-On

Training AT91-0003

This boot sequence is sum up below:

Select at91bootstrap project:

• Click on the dataflash2sdram tab:

The at91bootstrap project is now selected.

Page 11: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

11

Training AT91-0003

Understand at91bootstrap Tdesc structure: • Go to the TODO A1-Step 1.1 Bookmark (within the main.h file) and look for the

Tdesc structure

The Tdesc structure defines parameters that must be set regarding the customer application deployment constraints.

typedef struct _Tdesc {

unsigned int offset; /// Memory offset

unsigned int dest; /// Destination address

unsigned int size; /// Module size in bytes

const char *name; /// Module file name

} Tdesc;

The offset parameter corresponds to the NVM memory offset address where the final application has been stored.

The dest parameter is the link address of the final application, i.e. the address where it will be executed.

The size parameter corresponds to the final application size. It is used by the at91bootstrap application to copy the final application from DataFlash to SDRAM.

The *name parameter is only used to be displayed on the serial port for trace purpose.

Page 12: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

12 AT91 Hands-On

Training AT91-0003

Set at91bootstrap parameters

• Go to the TODO A1-Step 1.2 Bookmark (within the boot.h file) and fill correctly the Tdesc structure called tabDesc regarding the following information:

The final application will be programmed in DataFla sh at the address 0x8400.

The final application has been linked at the addres s 0x20000000 which is the base address of the SDRAM.

The final application size is 36kBytes ���� 0x9000.

const Tdesc tabDesc[] = {

#if defined(ORIGIN_dataflash)

{, , , "Customer Application"}

#elif defined(ORIGIN_nandflash)

{0x20000, 0x23F00000, 0x30000, "u-boot"}

#endif

Compile and Debug the at91bootstrap example: • Select Slot A (On Board) build configuration.

• Click the Make button in the toolbar. The progress of the build will be displayed in the “Build messages” window at the bottom.

• Click on ‘Debug’ in the toolbar. The application is then loaded into the SDRAM, and the macro file is executed.

• Click on ‘Go’ and the application starts to be executed.

The HyperTerminal should display the following traces: -- At91bootstrap Project 1.4 (Aug 19 2008 08:51:03) --

-I- Board: AT91SAM9RL64-EK

-I- Setting: MCK = 100MHz

-I- Init SDRAM

-I- Init AT45 Dataflash

-E- Device not detected or unknown

-I- Jump to 0x20000000

Page 13: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

13

Training AT91-0003

DataFlash has not been detected as its jumper J13 i s open.

Do not forget to stop the debug before next step. Connect J13 jumper & Compile and Debug the at91boot strap example:

• Connect soldered serial DataFlash jumper J13.

• Select Slot A (On Board) build configuration.

• Click the Make button in the toolbar. The progress of the build will be displayed in the “Build messages” window at the bottom.

• Click on ‘Debug’ in the toolbar. The application is then loaded into the SDRAM, and the macro file is executed.

• Click on ‘Go’ and the application starts to be executed.

The HyperTerminal should now display the following traces:

-- At91bootstrap Project 1.4 (Aug 19 2008 11:25:16) --

-I- Board: AT91SAM9RL64-EK

-I- Setting: MCK = 100MHz

-I- Init SDRAM

-I- Init AT45 Dataflash

-I- Dataflash detected : AT45DB642D

-I- Copy Customer Application (36864 bytes) from DataFlash 0x00008400 to 0x20000000

-I- Jump to 0x20000000

Regarding the current code located at the address 0 x20000000, you may see other traces on the serial port.

Based on the traces, the bootstrap seems to have co pied 36kB bytes from the address 0x8400 of the DataFlash in the SDR AM base address 0x20000000.

4.3 Summary

The above exercise illustrates how to:

• Set the at91bootstrap parameters regarding customer application constraints. • Build the at91bootstrap for the final application.

Page 14: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

14 AT91 Hands-On

Training AT91-0003

5 Hands-On - Assignment 2

5.1 Objectives

The goal of this assignment is to program the different applications in order to deploy the customer application.

In this Assignment you will:

• Using IAR Flash loaders and the at91bootstrap project:

� Program in serial DataFlash the bootstrap application

� Program in serial DataFlash the final application

� Deploy the final application

5.2 Exercises

5.2.1 A2 – Step 1

AT91SAM9RL64 Boot Sequence

You will program first of all the at91bootstrap in DataFlash so that it can be executed automatically after each power up of the device.

Indeed, after power up, the DataFlash-Boot application located in the embedded BootROM (see below) will look for a valid code on a DataFlash connected to the SPI Chip Select 0 (NPCS0). It will then copy it in internal SRAM and will execute it.

In our case, this code will be the at91bootstrap application.

Page 15: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

15

Training AT91-0003

Modify Project Options to allow DataFlash Programmi ng

• Open Project Options through the Project menu > Options:

• Go on the Debugger and click on Use flash loader(s) check box:

• Click on Edit to open the Flash loader overview, select the first line and click on Edit:

Page 16: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

16 AT91 Hands-On

Training AT91-0003

• Look at the Flash Loader Configuration Box:

The Relocate Offset parameter indicates to the IAR flash loader (AT45FlashAT91SAM9RL64.out) the address in DataFlas h where to program the generated binary.

The at91bootstrap application has to be programmed at the address 0x0.

Extra parameter: --dataflash a indicates that the c hip select 0 of the Serial Peripheral Interface is selected .

• Click on OK until coming back to the current workspace.

Compile and Program the at91bootstrap application: • Click the Make button in the toolbar. The progress of the build will be displayed in

the “Build messages” window at the bottom.

• Click on ‘Debug’ in the toolbar. The application is then loaded into the DataFlash, and the macro file is executed.

• Stop the Debugger.

You can now power down then power up the board and the following traces should appear on the HyperTerminal:

-- At91bootstrap Project 1.4 (Aug 19 2008 10:32:57) --

-I- Board: AT91SAM9RL64-EK

-I- Setting: MCK = 100MHz

-I- Init SDRAM

-I- Init AT45 Dataflash

-I- Dataflash detected : AT45DB642D

-I- Copy Customer Application (36864 bytes) from DataFlash 0x00008400 to 0x20000000

-I- Jump to 0x20000000

Page 17: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

17

Training AT91-0003

5.2.2 A2 – Step 2

You will program the final application in DataFlash so that it can be called by the at91bootstrap and executed automatically after each power up of the device.

The at91bootstrap has been programmed at the addres s 0 of the DataFlash.

The final application will be programmed at the add ress 0x8400 of the DataFlash.

Select at91sam9rl-ek project: • Click on the at91sam9rl-ek tab:

The at91sam9rl-ek project is now selected.

Page 18: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

18 AT91 Hands-On

Training AT91-0003

Modify Project Options to allow DataFlash Programmi ng

• Open Project Options through the Project menu > Options:

• Go on the Debugger and click on Use flash loader(s) check box:

• Click on Edit to open the Flash loader overview, select the first line and click on Edit:

Page 19: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

19

Training AT91-0003

• Look at the Flash Loader Configuration Box:

The Relocate Offset parameter indicates to the IAR flash loader (AT45FlashAT91SAM9RL64.out) the address where to pr ogram the generated binary.

The final application has to be programmed at the a ddress 0x8400.

• Click on OK until coming back to the current workspace.

Compile and Program the final application: • Select at91sam9rl64_sdram build configuration.

• Click the Make button in the toolbar. The progress of the build will be displayed in the “Build messages” window at the bottom.

• Click on ‘Debug’ in the toolbar. The application is then loaded into the DataFlash, and the macro file is executed.

• Stop the Debugger.

After exiting the debug screen, you can power down the board. Then, power it up and the following traces should appear on the HyperTerminal:

-- At91bootstrap Project 1.4 (Aug 19 2008 10:32:57) --

-I- Board: AT91SAM9RL64-EK

-I- Setting: MCK = 100MHz

-I- Init SDRAM

-I- Init AT45 Dataflash

-I- Dataflash detected : AT45DB642D

-I- Copy Customer Application (29432 bytes) from DataFlash 0x00008400 to 0x20000000

-I- Jump to 0x20000000

-- Hands-on SAM9RL --

-I- MEDSdcard init

-I- Please connect a SD card ...

Page 20: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

20 AT91 Hands-On

Training AT91-0003

The customer application is now burned in DataFlash and can be executed each time the board is powered on. You can now plug the SDCard and enjoy the final application!!!

5.3 Summary

The above exercise illustrates how to:

• Program in serial DataFlash different applications thanks to the IAR DataFlash Loader.

• Understand how to deploy an application using the embedded ROM and the at91bootstrap.

Page 21: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

21

Training AT91-0003

6 Hands-On - Assignment 3 ( Optional )

6.1 Objectives

The goal of this assignment is to copy the final application in SD Card in order to deploy it from SD Card.

In this Assignment you will:

• Using IAR and a SD Card reader: � Build the final application in SRAM

� Copy the final application in SD Card

� Deploy the final application

6.2 Exercises

6.2.1 A3 – Step 1

Select at91sam9rl64_sram project: • Click on the at91sam9rl-ek tab:

The at91sam9rl-ek project is now selected.

Compile and Debug the project example: • Unplug the SDCard or it will not be detected by the driver.

• Select SRAM build configuration.

• Click the Make button in the toolbar. The progress of the build will be displayed in the “Build messages” window at the bottom.

• Click on ‘Debug’ in the toolbar. The application is then loaded into the SRAM, and the macro file is executed.

• Click on ‘Go’ and the application starts to be executed.

• -I- Please connect a SD card ... should be displayed on the HyperTerminal.

• Now, connect an SDCard FAT formatted with supported BMP images.

Page 22: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

22 AT91 Hands-On

Training AT91-0003

BMP images should be displayed on the LCD and should be shifted regarding pen movements on the screen.

6.2.2 A3 – Step 2

Search for the binary file generated in the following path: C:\AT91\AT91SAM9RL64 Hands-On 03\at91sam9rl-ek\fina l-application\ewp\at91sam9rl64_sram\Exe\ You may have already noticed that at91sam9rl64_sram.bin file size is smaller than the maximum allowed file size by any NVM Boot Solution (max: 56kBytes). It means we can use the SDCard-Boot application to deploy the customer application without the use of any 2nd level bootloaders.

AT91SAM9RL64 Boot Sequence

You will copy the customer application in SD Card so that it can be executed automatically after each power up of the device.

Indeed, after power up, the SDCard-Boot application located in the embedded BootROM (see below) will look for a boot.bin file at the root directory on a formatted 12/16/32 SD Card connected to the MCI. It will then copy it in internal SRAM and will execute it.

SDCard-Boot downloaded code size for the AT91SAM9RL 64 must be smaller than 56kBytes.

Page 23: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

23

Training AT91-0003

This boot sequence is sum up below:

Copy the at91sam9rl64_sram.bin in the SDCard: • Rename the at91sam9rl64_sram.bin to boot.bin.

• Using a SD Card Reader, copy the boot.bin file at the root directory of a FAT12/16/32 formatted SD Card.

• Plug the SD Card.

• Power up the board

BMP images should be displayed on the LCD and should be shifted regarding pen movements on the screen.

6.3 Summary

The above exercise illustrates how to:

• Modify an application binary file in order to boot from SD Card.

• Understand how to deploy an application using the embedded ROM.

Page 24: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

24 AT91 Hands-On

Training AT91-0003

7 Hands-On Summary The training materials have provided:

• How to deploy an application on our AT91SAM9RL64

• Knowledge of the AT91SAM9RL device:

� Boot ROM Solutions

� At91bootstrap bootloader application

• Development examples using:

� AT91LIB

� IAR EWARM

• Application debug using:

� JTAG SAM-ICE

Page 25: AT91SAM9RL64 Hands-On 03 Web 1 - pudn.comread.pudn.com/downloads150/sourcecode/embed/648357... · - SD Card and SD Card Reader • Skill Level - Beginner to Advanced • Estimated

AT91 Hands-On 03

25

Training AT91-0003

8 Resources Below is a list of web resources available for the AT91SAM products:

• AT91SAM Home http://www.atmel.com/products/AT91/

• AT91SAM Datasheets http://www.atmel.com/dyn/products/datasheets.asp?family_id=605

• AT91SAM9RL Evaluation Kit information http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4244

• IAR EWARM http://www.iar.com/website1/1.0.1.0/68/1/index.php

• Segger

http://www.segger.com

9 Atmel Technical Support Resources

Atmel has several support channels available:

� Web portal: http://support.atmel.no/ All Atmel microcontrollers

� Email: [email protected] All AT91SAM products

Please register on the web portal to gain access to the following services:

� Access to a rich FAQ database

� Easy submission of technical support requests

� History of all your past support requests

� Register to receive Atmel microcontrollers’ newsletters

� Seminar & Events Registration / Follow-up