User guide

Atmel AVR2054: Serial Bootloader User Guide [APPLICATION NOTE]
8390DWIRELESS03/2015
18
4. Bootloader PC tool
The Bootloader PC tool is a PC application that is used to load a firmware image to a device programmed with the
embedded bootloader code. Connection to the MCU shall be enumerated as a COM or USB port depending on the
interface used. Source firmware images shall be in the Motorola S-record (SREC) format. Such images are created
during compilation further to .hex and .elf images. A device must be pre-programmed with an image of the embedded
bootloader application, which will receive data sent by the Bootloader PC tool and write it to the device’s flash.
Another use of the Bootloader PC tool is initiating Over-the-Air Upgrade. This document does not cover this usage of the
tool for this purpose. A complete guide to Over-the-Air Upgrade of ZigBee networks is given in [8].
4.1 Using the Bootloader PC tool
To install the Bootloader PC tool, launch the installation file from the \PC_Bootloader_Setup\ and proceed with
instructions. After setup is completed both GUI and console versions of the bootloader are extracted to the provided
installation path. The Bootloader PC tool is a Java application, and to launch it Java [14] must be installed on the host
PC.
As a firmware image the Bootloader PC tool requires a file in the Motorola S-record hexadecimal format, also known as
SREC or S19 format. Such file names have the .srec extension and can contain both flash memory and EEPROM
images.
4.1.1 Generating SREC images
4.1.1.1
Using GCC tools
An SREC image can be generated from initial binary image with the help of a special tool supplied with a tool chain.
For Atmel AVR use avr-objcopy.exe tool provided in AVR toolchain for Atmel Studio 6
For ARM use arm-elf-objcopy.exe tool, which is a part of the Yagarto GCC toolchain
For example, to generate an SREC image from a .hex image for AVR run a command in the following format from the
command line:
avr-objcopy.exe -O srec --srec-len 128 <srcFile> <destFile>
For ARM just replace the name of the AVR tool with
arm-elf-objcopy.exe. Note that this tool takes an image in the
.elf format as input.
4.1.1.2 Using IAR tools
If you use IAR toolchain to compile applications you may also specify a directive for the linker to create an SREC image:
For command line compilation add -Omotorola-s28=<path>/<fileName>.srec to the linker flags
For IAR Embedded Workbench
Open configuration’s options and go to
Linker
On the
Extra Output tab check the Generate extra output file box, specify the image name and
select
motorola-s28 as Output format
An image generated by the IAR compiler may be also converted to SREC format with the
avr-objcopy.exe or arm-
elf-objcopy.exe.