APPLICATION NOTE. Atmel AT03160: Migrating Bootloader from ATxmega128A1 to other Atmel XMEGA Devices. Atmel AVR XMEGA. Features.

Similar documents
APPLICATION NOTE. AT03324: Atmel REB212BSMA-EK Quick Start Guide. Atmel MCU Wireless. Introduction

APPLICATION NOTE. Atmel AVR1638: XMEGA RTC Calibration. 8-bit Atmel Microcontrollers. Features. Introduction

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

Atmel AVR1619: XMEGA-B1 Xplained Demonstration. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

Atmel AVR32847: Migration from/to the UC3L0 64/32/16 from/to the UC3L0 256/ bit Atmel Microcontrollers. Application Note.

Hardware Prerequisites Atmel Xplained Pro Evaluation Kit Atmel WINC1500 extension USB Micro Cable (TypeA / MicroB)

Atmel QT600 Quick Start Guide Touch Solutions

OLED display with pixels resolution Ambient light sensor CPU load Analog filter Quadrature Encoder with push button Digital I/O

APPLICATION NOTE. Atmel AT01080: XMEGA E Schematic Checklist. Atmel AVR XMEGA E. Features. Introduction

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

AVR1518: XMEGA-A1 Xplained Training - XMEGA Clock System. 8-bit Atmel Microcontrollers. Application Note. Prerequisites.

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

APPLICATION NOTE. Atmel AVR057: Internal RC Oscillator Calibration for ATtiny4/5/9/10/20/40. 8-bit Atmel Microcontrollers. Features.

APPLICATION NOTE. Atmel AVR536: Migration from ATmega644 to ATmega644A. 8-bit Atmel Microcontrollers. Introduction

Atmel AVR ATxmega384C3 microcontroller OLED display with 128x32 pixels resolution Analog sensors. Ambient light sensor Temperature sensor

APPLICATION NOTE. Atmel AVR2131: Lightweight Mesh Getting Started Guide. Atmel MCU Wireless. Features. Description

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

Atmel AVR1926: XMEGA-B1 Xplained Getting Started Guide. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

Atmel LF-RFID Kit Comparison Chart. Application Note. Atmel LF-RFID Kit Comparison Chart. 1. Description

STK521. User Guide B AVR 01/12

APPLICATION NOTE. Atmel AVR116: Wear Leveling on DataFlash. 32-bit Atmel Microcontrollers. Features. Description. Wear leveling

Atmel ATMXT143E touchscreen controller Capacitive touch ITO 320 x 240 pixel LCD display with SPI interface LED backlight

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

Atmel AVR1924: XMEGA-A1 Xplained Hardware User's Guide. 8-bit Atmel Microcontrollers. Application Note. Preliminary. Features.

Atmel AT697F. Rad-Hard 32-bit SPARC v8 Processor ERRATA SHEET. Active Errata List

OLED display Sensors readout. Light sensor Temperature sensor

USER GUIDE. Wireless Production Test Reference Protocol Specification Document. Atmel MCU Wireless. Description

AVR1501: Xplain training XMEGA Timer/Counter 8-bit Microcontrollers Application Note Prerequisites 1 Introduction

32Kbytes on-chip SRAM. Viterbi decoding and CRC PRIME compliant 128-bit AES encryption Channel sensing and collision pre-detection

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

Section 5 SERCOM. Tasks SPI. In this section you will learn:

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

APPLICATION NOTE. Atmel AT03782: Using Low Power Modes in SAM4N Microcontroller. Atmel 32-bit Microcontroller. Features.

Atmel AT697F. Rad-Hard 32-bit SPARC v8 Processor ERRATA SHEET. Active Errata List

Atmel CryptoAuthentication Starter Kit

AVR32917: picopower Board getting started. 32-bit Microcontrollers. Application Note. Preliminary. Features. 1 Introduction

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1508: Xplain training - XMEGA DAC 8-bit Microcontrollers Application Note Features 1 Introduction

Atmel AVR ATxmega384C3 microcontroller OLED display with pixels resolution Analog sensors. Ambient light sensor Temperature sensor

Atmel AT32UC3A3256 microcontroller 64MBit SDRAM Analog input (to ADC) Temperature sensor RC filter

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

AVR1512: XMEGA-A1 Xplained training - XMEGA Basics. 8-bit Atmel Microcontrollers. Application Note. Prerequisites. 1 Introduction

AT03975: Getting Started with SAM L21. Descripton. Features. SMART ARM-Based Microcontroller APPLICATION NOTE

Atmel AVR473: ATAVRSB202 Hardware User Guide. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

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

AVR532: Migration from ATmega48/88/168 to ATmega48A/88A/168A. 8-bit Microcontrollers. Application Note. 1 Introduction

Native route discovery algorithm

Getting Started with the SAM4L-EK Demo

AVR32901: EVKLCD100/EVKLCD101 Hardware User's Guide. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

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

Smart RF Device Family - Getting Started Guide. Features. Description. References ATAN0115 APPLICATION NOTE

