Fix your Arduino Uno for Linux

Are you using an Arduino Uno on Linux? If so, you may have noticed that writing to the serial port in a loop can cause the Arduino Editor/Programmer software to appear to lock up, or even Linux having trouble using the serial port for your Uno.

It turns out there was a bug in the USB->Serial firmware on the chip which caused this [1], and it is quite easy to update your arduino to fix it. According to the author of the USB->Serial firmware, it is not possible to break your Arduino permenantly doing this [1], but I can’t promise anything (though it worked fine for me and others)

From https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/arduino-usbserial/ download your hex file for your board, i.e. either Arduino-usbserial-mega.hex or Arduino-usbserial-uno.hex. As it is github, click on the file in the list then right click on “raw” and click “Save as“.

The md5sum of the Arduino Uno file from the 4th December is 8e01ee236e70bbea43f7eb4e11c9688a

You will need the dfu programmer tools, which are conveniently in Lucid/Universe, so just run

sudo aptitude install dfu-programmer

You need to do a hardware-reset to put the chip into the correct DFU programming mode, which is simply best explained with the picture at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838/10#10 (you will need to register on the arduino site to login, but a picture speaks a thousand words)

The Uno’s use a AT90USB82 serial-usb chip, so we then reflash the firmware with the following commands

sudo dfu-programmer at90usb82 erase
sudo dfu-programmer at90usb82 flash --debug 1 Arduino-usbserial-uno.hex
sudo dfu-programmer at90usb82 reset

Finally, just disconnect the USB lead and reconnect to reset the device back to normal mode.

Done – You no longer have to worry about writing to your serial port on your Arduino.

References:
[1] http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/38#38 – Author of Arduino USB stack talks about
[2] http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/34#34 – First person to find fix and author of instructions that these are heavily based on

About Anton Piatek

Professional bit herder, amateur photographer. Linux and tech geek
This entry was posted in Arduino, Linux, Programming, Ubuntu and tagged , , , . Bookmark the permalink.

5 Responses to Fix your Arduino Uno for Linux

  1. Pingback: Arduino 0021 on openSuSE 11.2

  2. jason says:

    would you be able to post the meat of the ‘dfu mode’ post from the arduino forum? apparently, they’re not taking new registrations there, and everything i’ve found on this topic links there…

    thanks…

  3. jason says:

    follow-up…

    just found it on scribd:
    http://www.scribd.com/doc/45913857/Arduino-UNO

  4. Pingback: Arduino Uno und Linux | bits and pieces

  5. Anton Piatek says:

    I havent had to do this with newer arduinos so must be fixed

Leave a Reply