how are avrdude defaults controlled?

I have a Diecimila with a ATMEGA168-20PU. My host system is Linux, Kubuntu.

I have installed arduino-0018 using the ubuntu packages. When I fire up this version, using the GUI/IDE, (and confirm I have the correct board selected) I can compile sketches but I get an error when I try to download them:

avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.

.. I feel sure that something is going on because, during the download, I can see the tx and rx LEDs flash on my board.

After searching on this forum I also tried a "press shift while clicking download" and I got:

avrdude -v -v -v -v -patmega168 -cstk500v1 -P/dev/ttyUSB0 -b19200 -D -Uflash:w:/tmp/build1334388383774611244.tmp/Blink.cpp.hex:i

(Snip snip)

After a bit more guessing and searching in the forums, I realised that "-cstk500v1" is wrong. I pasted that command to the command line and changed the -c to "-carduino" and it all works fine.

Question: How do I configure the -c (or any other option) to avrdude for download from within the IDE/GUI.. none of the menu options in the IDE/GUI seem appropriate, and I couldn't see anything that looked relevant in the preferences.txt file

thanks,

Neal.

find .../hardware/arduino/boards.txt and change the appropriate "atmega168.upload.protocol=stk500" to "atmega168.upload.protocol=arduino"

(basically, your version of avrdude is too new. They changed the way that avrdude talks to a stk500 (which the arduino emulates a subset of) to use commands that the arduino doesn't support. Fortunately, they left arduino-compatible code in there as well!)

Hi, when we build the Ubuntu package we did not have diecimilia with atmega168 for testing. We tested with - atmega168 on an NG Rev.C board - atmega328p on an NG Rev.C board - Nano V3 with atmega328p - Mega

They all worked with the stk500v1 protocol. I'm not sure right now if I tested the atmega168 on the 64bit install. Are you running a 64-bit Ubuntu? Eberhard

@Westfw → thanks for your response. I will try this and report back

@Wayoda → thanks for the response. In answer to your question, I am using 32-bit OS. Is it possible that the problem is caused by an old bootloader (my board is a couple of years old and I haven’t used it for ages. If so, does the bootloader have a version number (is it the “firmware version” reported by avrdude when it’s being verbose)

BTW, having built the arduino dependencies manually for a previous version, I greatly appreciate the work that you and others have done in providing pre-built packages,

Neal.

Older versions of the bootloader only respond to one of the two possible device signature request commands in the STK500 protocol. The version of avrdude that comes with the Arduino software download uses that one for the "stk500v1" protocol, as do newer versions of avrdude for the "arduino" protocol.

I edited /usr/share/arduino/hardware/arduino/boards.txt to set: diecimila.upload.protocol=arduino

and now everything works fine. I left myself a note to try it back at the original setting if I ever get an ISP programmer and upgrade my bootloader.

thanks for the help

Neal.

I'm a little late to the party, but I had the same problem as @nealc. Ubuntu 9.10 32bit, Arduino Diecimila, arduino software via Ubuntu PPA, "avrdude: Yikes! Invalid device signature", etc.

For whatever reason, the "diecimila.upload.protocol=arduino" trick alone didn't work for me. After modifying the boards.txt file, I got an "avrdude: stk500_getsync(): not in sync" error and still couldn't upload.

I was able to rectify the situation by downgrading avrdude from 5.10-1 (required and provided by the PPA package) to 5.8-1 by finding the avrdude package in Synaptic, going to the Package menu and selecting "Force Version...". From there I chose 5.8, clicked apply, and I was up and running.

To be clear, I still had to leave the "...protocol=arduino" modification in boards.txt. Reverting it to it's original state gave me the "Invalid device signature" error, even after downgrading avrdude.

Thanks for the Ubuntu package, by the way, makes it much easier to move between machines for development.