AT91 ARM Thumb Microcontrollers. Application Note. AT91 Host Flash Loader. 1. Package Contents. 2. Definition of Terms. 3.

Similar documents
Rad Hard FPGA. AT40KEL-DK Design Kit Content. Description. Kit Content. Reference Material. Support

AT17F Series. Application Note. Programming Circuits for AT17F Series Configurators with Xilinx FPGAs. 1. Introduction

Application Note. Microcontrollers. Using Keil FlashMon Emulator with AT89C51CC01/03 AT89C51CC01/ Summary. 2. Background overview

AT89ISP Programmer Cable Introduction AT89ISP Programmer Cable Parallel Port Settings Application Note AT89ISP Software AT89ISP Cable polarized

CAN Microcontrollers. Application Note. Migrating from T89C51CC01 to AT89C51CC03. Feature Comparison

AVR32 UC3 Software Framework... User Manual

AT17 Series FPGA. Configuration Memory. Application Note. In-System Programming Circuits for AT17 Series Configurators with Atmel and Xilinx FPGAs

8-bit Microcontroller. Application Note. AVR320: Software SPI Master

CAN, 80C51, AVR, Microcontroller. Application Note

Interfacing the internal serial EEPROM

TSC695. Application Note. Annulled Cycle Management on the TSC695. References

Section 1 ATAVRAUTOEK1 Getting Started

8051 Microcontrollers. Application Note. Migration from AT89C5131 & AT89C5131A-L to AT89C5131A-M

FPGA Configuration EEPROM Memory. Application Note. Programming Atmel s EEPROMs: AT17LV020(A) vs. AT17LV002(A) Introduction.

AT17(A) Series FPGA Configuration Memory. Application Note

SAM Boot Assistant (SAM-BA)... User Guide

AT91 ARM Thumb Microcontrollers. Application Note. AT91M55800A Clock Switching Considerations using Advanced Power Management Controller.

MARC4. Application Note. Hints and Tips for Hard- and Software Developments with MARC4 Microcontrollers

Trusted Platform Module AT97SC3203S. SMBus Two-Wire Interface. Summary

8-bit RISC Microcontroller. Application Note. AVR 305: Half Duplex Compact Software UART

AT89C5131 Starter Kit... Software User Guide

ATAVRAUTO User Guide

8-bit Microcontroller. Application Note. AVR031: Getting Started with ImageCraft C for AVR

MP3 Player Reference Design Based on AT89C51SND1 Microcontroller... User Guide

AT89STK-10 Starter Kit... Hardware User Guide

8-bit Microcontroller. Application Note. AVR030: Getting Started with C for AVR

AT89STK-09 Starter Kit for AT83C26... User Guide

Application Note Microcontrollers. C Flash Drivers for T89C51RC/RB/IC2 and AT89C51RC/RB/IC2 for Keil Compilers

FPGA Configurator Programming Kit (Enhanced) ATDH2200E. Features. Description

8-bit RISC Microcontroller. Application Note. AVR151: Setup And Use of The SPI

Migration From AT89C51SND1C to AT83C51SDN1C. Application Note. MP3 Microcontrollers

System Designer. Programmable SLI AT94K/AT94S Series. Features. Description

System Designer. Programmable SLI AT94K/AT94S Series. Features. Description

ATAVRAUTO User Guide

AVR501: Replacing ATtiny15 with ATtiny25. 8-bit Microcontrollers. Application Note PRELIMINARY. Features. 1 Introduction

AVR1303: Use and configuration of IR communication module. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

a clock signal and a bi-directional data signal (SCL, SDA)

AT697E. Application Note. Checking AT697E Code for Occurrence of LDF/FPOPd Instructions Sequence with a dependency on an Odd-Numbered Register

AT94K Series Field Programmable System Level Integrated Circuit. Application Note. FPSLIC Baud Rate Generator

256K (32K x 8) 5-volt Only Flash Memory AT29C256

Two-wire Serial EEPROM Smart Card Modules 128K (16,384 x 8) 256 (32,768 x 8) AT24C128SC AT24C256SC. Features. Description VCC NC

32-bit Secure. AT91SC CT-USB Summary. Microcontrollers. Features

