How to reprogram the DFU Bootloader for UC3 chips


AVR Dragon connected to Aery32

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:

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:

sudo su

and add deb hardy main to the sources.list. You can edit the sources.list file through nano:

nano /etc/apt/sources.list

After then install avr32program and avr32-gnu-toolchain:

apt-get update
apt-get install avr32program avr32-gnu-toolchain

Now download the UC3 Software Framework 1.7.0:

mkdir Downloads
cd Downloads

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

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 file.

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 make batchisp-update-userdata.

blog comments powered by Disqus