It's a bit of an annoyance to first have to press a combination of two buttons on my at90usb162 board, then run a sequence of 4 dfu-programmer commands.

Thanks to the magic of the freedesktop 'hal', though, I've written a program that waits for the dfu device to appear. It then erases and flashes the device, finally restarting into the newly uploaded firmware.

Modify the program to name your .hex file (and avr partnumber if it's different), then leave it running in the background. It's still necessary to tickle the RESET and HWB buttons in the proper way after rebuilding your firmware, but it does shorten the process.

Files currently attached to this page:

autoprogram.py1.5kB