AVR32752: Using the AVR32 UC3 Static Memory Controller. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Two-Wire Serial EEPROM AT24C164 (1)

256K (32K x 8) 5-volt Only Flash Memory AT29C256

GemCore Serial Lite PRO AT83C21GC. Summary

2-megabit (256K x 8) 5-volt Only Flash Memory AT29C020

Programmable SLI AT40K AT40KAL AT94K. Application Note. Implementing a Single-coefficient Multiplier

4-megabit (512K x 8) 3-volt Only 256-byte Sector Flash Memory AT29LV040A

1-megabit (128K x 8) 5-volt Only Flash Memory AT29C010A

AVR based 125kHz RFID Evaluation Kit (Re)Programming Guide ATA2270-EK1. Overview. Fuse Settings: ISP Programming

AT85DVK-07 Demonstration Firmware... User s Manual

2-Wire Serial EEPROM AT24C01. Features. Description. Pin Configurations. 1K (128 x 8)

DatasheetDirect.com. Visit to get your free datasheets. This datasheet has been downloaded by

AVR1315: Accessing the XMEGA EEPROM. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AT89C5122. Application Note. Preventing Windows XP from Displaying Unknown device Message at Startup

Two-wire Serial EEPROM Smart Card Modules 1K (128 x 8) 2K (256 x 8) 4K (512 x 8) 8K (1024 x 8) 16K (2048 x 8)

512K (64K x 8) 5-volt Only Flash Memory AT49F512

8-bit Microcontroller. Application Note. AVR201: Using the AVR Hardware Multiplier

80C51 MCUs T89C51AC2. Errata Sheet

64K (8K x 8) High Speed Parallel EEPROM with Page Write and Software Data Protection AT28HC64BF

T89C5115 UART Bootloader

8-megabyte, 4-megabyte, and 2-megabyte 2.7-volt Only DataFlash Cards AT45DCB008D AT45DCB004D AT45DCB002D. Not Recommended for New Design

AT89C51CC03 UART Bootloader

AT91 ARM Thumb Microcontrollers. Application Note. Using the ECC Controller on AT91SAM9260/9263 and AT91SAM7SE Microcontrollers. 1.

3-Wire Serial EEPROM AT93C46C

T89C51AC2 UART Bootloader

hex file. The example described in this application note is written for the AT94K using the FPSLIC Starter Kit. Creating a New Project

256 (32K x 8) High-speed Parallel EEPROM AT28HC256N. Features. Description. Pin Configurations

AVR32401: AVR32 AP7 Linux Interfacing DataFlash. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

2-wire Serial EEPROM AT24C21. 2-Wire, 1K Serial EEPROM. Features. Description. Not Recommended for New Designs. Pin Configurations.

AT91 ARM Thumb-based Microcontroller. Application Note. AT91SAM7X and AT91SAM7XC Microcontroller Series Schematic Check List. 1.

4-megabit (512K x 8) Single 2.7-volt Battery-Voltage Flash Memory AT49BV040A

AT89C51SND1 UART Bootloader

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

AT91SAM-ICE... User Guide

4-megabit (512K x 8) Flash Memory AT49BV040B

AVR1503: Xplain training - XMEGA Programmable Multi Interrupt Controller 8-bit Microcontrollers Application Note Prerequisites

8-bit Microcontroller with 2K/4K/8K Bytes In-System Programmable Flash. Appendix A. Preliminary. ATtiny261 ATtiny461 ATtiny861 Automotive

2-wire Serial EEPROM Smart Card Modules AT24C32SC AT24C64SC

1-megabit (64K x 16) 3-volt Only Flash Memory AT49BV1024A AT49LV1024A

AVR1922: Xplain Board Controller Firmware 8-bit Microcontrollers Application Note Features 1 Introduction

AVR097: Migration between ATmega128 and ATmega1281/ATmega bit Microcontrollers. Application Note. Features. 1 Introduction

ARM7TDMI - based Microcontroller AT91RM3400. Errata Sheet

64K (8K x 8) Parallel EEPROM with Page Write and Software Data Protection AT28C64B. Features. Description. Pin Configurations

CryptoRF EEPROM Memory 8 Kbits

TMEB8704 RFID Application Kit. Application Note. RFID Application Kit TMEB Introduction. 2. Getting Started. 2.1 Minimum System Requirements

