Sometimes it happens that you have accidently erased the DFU Bootloader from your board; or either you want to change the Bootloader to the previous version or update to the newer one. AVR32784 describes the UC3 DFU Bootloader and how to reprogram it. The document mentions the
avr32program command line tool that can be used to do the job. However, it is not obvious where to get that. Neither it has been delivered with the standalone AVR Toolchain nor with the latest Atmel Studio 6. Though, Studio 6 includes a new tool called
atprogram, it is not clear if it can be used for reprogramming the Bootloader. If someone knows better, please leave a comment.
Reprogramming the Bootloader is not the simplest task
You will need these:
- Ubuntu Hardy Heron – as fas as I know the
avr32programworks only on Ubuntu and only in this version
- AVR UC3 Software Framework 1.7.0 – this is where the Bootloader binaries can be found
- JTAG programmer – AVR Dragon has been used here
The easiest way to install Ubuntu Hardy Heron is most probably using virtualization software, for example Oracle's VirtualBox.
When you have logged in Hardy Heron change to the root:
deb http://distribute.atmel.no/tools/avr32/release/ubuntu hardy main to the
sources.list. You can edit the
sources.list file through nano:
After then install
apt-get update apt-get install avr32program avr32-gnu-toolchain
Now download the UC3 Software Framework 1.7.0:
mkdir Downloads cd Downloads wget http://www.atmel.com/Images/AVR-UC3-SoftwareFramework-1.7.0.zip unzip AVR-UC3-SoftwareFramework-1.7.0.zip
The Bootloader binaries (for UC3A) can be found from the
1.7.0-AT32UC3/SERVICES/USB/CLASS/DFU/EXAMPLES/ISP/AT32UC3A/Releases/ directory. For Aery32 Development board I chose 1.0.3. Its newer than what comes with the board (UC3As are shipped with the version 1.0.2).
Connect the AVR Dragon to the board via JTAG interface. If you are on native Linux, you can run the shell script that performs all the steps for you
cd AT32UC3A-ISP-1.0.3/ chmod u+x program_at32uc3a-isp-1.0.3.sh ./program_at32uc3a-isp-1.0.3.sh
Otherwise, if you are on VirtualBox you have to do all the steps manually, because VirtualBox detaches AVR Dragon from it after every accomplished USB task. To reattach the Dragon to the VM, right click the USB cable icon from the lower right hand side bar and run the next command from
Important! After reprogramming the Bootloader of the Aery32 Development board, you have to reprogram the user page for DFU switch. In Windows this can be done by calling