This is an old revision of the document!
The software running in the USB2AX can be updated or changed, to add new functionalities or to tailor its behavior to your application.
You have a new firmware and you want to put it in the USB2AX, Great! There are three ways to do it:
For most people, the Automatic procedure will work nicely. It is supported by the firmwares made by Xevelabs, and relied upon by the automatic firmware update tool.
This update method is supported both for Windows and Linux.
Tested on Win7 64bits.
Tested on Ubuntu 10.10 32bits.
1) Install dfu-programmer >=0.5.4 (as of today, the version in the package repository of Debian is 0.5.1, so build it from sources):
apt-get install libusb-dev #download and uncompress dfu-programmer cd dfu-programmer-<version> ./configure make
The binary is in ./src
Maybe add the user to the uucp group so you don't have to run dfu-programmer as root… but it did not work for me.
2) Run the bootloader using the python script.
3) Run the programmer :
./dfu-programmer atmega32u2 erase ./dfu-programmer atmega32u2 flash USB2AX.hex #/!\: the .hex needs to have UNIX-style end of lines (\n, LF), and will not work with DOS end of lines (\r\n CRLF). ./dfu-programmer atmega32u2 start
Here is an example in Python, the latest revsion of which you can be found in the git repository (usb2ax_run_bootload.py):
import serial bootload_cmd = '\xff\xff\xfd\x02\x08\xf8' ser = serial.Serial("COM7") ser.write(bootload_cmd) ser.close()
The Recovery mode is mostly there as a failsafe: if something goes horribly wrong with the Automatic way or if you want to use a third party firmware, you can always get back to a working state without an additional programmer.
Doing that is normally a two step process : running the bootloader, then uploading the firmware into the flash memory.
The ICSP method allows you to change the bootloader or do away with it, but requires an ISP programmer and some soldering.