2-megabit (256K x 8) 3-volt Only Flash Memory AT29LV020

DIP Top View VCC A12 A14 A13 A6 A5 A4 A3 A2 A1 A0 A8 A9 A11 A10 I/O7 I/O6 I/O0 I/O1 I/O2 I/O5 I/O4 I/O3 GND. TSOP Top View Type 1 A11 A9 A8 A13 A14

512K (64K x 8) 5-volt Only Flash Memory AT29C512

1-megabit (64K x 16) 3-volt Only Flash Memory AT49LV1024 AT49LV1025

Battery-Voltage. 4-megabit (512K x 8/ 256K x 16) Single 2.7-volt. Flash Memory AT49BV4096A AT49LV4096A

Bluetooth General Information White Paper

T89C51CC01 CAN Bootloader

Flash Microcontrollers. Application Note. Migrating from AT89C2051/C4051 to AT89LP2052/LP4052

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

1-megabit (64K x 16) 5-volt Only Flash Memory AT49F1024 AT49F1025

4-megabit (512K x 8) 5-volt Only 256-byte Sector Flash Memory AT29C040A

1-megabit (128K x 8) 5-volt Only Flash Memory AT49F001A AT49F001AN AT49F001AT AT49F001ANT. Features. Description. Pin Configurations

UART. Embedded RISC Microcontroller Core Peripheral

Transcription:

AT91 Host Flash Loader This application note describes the host Flash loader used to upload and program an application in the Flash memory of a Flash-based AT91 microcontroller. Flash-based AT91 devices are delivered by Atmel with resident boot software able to upload program software into the Flash memory. The following subjects are covered in this document: Flash requirements Host loader software Host configuration file Host loader software user notes AT91 ARM Thumb Microcontrollers 1. Package Contents The file AT91Loader.zip contains all source and executable files for the computer. It also contains AT91Loader162S.ini files, configuration files for the AT91Loader.exe file. The file AT91Flash_uploader.zip contains all source, object and binary files for the AT91 device. It enables the user to understand and modify (if necessary) the flash uploader software. Note that fmu_flash.bin is the image of AT91 Flash production line programming. 2. Definition of Terms A Flash-based AT91 is a microcontroller containing an embedded AT91 ARM7TDMI microcontroller with a 16-bit Flash memory. A host Flash loader is a PC running software under Windows. USART is the universal synchronous/asynchronous receiver/transmitter, a serial communication port compatible with the computer serial port. 3. Warranty All delivered sources are free of charge and can be copied or modified without authorization. The software is delivered AS IS without warranty or condition of any kind, either express, implied or statutory. This includes, without limitation, any warranty or condition with respect to merchantability or fitness for any particular purpose, or against the infringements of intellectual property rights of others. Rev. 1

4. Host Loader Software 5. Configuration File The host loader software runs under Windows. The executable file AT91Loader.exe has been generated with Microsoft Visual Studio 6.0. Its main functionalities are: To read the configuration file (Loader.ini) To synchronize with the AT91 boot loader software on a Flash-based AT91 micro-controller and adapt to the baud rate (defined in Loader.ini) To read and analyze the binary file To encode commands and transfer data The host flash loader supports different flash configurations described in the configuration file. This file also describes additional initialization parameters for the transfer configuration. These parameters are defined in four groups: MODE: COM: FILE: FLASH: Work mode PC serial port definition Name of binary file to download Target Flash description 5.1 MODE 5.2 COM This field is used for the debug protocol. In general, two modes can be set, automatic mode or manual mode. Manual = 0: Automatic mode. All commands and sequences are managed by the PC Host Flash loader. Manual = 1: Manual mode. All commands can be sent in the menu Send. This mode is used only for debugging the serial communication channel. If this field is set, the following commands are accessible: Autosync: Autosynchronisation Synchro: Send the synchro command Speed: Send the speed command Erase sector: Select the sector to erase and send the erase sector command Write: Select the address and send the write command Data: Send a block of 64 data words Read Data: Select the address and read a block of 64 data words Verify: Select the addresses (start and end) and the checksum and send the verify command Upload: Not implemented ACK: Send the ack command Fill input buffer: Purge the communication port This field is used to define the serial communication channel. It is divided into four fields: 2

