12
32166A–AVR32806–06/11
Atmel AVR32806
7. Using the boot loader
7.1 Reprogramming the boot loader
By default, all parts are shipped with the boot loader, and so there is no need to program it
except if it has been erased with a hardware debugger (such as
) using a JTAG chip erase command (
avr32program chiperase
) or if the user
wants to program a previous version.
If the
avr32program
commands are not accessible through a DOS command, install Atmel
AVR32 Studio 2.7.
Any of the released boot loaders can be programmed while the part is connected to a hardware
debugger through its JTAG interface. The avr32806.zip file enclosed with the application note
delivers the binary of the boot loader under the
/releases/at32uc3x/
folder. The binary of the
released ISP is an
at32uc3x-isp-x.x.x.hex
file, which can be programmed under a Windows
command shell using the
program_at32uc3x-isp-x.x.x.cmd
script. For example, to program ver-
sion 1.1.4 of the Atmel AVR UC3 C USB DFU boot loader, simply execute
./program_at32uc3c-
isp-1.1.4.cmd
in the
releases/at32uc3c01/
folder.
The steps performed by the programming scripts (for version 1.1.4 of the AVR UC3 C ISP) are:
•
Issue a JTAG chip erase command to make sure the part is unprotected and free to use:
avr32program chiperase -F
•
Program the boot loader:
avr32program program -finternal@0x80000000 -cint -e -v -O0x80000000 -Fbin at32uc3c-
isp-1.1.4.bin
•
Program the boot loader configuration words in the user page:
avr32program program -finternal@0x80000000 -cint -e -v -O0x808001F8(1) -Fbin
at32uc3c-isp_cfg-1.1.2.bin
Note:
See
for a description of how to generate such a .bin file from two customized configu-
ration words.
Note:
•
Write the general purpose fuses with their default value used by the ISP:
avr32program writefuses -finternal@0x80000000 gp=0xF877FFFF
7.2 Activating the ISP
The ISP is activated according to the boot process conditions described in
ISP activation can be requested in one of the following ways:
•
External point of view: Reset the part, and make sure the configured hardware conditions
are true when reset is released. By default, the hardware condition is to press the PB0 push
button on the
, and so the user simply has to keep PB0 pressed while
releasing the reset push button
•
Internal point of view: The programmed application can launch the ISP by setting the
ISP_FORCE configuration bit to one (and, therefore, updating the whole Configuration
Word1). The next execution of the reset vector will then systematically launch the ISP.
To
launch the boot process from the application, the reset vector should be reached by
using the watchdog timer reset rather than a software jump or call to 80000000h. In
the latter case, unexpected behavior could occur because the MCU reset causes are
not updated and MCU peripherals may still be active
Once the ISP is activated, it establishes USB communication with the connected PC. This may
take a few seconds while the auto-baud feature uses the USB start-of-frame packets to deter-
Содержание AT32UC3C0128C
Страница 36: ...36 32166A AVR32806 06 11 Atmel AVR32806...