USER GUIDE. ZigBit USB Stick User Guide. Introduction

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT06467: Getting started with SAM D09/D10/D11. Features. Description. SMART ARM-based Microcontrollers APPLICATION NOTE

One-channel Toggle-mode Touch Sensor IC with Power Management Functions AT42QT1012. Summary

AVR32 UC3 Software Framework... User Manual

Asynchronous SRAM Operating Voltage: 5V Read Access Time: 40 ns Write Cycle Time: 30 ns Very Low Power Consumption (Pre-RAD)

USER GUIDE EDBG. Description

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

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATtiny87 ATtiny167 Automotive

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

Non Volatile Rad Hard Reprogrammable FPGA. ATF280 SRAM-based FPGA AT69170 Serial EEPROM. 2x SRAM-based FPGA designed for Space use - ATF280

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

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

EDBG. Description. Programmers and Debuggers USER GUIDE

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE

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

APPLICATION NOTE. AT6486: Using DIVAS on SAMC Microcontroller. SMART ARM-Based Microcontroller. Introduction. Features

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

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

WINC1500 Software. Release Notes VERSION : DATE : JULY Abstract

SAM4 Reset Controller (RSTC)

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

32Kbytes on-chip SRAM Up to 256Kbytes external SRAM

USER GUIDE. Atmel Segment LCD1 Xplained Pro. Preface

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

USER GUIDE. ATmega168 Xplained Mini User Guide. Introduction

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

APPLICATION NOTE. AT11008: Migration from ATxmega16D4/32D4 Revision E to Revision I. Atmel AVR XMEGA. Introduction. Features

Atmel AVR944: Atmel LED Driver Library for 8- bit AVR. 8-bit Atmel. Microcontroller. Application Note. Features. 1 Introduction

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

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Generating Random Secrets. ATSHA204A, ATECC108A, and ATECC508A. Description. Topics

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

This user guide describes how to run the Atmel ATWINC3400 Bluetooth Low Energy (BLE) Provisioning demo from out-of-box conditions.

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

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

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

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

ATDH2200E Programming Kit... User Guide

CAN, 80C51, AVR, Microcontroller. Application Note

QTouch 8-key Touch Sensor IC AT42QT1085. Summary

SAMA5D2 Quad SPI (QSPI) Performance. Introduction. SMART ARM-based Microprocessor APPLICATION NOTE

USER GUIDE. Atmel QT1 Xplained Pro. Preface

AVR32015: AVR32 Studio getting started. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Preparations. Creating a New Project

APPLICATION NOTE. Atmel AVR3005: Low Power QTouch Design. Atmel QTouch. Features. Introduction

Transcription:

APPLICATION NOTE Atmel AT03160: Migrating Bootloader from ATxmega128A1 to other Atmel XMEGA Devices Features Atmel AVR XMEGA bootloader Procedure application C-code sample application for Self Programming Read and Write Both Flash and EEPROM Memories Read and Write Lock Bits Read Fuse Bits Description Atmel AVR XMEGA As many electronic designs evolve rapidly there is a growing need to be able to update products which have already been shipped or sold. The bootloader firmware embedded in microcontrollers can facilitate the application flash update without the need of a programmer. This application note describes how to migrate bootloader from Atmel ATxmega128A1 to other AVR XMEGA devices step by step. Before reading this application note, AVR1605 XMEGA Boot Loader Quick Start Guide should be read since this application note is an extended read for AVR1605. The project of AVR1605 is based on ATxmega128A1 and the entire project package could be downloaded from Atmel website. For more information about self programming please refer to the application note AVR109: Self Programming.

Table of Contents 1. Procedure... 3 1.1 Step 1 - Start IAR... 3 1.2 Step 2 - Open the project... 3 1.3 Step 3 - Change processor and xcl file... 5 1.4 Step 4 - Change flash page size... 8 1.5 Step 5 - Change define information... 9 1.6 Step 6 - Compile the project... 9 1.7 Step 7 - Debug the bootloader... 11 1.8 Step 8 - Change the bat file... 13 2. Recommended reading... 14 3. Revision History... 15 2

1. Procedure Here are the main procedures to migrate bootloader from ATxmega128A1 to other XMEGA devices. Before doing the migration following the procedures, the original project which is based on ATxmega128A1 should be downloaded through the link: http://www.atmel.com/images/avr1605.zip IAR Embedded Workbench version 6.11 or later should be installed first before starting the migration procedure. Optionally Atmel Studio version 6.0 or later is installed if the bootloader is programmed in Atmel Studio. 1.1 Step 1 - Start IAR Click Windows start -> All Programs -> IAR Systems -> IAR Embedded Workbench for Atmel AVR -> IAR Embedded Workbench. Figure 1-1. Start IAR 1.2 Step 2 - Open the project Click File -> Open -> Workspace. Figure 1-2. Open workspace 3

Browse to the project folder, select the project file bootloader.eww, and then click Open button. Figure 1-3. Open bootloader If the used IAR software version is newer, the conversion prompt will occur. Click Yes to continue. Figure 1-4. Conversion prompt 4

