User guide
Atmel AVR2054: Serial Bootloader User Guide [APPLICATION NOTE]
8390D−WIRELESS−03/2015
11
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
described in Sections 3.5 and 3.6 is used to ensure proper programming. Figure 3-1 illustrates 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 as described in Sections 3.2-3.4 .
Figure 3-1. Embedded bootloader architecture.
Bootloader
Application image
Load an image over
a serial interface
Program
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 (OTAU) 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.7). RF4CE 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.8.
3.2 Configuration options
Build configuration options for the embedded bootloader such as target MCU and supported feature set (BitCloud OTA
or RF4CE) are defined in the embedded bootloader IDE projects. For compilation with command line such options can
be selected in the Makefile and will also be contained in makefiles present in the
makefiles/ directory.
Application configuration options for embedded bootloader are collected in the
configuration.h file. Using this file it is
possible to configure the following parameters:
• Serial port interfaces enabled for reception of new firmware image from the host. This are defined separately for
each MCU with the
#ifdef sections. For example, enabling only the USART1 port for an Atmel
ATmega128RFA1 MCU is done like this:
#ifdef ATMEGA128RFA1
// Use USART0
#define USE_USART0 0
//#define USE_USART0 1
// Use USART1
//#define USE_USART1 0
#define USE_USART1 1
// Use USB_FIFO










