background image

 

 

 

 

AVR1605: XMEGA™ Boot Loader Quick Start 

Guide 

Features 

• 

XMEGA boot loader 

• 

AVROSP compatible 

• 

Example application 

• 

C-code sample application for Self Programming 

• 

Read and Write Both Flash and EEPROM Memories 

• 

Read and Write Lock Bits 

• 

Read Fuse Bits 

1 Introduction 

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. The 
sample application communicates via the UART with a PC running the AVR Open 
Source Programmer (AVROSP) from Application note AVR911. This enables the 
user to download Applications into Flash, Data to EEPROM and to read/write fuses 
without the need for an external programmer. The example software is using the 
ATxmega128A1 device with STK

®

600 as a target board. 

Electronic designs including a microcontroller always need to be equipped with a 
firmware, be it a portable music player, a hairdryer or a sewing machine. As many 
Electronic designs evolve rapidly there is a growing need for being able to update 
Products, which have already been shipped or sold. It may prove difficult to make 
changes to the hardware, especially if the product has already reached the end 
customer. But the firmware can easily be updated on products based on Flash 
microcontrollers, such as the AVR family. 

Many AVR microcontrollers are configured such that it is possible to create a boot 
loader able to receive firmware updates and to reprogram the Flash memory on 
demand. The program memory space is divided in two sections: the Boot loader 
Section (BLS) and the Application Section. A Boot Loader program is placed inside 
the Boot Section of the Flash memory. This program handles communication with 
the host PC, and facilitates programming of both Flash and EEPROM. Once 
programmed, different levels of protection can be individually applied to both the 
boot and application portion of the Flash memory. The AVR thus offers a unique 
flexibility, allowing the user extensive degrees of memory protection. 
 
For general information about self programming please refer to application note 
AVR109: Self programming. 
 

 

 

 

 

 

8-bit  

 

Microcontrollers 

 

Application Note 
 
 
Preliminary 

Rev. 8242A-AVR-05/09 

Summary of Contents for AVR1605

Page 1: ...designs evolve rapidly there is a growing need for being able to update Products which have already been shipped or sold It may prove difficult to make changes to the hardware especially if the produc...

Page 2: ...2 AVR1605 8242A AVR 05 09 Figure 1 1 Purpose of Bootloader...

Page 3: ...rts marked CAN Male Type and RS232 Female Type Connect a serial cable between the PC and the RS232 Female Type port of STK600 On STK600 connect the PD4 pin to the SW0 pin to use micro switch SW0 to en...

Page 4: ...4 AVR1605 8242A AVR 05 09 Figure 2 2 1 PATH Configuration 1 Figure 2 2 2 PATH Configuration 2...

Page 5: ...dio and run the application while keeping SW0 pressed on the STK600 Check the LED status of the Tool In Programming mode the program receives commands from AVROSP via the UART Each command executes an...

Page 6: ...he device wait in bootloader section are done Press both External RESET and SW0 on STK600 and release the RESET first and then the SW0 In the current working folder double click run the batch program...

Page 7: ...e batch file x128A1_flash_write_file bat The batch file runs the following command to program and verify the flash memory AVROSP dATxmega128A1 e ifflash hex pf vf Table 3 2 1 Command Description Comma...

Page 8: ...ging session will perform a chip erase Now the application will wait for the letter E through USART0 To verify the application that was downloaded to the flash in the previous chapter we must write th...

Page 9: ...ader 3 4 Write a file to EEPROM Ensure that the steps to make the device wait in bootloader section are done Press both External RESET and SW0 buttons on STK600 and release the RESET first and then th...

Page 10: ...er section are done Press both External RESET and SW0 buttons on STK600 and release the RESET first and then the SW0 Run the batch file x128A1_eeprom_dump bat which has the AVROSP command given below...

Page 11: ...a tool for generating documentation from source code by analyzing the source code and using special keywords For more details about Doxygen please visit http www doxygen org Precompiled Doxygen docume...

Page 12: ...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...

Reviews: