Sunday, September 20, 2009

Fixing arduino upload problem on linux

Symptom: the arduino IDE will upload your sketch no problem, but using avrdude raw only works the first time. Pulling the USB cable out and plugging back allows it to upload again (once).

Solution: (from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1201441300): it seems to be a problem w/ the linux driver. Just insert "stty -F $(PORT) hupcl" right before the avrdude command (where PORT = the usb device such as "/dev/ttyUSB0"). E.g. in the Makefil:

stty -F $(PORT) hupcl
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
You may also have to set your baud rate to 57600 (at least for the 328p).

It's such a relief to not have to use their IDE! Point+click to edit was driving me nuts.

No comments:

Post a Comment