1.3 Step 3 - Change processor and xcl file Select bootloader - Debug in the Workspace and then click Project -> Options. Figure 1-5. Open options Select General Options in the Category and then in the Target tab, change ATxmega128A1 to the target device. Figure 1-6. Change processor 5

Find the linker configuration file link_bootloader_atxmega128a1.xcl in \code folder. And copy from it to get the target linker configuration file and rename it with the target device name. In this target device.xcl file, change Segments in program address space (internal Flash memory), Data (SRAM, external ROM or external NV RAM) memory and Internal EEPROM part to the suitable values according to the datasheet of the target device. You can also refer to the linker file for corresponding device from IAR for these details. IAR s linker files are available in \IAR Systems\Embedded Workbench 6.0\avr\src\template folder. Figure 1-7. Change xcl file 6

Select Linker in the Category and then in the Config tab, change link_bootloader_atxmega128a1.xcl to the modified target file. Figure 1-8. Select xcl file 7

1.4 Step 4 - Change flash page size Select sp_driver.h file in Workspace and change the FLASH_PAGE_SIZE, 512, to the correct value corresponding to the target device. The flash page size can be acquired in the datasheet. Figure 1-9. Change flash page size in sp_driver.h Select sp_driver.s90 file in Workspace and change the FLASH_PAGE_SIZE, 512, to the correct value depending on the target device. Figure 1-10. Change flash page size in sp_driver.s90 8

1.5 Step 5 - Change define information Select defines.h file in the Workspace. Change ATxmega128A1 to the target device and then change all the predefined items to match the target device. All the information filled could be found in the datasheet. Figure 1-11. Change pre-defined information 1.6 Step 6 - Compile the project If everything is processed correctly, the project can be compiled successfully. Click Project -> Rebuild All and the new debug file, bootldr.dbg, will be created in \Debug\Exe folder. This debug file will be used to debug the bootloader in Atmel Studio. Figure 1-12. Rebuild the project 9

If the bootloader is debugged with IAR Embedded Workbench, the output format should be changed as shown in Figure 1-13. After the setting, click Project -> Rebuild All and the bootloader.d90 will be produced. This debug file will be used to debug the bootloader with IAR Embedded Workbench. Figure 1-13. Output format 10

1.7 Step 7 - Debug the bootloader The bootloader can be debugged on IAR Embedded Workbench. Select the debugger you are using in the Setup tab as shown in Figure 1-14. Figure 1-14. Select tool 11

Click Project -> Download and Debug, and this will debug the bootloader to the target device shown in Figure 1-15. After downloading, you could start debugging the bootloader. Figure 1-15. Download and debug Alternatively, bootldr.dbg file can make the bootloader to be debugged in Atmel Studio 6. After opening Atmel Studio 6, click File -> Open -> Open Object File For Debugging, and then browse to \Debug\Exe folder to open bootldr.dbg file. Please refer to Atmel Studio help file for more information on how to debug with the object file. Figure 1-16. Open object file 12

1.8 Step 8 - Change the bat file Browse to \AVROSP_Test folder and open the bat file with Notepad. Change ATxmega128A1 to the target device. The.hex file should be changed to the real image file name. The image file (.hex) should be placed in the same folder with the bat file. The other bat files should be changed in the same way if they are used. Figure 1-17. Change bat file 13

2. Recommended reading It is recommended to read the following application notes to get an overall idea about self programming and bootloader: AVR109: Self Programming This application note explains how devices with the SPM instruction can be configured for self programming. Though it is given for Atmel tinyavr and Atmel megaavr devices, it gives general information about self programming. AVR1316: XMEGA Self-programming This application note describes the basic functionality of Atmel AVR XMEGA self programming. AVR1622: TWI Boot Loader for XMEGA This application note describes how to use boot loader of the XMEGA family of devices to update the application section and how XMEGA can be configured for self programming. AVR1605: XMEGA Boot Loader Quick Start Guide This application note describes how to use a boot loader application with one of the XMEGA family devices (i.e. ATxmega128A1) and how an AVR with the Store Program Memory (SPM) instruction can be configured for Self-programming. 14

3. Revision History Doc. Rev. Date Comments 42153A 07/2013 Initial revision 15

Atmel Corporation 1600 Technology Drive San Jose, CA 95110 USA Tel: (+1)(408) 441-0311 Fax: (+1)(408) 487-2600 www.atmel.com Atmel Asia Limited Unit 01-5 & 16, 19F BEA Tower, Millennium City 5 418 Kwun Tong Road Kwun Tong, Kowloon HONG KONG Tel: (+852) 2245-6100 Fax: (+852) 2722-1369 Atmel Munich GmbH Business Campus Parkring 4 D-85748 Garching b. Munich GERMANY Tel: (+49) 89-31970-0 Fax: (+49) 89-3194621 Atmel Japan G.K. 16F Shin-Osaki Kangyo Building 1-6-4 Osaki Shinagawa-ku, Tokyo 141-0032 JAPAN Tel: (+81)(3) 6417-0300 Fax: (+81)(3) 6417-0370 2014 Atmel Corporation. All rights reserved. / Rev.: Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, AVR, XMEGA and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. 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 THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, 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 INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND 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 products 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 products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.