Go Down

Topic: trouble uploading outside of the IDE (w/ Makefile) (Read 3139 times) previous topic - next topic


I'm trying to use the Arduino Makefile (http://www.arduino.cc/en/uploads/Hacking/Makefile) to upload to my board outside the context of the IDE and ran into some troubles. I got to the point where make works and make upload runs the avrdude command, but it just hangs there without finishing or successfully uploading.

Some history of my struggle might be useful for debugging my situation (and, possibly, improving the instructions in the Makefile): After following the instructions at the top of the file (inserting my serial port, etc.), make failed with this error:

make: avr-g++: Command not found

I had to add <path to arduino-0007 root>/tools/avr/bin to my $PATH in order to get it to successfully compile.

Next, I tried to run make upload and again hit a path problem:

avrdude: can't open config file "/opt/avr/etc/avrdude.conf": No such file or directory

After some searching, I discovered that I needed to add the following to the AVRDUDE_FLAGS line of the makefile:

-C <path to arduino-0007 root>/tools/avr/etc/avrdude.conf

At that point, the avrdude command runs...and hangs. The command getting run looks like this:

avrdude -F -p atmega8 -P /dev/tty.usbserial-A3000WS0 -C /Applications/arduino/arduino-0007/tools/avr/etc/avrdude.conf -c stk500 -b 19200 -U flash:w:my_sketch.hex

My Arduino board's orange light flashes when I hit the reset button before executing the make upload command, but after awhile of nothing happening on the computer end, the board just goes back to executing the previous loop that was flashed onto it.

I'm working on PPC Mac running 10.4.9 and I've goot version 0007 of the Arduino software installed.

Thanks for your help!


Are you able to upload to the board using the Arduino IDE?


mellis -- Yeah, I can upload with the IDE no problem.


What if you try upload from the command line using uisp?  You can get the command line by setting upload.verbose to true in your Arduino preferences file (whose location you can find in the preferences dialog - but only edit the file when Arduino isn't running).


That totally did the trick! After I translated the path, the command that worked turned out to be:

<path to my arduino-0007 root>/tools/avr/bin/uisp -v=4 -dpart=atmega8 -dprog=stk500 -dserial=/dev/tty.usbserial-A3000WS0 -dspeed=19200 --upload if=<path to my_sketch.hex>


I don't really need it at this point since I can upload fine now, but does this tell you anything about my avrdude problems? Just looking to sate my curiousity/improve my technical knowledge...


That's really strange.  I wonder if the problem is just that the version of avrdude that comes with Arduino is too old.  Would you mind trying it with the avrdude at http://www.arduino.cc/files/avrdude-5.4-mellis-mac-intel.zip?  We're hoping to switch from uisp to avrdude in the next release of the Arduino environment, and the more testing we can do, the better.


Trying make upload with that new avrdude, I get the following error:

"<path to new avrdude>: cannot execute binary file"

Is it maybe because that was the intel binary while I'm on PPC?


Ah, damn, yea.  Let me upload the PPC version.  


Go Up