Name = COM1: Indicates the PC port connected to the target Synchronization = 1200: Indicates the initial connection speed. In this case the low speed choice is used. The first action of the target is waiting for a character (0x80) for baud rate measurement and to initiate the communication. Transfer_baud = 115200: Indicates data transfer connection speed. In general, a PC cannot support a baud rate higher than 115200. If the user PC supports a higher speed, the baud rate can be updated. Target_CD = 36: Indicates the target user CD value for data speed connection. This value depends on the main target oscillator. The AT91 USART Speed Definition table on page 7 can be used to choose the best CD value to optimize communication quality. This value is sent to the target after synchronization and when communication starts at the high speed data transfer rate. 5.3 FILE 5.4 FLASH Name of binary file to download. This name must use the absolute path. Target flash description. This field is used to define the embedded Flash. It is sub-divided into six fields: Name = AT91FR40162S. Indicates the Flash name. It is used only to provide the information corresponding to the file definition. This field is not analysed. Type = 0x00C0. Indicates the type of embedded Flash. This information is available in the corresponding Flash datasheet in the device code field. Manufacturer = 0x001F. Indicates the type of embedded Flash. This information is available in the corresponding Flash datasheet in the manufacturer code field. base_address = 0x01000000. Indicates the first Flash sector. This value is also defined in the target by the EBI setting. Load_address =0x01000000. Indicates the first address to be loaded. Generally it is the same as the base address. Sector = 40. Indicates the sector number of the embedded Flash. This information is defined in the features presented in the Flash datasheet. Sector_TypeX = and Size_TypeX = These groups of two fields describe the Flash sector mapping. For example, if a 16-megabit 1 M words/2 M bytes Flash is used, e.g, AT91FR40162S, there are thirty-nine sectors to map as shown in Table 5-1. Table 5-1. Sector Mapping Sector No. Sector K bytes Sector_TypeX Size_TypeX X SA0 to SA7 8 8 8 8 0 SA8 to SA38 31 64 31 64 1 Total (AT91FR40162S) 39 2048 For sector type 0, there are 8 sectors of 8K bytes (Sector_Type0 = 8; Size_Type0 =8) For sector type 1, there are 31 sectors of 64K bytes (Sector_Type1 = 1; Size_Type1 =64) 3

This information is available in the corresponding Flash datasheet in the Sector Address Table field. Here an example of the LOADER.INI file, for the embedded Flash of the AT91FR40162S. 5.5 Example of Loader.ini File for AT91F40162S The file is provided by Atmel. [MODE] Manual=0 // automatic load, all commands are managed by HOST Loader [COM] Name=COM1 // COM1 serial port Synchronization_baud=1200 // Synchronization baud rate Transfer_baud=115200 // Transfer baud rate Target_CD=36 // AT91 CD value for a baud rate of 115200 [FILE] // name of the binary file to download Name=C:\At91\software\projects\led_blink_eb40\flash\led_blink.bin [FLASH] Name=AT91FR40162S Type=0x00C0 Manufacturer=0x001F// ATMEL manufacturer Id base_address=0x01000000 // base address of the flash Load_address=0x01000000 // download address of the binary file Sector=39 // number of sector of the flash Sect_type0=8 // number of first sectors SA0 to SA7 Size_type0=8 // Size of the first sectors in K byte Sect_type1=31 // number of next sectors SA8 and SA38 Size_type1=64 // Size of sectors in K byte [END_OF_FILE] 4

6. Host Loader Software User Notes The download procedure is as follows: 1. If an AT91 with an AT91FR40162S is used, copy Loader162S.ini into Loader.ini. 2. Modify the [FILE] field. Set the name of the binary file as follows: [FILE] Name=C:\At91\software\projects\"your project\your binary file name" 3. Connect the AT91-based system through a serial cable to the computer's COM1. 4. Power-up or reset the system to launch Flash_uploader. 5. Launch AT91Loader.exe on your computer. The window below should appear: When the computer's serial COM1 is synchronized with the USART of the AT91, Flash programming begins. If the download is successful, the following window appears: If the download is unsuccessful, the following window appears: 5

