Atmel AVR2054: Serial Bootloader User Guide Features • • • • • Description of serial bootloader Hardware configuration instructions Embedded bootloader description Instructions on how to use the Bootloader PC tool Creating SREC images 8-bit Atmel Microcontrollers Introduction The serial bootloader is a stand-alone package consisting of two parts: embedded bootloader that should be loaded to the flash memory of a supported MCU and the PC based application that sends data to the embedded bootloader over se
1 Overview The serial bootloader allows loading of firmware images to devices from a PC application over the serial connection. It is intended for use with Atmel® wireless stacks, such as IEEE® 802.15.4 MAC, RF4CE, BitCloud® and BitCloud Profile Suite, but can also be used with non-wireless applications. An application image is received and written to the flash by embedded bootloader, which must be programmed to the devices beforehand.
Atmel AVR2054 Table 1-1. Supported MCUs and corresponding boards and modules. MCU (Atmel) Supported modules (Atmel) Development board/kit ATmega1281 ATmega2561 ATZB-24-B0 ATZB-24-A2 ATZB-A24-UFL ATZB-900-B0 MeshBean, (1) RCB230/231/212 N/A ATRF4CE-EK (RCB128RFA1 mounted on RCB Key Remote Control board, RCB Sensor Terminal Board or RCB-BB), ATAVR128RFA1-EK1 ATxmega256A3 ATxmega256D3 N/A Atmel STK®600, REB2xxED-EK AT91SAM3S4C N/A deRFusb-23E00 (1) ATmega128RFA1 Notes: 1.
NOTE Path Description \Embedded_Bootloader_src\as5_projects\ Atmel AVR Studio 5 project and solution files for the embedded bootloader \Embedded_Bootloader_src\makefiles\ Makefiles for compiling the embedded bootloader with IAR or GCC compiler from the command line or from AVR Studio 4 and 5 \PC_Bootloader_Setup\ Installation files for the Bootloader PC tool \Documentation\ Documentation folder There are three types of embedded bootloader firmware distinguished by their functionality: common boot
Atmel AVR2054 2.1 Serial interface Table 2-1 describes default serial interfaces used by the embedded bootloader to upload firmware images. The interface settings may be changed in the configuration.h file of the embedded bootloader application (see Section 3.3). Table 2-1. Default serial port settings for embedded bootloader.
Option Common bootloader OTAU bootloader for Atmel BitCloud applications Bootloader for RF4CE applications Boot Flash size=2048 words start address=$F800 Boot Flash size=2048 words start address=$F800 BOOTSZ Boot Flash size=1024 words start address=$F C00 BOOTRST Enabled Enabled Enabled CKDIV8 Enabled Enabled Enabled CKOUT Disabled Disabled Disabled SUT_CKSE L Int. RC osc.; Start-up time: 6 CK + 65ms Int. RC osc.; Start-up time: 6 CK + 65ms Int. RC osc.
Atmel AVR2054 Option Required value FUSEBYTE2 0xBF FUSEBYTE4 0xFE FUSEBYTE5 0xFF 3 Embedded bootloader Embedded bootloader occupies a little amount of memory and serves the only purpose, to load an application image from a serial interface and write it to the MCU’s internal flash and/or EEPROM. A simple communication protocol is used to ensure proper programming. Figure 3-1 illustrates bootloader organization.
3. For every valid SREC record the embedded bootloader responds with an ACK data sequence over the serial interface. 4. In case of any error during loading process, the embedded bootloader sends a NACK data sequence, then proceeds to (1). On the PC side, the Bootloader PC tool performs the following actions: 1. The Bootloader PC tool sends a HANDSHAKE_REQ data sequence for 30 seconds with 200ms interval, waiting for a HANDSHAKE_CONF data sequence between transmissions.
Atmel AVR2054 Figure 3-2. Serial bootloader programming algorithm. 3.2 Bootloader USB DFU specifics The embedded bootloader for Atmel SAM3S microcontrollers operates in a different way than shown in Figure 3-2 to conform to certain features of the SAM3S microcontroller and development boards, on which it is hosted. Embedded bootloader for SAM3S uses Device Firmware Upgrade (DFU) standard. A DFU component should be included in the application (see Section 3.2.2.1).
3.2.1 Changing the reset vector The Atmel SAM3S MCU does not contain a special bootloader section in the flash memory1. The fuse settings do not indicate whether to start execution from the application section or from the bootloader section and where this section starts.
Atmel AVR2054 when the DFU component is installed, it may stop responding due to application failure. In these cases the device will not be able to process commands from the PC tool and thus initiate reset and perform the firmware upgrade. To load an image using bootloader into such device, connect JTAG’s PB7 pin to ground and reset the device. On an Atmel SAM3S USB stick, these are the first two pins of the JTAG port and so can be connected with a jumper wire. 3.2.2.
3.3.1 Compiler versions The supported IAR compilers are IAR C/C++ Compiler for AVR v5.51.0.50312 and IAR C/C++ Compiler for ARM® v6.20.3.52642. The supported Windows® AVR GCC (WinAVR) version is 20100110, but it is recommended to use the latest GCC compiler provided with Atmel AVR Studio 5. 3.3.
Atmel AVR2054 Figure 3-3. OTAU embedded bootloader architecture. Over-the-Air Upgrade usually requires a special device that will distribute the application image through the network. To start an upgrade, such device must be connected to a PC with the Bootloader PC tool installed. The Bootloader PC tool contains the OTAU tab, which is used to initiate and control an upgrade. For further details on the topic of OTAU refer to [3]. 3.
Another use of the Bootloader PC tool is initiating Over-the-Air Upgrade. This document does not cover this usage of the tool. A complete guide to Over-the-Air Upgrade of ZigBee networks is given in [3]. 4.1 Using the Bootloader PC tool To install the Bootloader PC tool, launch the installation file and proceed with instructions. After setup is completed both GUI and console versions of the bootloader are extracted to the provided installation path.
Atmel AVR2054 4.1.2 Programming a device To program a wireless device using serial bootloader the following steps shall be done: 1. Connect a device with the embedded bootloader firmware on it to a PC via serial connection. For detail refer to documentation of the development kit or the software provided with it. 2. For the GUI version of serial bootloader run the application by double-clicking the bootloadergui.exe file.
Figure 4-1. The Bootloader PC tool main window. 4.1.3 Using the command line The console version of the Bootloader PC tool accepts the following command-line options (can be entered in any order): bootloader –f –p For example, can be set to COM3 to establish connection with the device via the COM3 port. Besides, when the -e option is specified the EEPROM section is cleared.
Atmel AVR2054 5 References [1] Atmel AVR Studio User Guide. Available in HTML Help with the product. [2] JTAGICE mkII Quick Start Guide [3] AVR2058; BitCloud OTAU User Guide; Application Note; Rev. 8426A-AVR08/11; Atmel Corporation [4] AVR2102; RF4Control - User Guide; Application Note; Rev.
6 Table of contents Features ............................................................................................... 1 Introduction ......................................................................................... 1 1 Overview ........................................................................................... 2 1.1 Supported platforms ............................................................................................ 2 1.2 Contents and structure .............................
Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131 USA Tel: (+1)(408) 441-0311 Fax: (+1)(408) 487-2600 www.atmel.com Atmel Asia Limited Unit 01-5 & 16, 19F BEA Tower, Milennium 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 9F, Tonetsu Shinkawa Bldg.