User guide
Atmel AVR2054: Serial Bootloader User Guide [APPLICATION NOTE]
8390D−WIRELESS−03/2015
12
#define USE_USB_FIFO 0
//#define USE_USB_FIFO 1
// Use TWI
#define USE_TWIS 0
//#define USE_TWIS 1
#ifdef USE_TWIS
// Use TWID
//#define USE_TWIS_D 0
#define USE_TWIS_D 1
#endif
#endif //#ifdef ATMEGA128RFA1
• External flash device used to store the application image during an over-the-air upgrade procedure. This is done
via TYPE_EXTERNAL_MEMORY parameter and is applicable only to configurations with BitCloud OTA feature
enabled. For an overview of BitCloud OTA bootloader and more references see Section 3.7.
3.3 Compiling embedded bootloader application
The bootloader application can be compiled with Atmel Studio [6] or IAR [7] toolchains of versions given in Table 3-1.
For convenience the bootloader package includes precompiled .hex images of the embedded bootloader in most
common configurations as described in Section 1.3.2.
Table 3-1. Supported toolchains and their versions
Toolchain Comments
Atmel Studio v6.2 (with GCC compiler) For AVR and Xmega devices only
IAR for AVR v6.40 For AVR and Xmega devices
IAR for ARM
®
v6.20.3.52642 For SAM devices
To compile the bootloader application in Atmel Studio, open witht the Atmel Studio the .atsln project file that
corresponds to the target platform and feature set from the \
Embedded_Bootloader_src\as6_projects directory.
Then choose a particular build configuration from the list on the toolbar, and select
Build form the Build menu.
To compile the bootloader application in IAR IDE, open with corresponding IAR toolchain the .eww project file from the
\
Embedded_Bootloader_src\iar_projects directory. Then choose a particular build configuration that corresponds
to the target platform and feature set and select
Rebuild All form the Project menu.
3.3.2 Compilation from the command line
When the embedded application is compiled using the command line, compilation employs Makefile placed in the
\
Embedded_Bootloader_src\ folder to determine what makefile from the makefiles directory shall be used. In
Makefile, specify
PROJECT_NAME to choose among supported MCUs and CONFIG_NAME to select a particular
configuration.
3.4 Programming embedded bootstrap
If not already present on the MCU the firmware part of embedded bootloader (.hex file) shall be uploaded to the device
to enable programming over serial interface. Atmel Studio [6] is recommended for loading an embedded bootloader
image. Note that to work correctly embedded bootloader requires specific fuse bit settings that depend on the target
platform and bootloader functionality (see Section 2.2 Fuse bits settings).










