User guide

Atmel AVR2054
7
8390B-AVR-12/11
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 illu
strates bootloader organization.
The embedded bootloader application is provided as a set of pre-compiled firmware
images for various configurations and the source code. The user can immediately
start using boot loading by programming devices with the pre-compiled images. It is
also possible to modify the source code of the embedded bootstrap and compile it
using the appropriate toolchain.
Figure 3-1. Embedded bootloader architecture.
In addition to the common bootloader that simply programs application firmware to
the flash and EEPROM, embedded bootloader application may be built to support
additional features like Over-the-Air upgrade applied by BitCloud applications or
RF4CE features. The OTAU bootloader is able to load an application image, which
has been received by the application over the air and saved in an external memory
device, and program it into the internal flash memory (see Section 3.5). RF4
CE
features are invoked by the application to enable a special type of the Over-the-Air
upgrade when the application image is replaced in memory simultaneously with
reception of the new image. For detail refer to Section 3.6.
3.1 Bootloader UART/SPI programming sequence
The embedded bootloader may process data received in the SREC format, using the
following algorithm:
1. After the device is reset, the embedded bootloader waits 200ms for each
configured interface for a HANDSHAKE_REQ data sequence to arrive via the
serial interface. If no HANDSHAKE_REQ is received, the embedded bootloader
jumps to the application’s entry point in the flash memory.
2. If a HANDSHAKE_REQ sequence is received, bootstrap code sends a
HANDSHAKE_CONF sequence over the serial interface and starts receiving
SREC records one by one.