uploading a file from the commandline to the arduino (diecimila) works only once, independent if i use tho following command or the Makefile (make upload). After this the next trys are failing until i reconnect the arduino to the usb port.
Hmm... can you add "-v -v -v -v" to the end of the avrdude command line command and post the full output (when it doesn't work)? What sketch are you uploading? Try one that doesn't do any serial communication.
~/devel/source/linslot/avr> /data/devel/arduino-0010/hardware/tools/avrdude -C/data/devel/arduino-0010/hardware/tools/avrdude.conf -pm168 -cstk500v1 -P/dev/ttyUSB0 -b19200 -D -Uflash:w:/net/gate/home/wendel/sketchbook/linslot/applet/linslot.hex -v -v -v -v
avrdude: Version 5.4-arduino, compiled on Oct 22 2007 at 13:15:12
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is "/data/devel/arduino-0010/hardware/tools/avrdude.conf"
User configuration file is "/home/wendel/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: Send: Q [51] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
With the IDE it's always working fine.
A reset of the arduino dosn't help, only a disconnect/connect of the usb cable fix the problem but again only for one upload. The sketch is the same which i can upload with the ide.
Greets
horchi
i can wait (i tested 30 minutes now), it seems not depending on the time.
If i upload a sketch with serial communication the sketch AND the communication are working fine constantly.
The upload problem appears even if i use a sketch without any serial communication.
Weird. I'm not sure really sure what to suggest. You might try the avrdude mailing list. Does it help if you press the reset button on the board before trying to upload for the second time?
Does it help if you press the reset button on the board before trying to upload for the second time?
no reset don't help. The loaded sketch works fine before an after reset but due to the upload issue it don't change anything. I tried avrdude delivered with arduino-0010 and avrdude from the kubuntu package but it doesn't matter
I will have some additional trys like upload with the IDE after uploading from the command line, the try to upload from the command line again, ...
After this i will contact the mailing list.
Hmm, my guess would be that the auto-reset of the Diecimila isn't being triggered by avrdude after the first time. The Arduino IDE explicitly toggles the DTR line before uploading (which resets the board) whereas using avrdude from the command line relies on the fact that the standard Linux driver for the FTDI chip sets DTR when you open the serial connection. It is, however, possible to set a bit on the port (HUPCL) that prevents the line from being reset when you close the connection, meaning that nothing happens to the line when you re-open the connection (i.e. the board doesn't get reset). I don't know why/how HUPCL would be getting set, but it's possible (maybe the FTDI driver for your kernel works differently than the ones I've tried).
Try playing with the timing of the reset vs. the avrdude command. That is, try pressing the reset button a couple seconds before, or just before, or just after, or a couple seconds after (etc.) when you press enter on the avrdude command line.
thanks for this DTR pulse tip! Here is a slightly enhanced version of the Perl code, that automatically determines the serial port from the -P avrdude parameter and calls the avrdude program after the DTR pulse. Rename the original avrdude to avrdude.org and store the Perl script under the name avrdude. Don't forget to make it executable.
Now programming with the Eclipse AVR-plugin always works without any problems. Another advantage: if no Arduino is connected to USB, the script immediately returns with an error (instead of having avrdude waiting for a timeout).
It tries to compile but errors out on core.a? I also have issues compiling anything that has a external module in it. Like the etherShield library. Do I need to move the library files into the applet dir? Or is there some ENV variable I need to set?
/usr/bin/avr-gcc -mmcu=atmega328p -I. -gstabs -DF_CPU=16000000 -I/home/bakers/arduino-0018//hardware/arduino/cores/arduino -Os -Wall -Wstrict-prototypes -std=gnu99 -o applet/Button.elf applet/Button.cpp -L. applet/core.a -lm
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-std=gnu99" is valid for C/ObjC but not for C++
applet/core.a(Print.o):(.data+0x6): undefined reference to `__cxa_pure_virtual'
collect2: ld returned 1 exit status
make: *** [applet/Button.elf] Error 1