Pages: [1]   Go Down
Author Topic: trouble uploading outside of the IDE (w/ Makefile)  (Read 1280 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>

Thanks!

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...
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any luck uploading the PPC version?
Logged

Pages: [1]   Go Up
Jump to: