keeping the atusb firmware up to date (general)

Werner Almesberger werner at almesberger.net
Wed May 11 20:12:48 EDT 2011


In the previous two mails [1, 2], I described how to load the firmware
(boot loader and application) into an atusb for the first time. This
is usually done when the device is manufactured or by a developer who
wishes to modify the boot loader.

All other users (end users, but also developers modifying the atusb
application) should never need to replace the boot loader. Yet, they
may want to update the application. For this, the process outlined in
this mail should be used.


Background: the atusb firmware consists of a DFU-capable boot loader
and the actual application. It is the application that moves data
between USB and the RF chip.

When atusb is powered up, it first runs the boot loader. The boot
loader has its own USB stack and enumerates as a device supporting
the USB Device Firmware Upgrade (DFU) protocol. [3]

Then the boot loader accepts DFU commands for 2 seconds. If no DFU
commands are sent in this period, the boot loader resets the USB
bus and starts the application. While waiting, the boot loader
lights the LED of the atusb board.


To update the application, you need:

- Hardware

  - a atusb board (with boot loader)
  - a PC running Linux with an available USB port

- Software

  - dfu-util, running on the PC
  - the atusb application (firmware) binary

Instructions for obtaining dfu-util and the atusb application can be
found in [2].


To update the application, perform these steps:

- remove atusb from the Linux PC

- prepare to run the following command:

  dfu-util -d 20b7:1540 -D atusb.bin

- plug atusb into the PC

- wait about one second to give the PC's USB stack time to enumerate
  the new device

- run the dfu-util command above

dfu-util should run for about 1-2 seconds, showing a progress bar, and
then report success. The LED stays lit while dfu-util runs. Once
dfu-util finishes, the boot loader waits two more seconds, then turns
off the LED and starts the application.

If dfu-util reports an error, you may have missed the right moment to
start dfu-util. Unplug atusb and try again.

Note that this process works always, no matter in which condition the
application is. E.g., if you've loaded a defective application that
"bricks" the atusb, you can still replace it following this procedure.

In the next mail, I'll describe a more sophisticated process for
updating the atusb application.

[1] http://lists.en.qi-hardware.com/pipermail/discussion/2011-May/008004.html
[2] http://lists.en.qi-hardware.com/pipermail/discussion/2011-May/008005.html
[3] http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

- Werner




More information about the discussion mailing list


interactive