This chapter describes the setup procedure from creating an example project based on
firmware pack to running a bootloader demo.
In the following, Atmel Studio is taken as an example to describe the setup
procedure.
- Download the example firmware
package for Atmel Studio from Atmel | START.
- Create firmware project with the firmware package in Atmel Studio (7 or
higher).
- Set linker options and
pre-defined symbles for the project in Atmel Studio.
On the
project property window, trace ToolChain--AVR/GNU Linker--Miscellaneous, and
add the following
line:
-Wl,--relax -Wl,--section-start=.mysection=0x1E000 -Wl,--section-start=.text=0x20000
Trace
ToolChain--AVR/GNU C Compiler--Symbols, and add the following
symbols:BOARD=XMEGA_A1U_XPLAINED_PRO
IOPORT_XMEGA_COMPAT
SD_MMC_ENABLE
- Build the firmware and generate a
bootloader image file (.elf, .hex, etc).
- Connect the I/O1 Xplained Pro
board to the XMEGA A1U Xplained Pro board at EXT1 connector, and connect the
latter to the PC by the EDBG USB port on the board.
- Program the fuse bit BOOTRST,
which makes the XMEGA A1U run from the bootloader section.
- Program bootloader image into the
flash memory.
- Store test.bin to the SD card,
and mount the card on the I/O1 Xplained Pro board.
- If SW0 is pressed after reset or
no application firmware in application flash section, the boot mode is
triggered. It will try to find an SD card and re-program the application section
with the test.bin file in the SD card.