6.1 Troubleshooting In case of failure, the following points should be verified: Hardware AT91 and Flash supplies are correctly connected NCS0 is connected to NCSF NWAIT is pulled-up and not driven always to 0 NRST is connected to a reliable reset circuitry NRSTF is connected to a reliable reset circuitry (we suggest to connect it directly to NRST) BMS is connected to 0 NTRI is pulled-up Software Loader.ini contains the correct memory mapping Serial port selected is the one connected to serial cable (COM1 or COM2) File name path is correct Target_CD corresponds to CD chosen based on the table AT91 USART Speed Definition on page 7 Transfer_baud corresponds to Target_CD File downloaded is a pure binary image file (file extension.mem/.rom/.bin) The computer's serial port is not already being used 6

7. AT91 USART Speed Definition Table 7-1. Baud Rate Selection The baud rate parameter is selected depending on microprocessor frequency. It is entered as the value of target_cd in the loader.ini file. Table 7-1 is used to select the most reliable baud rate according to the frequency of the AT91- based system. Note that in asynchronous mode, maximum error must not be greater than 5%. USART Baud Rate = MCKI/CD x 16 MCKI (MHz) Baud Max (Bits/s) Standard (Bits/s) CD Real CD Choice Real (Bits/s) Error % 3 686 400 230 400 115 200 2.00 2 115 200.00 0.00% 4 915 200 307 200 115 200 2.67 3 102 400.00 12.50% 5 000 000 312 500 115 200 2.71 3 104 166.67 10.59% 6 000 000 375 000 115 200 3.26 3 125 000.00 7.84% 6 144 000 384 000 115 200 3.33 3 128 000.00 10.00% 7 372 800 460 800 115 200 4.00 4 115 200.00 0.00% 8 000 000 500 000 115 200 4.34 4 125 000.00 7.84% 10 738 635 671 165 115 200 5.83 6 111 860.78 2.99% 12 000 000 750 000 115 200 6.51 7 107 142.86 7.52% 12 288 000 768 000 115 200 6.67 7 109 714.29 5.00% 14 318 180 894 886 115 200 7.77 8 111 860.78 2.99% 14 745 600 921 600 115 200 8.00 8 115 200.00 0.00% 15 000 000 937 500 115 200 8.14 8 117 187.50 1.70% 18 432 000 1 152 000 115 200 10.00 10 115 200.00 0.00% 24 000 000 1 500 000 115 200 13.02 13 115 384.62 0.16% 24 576 000 1 536 000 115 200 13.33 13 118 153.85 2.50% 25 000 000 1 562 500 115 200 13.56 14 111 607.14 3.22% 32 000 000 2 000 000 115 200 17.36 17 117 647.06 2.08% 32 768 000 2 048 000 115 200 17.78 18 113 777.78 1.25% 40 000 000 2 500 000 115 200 21.70 22 113 636.36 1.38% 7

8. Revision History Table 8-1. Revision History Document Comments Change Request 2640A 2640B First issue Update to document to correspond to new software file; changed device in example in Section 5.5 Example of Loader.ini File for AT91F40162S on page 4. 04-167 8

Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimshatsui East Kowloon Hong Kong Tel: (852) 2721-9778 Fax: (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan Tel: (81) 3-3523-3551 Fax: (81) 3-3523-7581 Atmel Operations Memory 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 Microcontrollers 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 La Chantrerie BP 70602 44306 Nantes Cedex 3, France Tel: (33) 2-40-18-18-18 Fax: (33) 2-40-18-19-60 ASIC/ASSP/Smart Cards Zone Industrielle 13106 Rousset Cedex, France Tel: (33) 4-42-53-60-00 Fax: (33) 4-42-53-60-01 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535 74025 Heilbronn, Germany Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France Tel: (33) 4-76-58-30-00 Fax: (33) 4-76-58-34-80 Literature Requests www.atmel.com/literature Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Atmel Corporation 2006. All rights reserved. Atmel, logo and combinations thereof, Everywhere You Are and others, are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. ARM, the ARMPowered logo and others are the registered trademarks or trademarks of ARM Ltd. Windows and others are registered trademarks or trademarks of Microsoft Corporation. Other terms and product names may be trademarks of others. Printed on recycled paper.