Uploading sketch fails with "Invalid device signature"

Bug #529444 reported by Matias Korhonen
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Arduino
Fix Released
Medium
Alessio Igor Bogani

Bug Description

I've been trying to upload the Blink sketch to my Arduino Nano (v.2.3 with the ATmega168 chip) on 64-bit Karmic.

Doing this results in an error message which says:

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

This is probably due to the fact that Arduino requires a patched version of AVRDude: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1191580753

"The standard version of avrdude uses a "universal" command to get the device signature, which is not supported by the Arduino bootloader. Arduino comes with a patched version of avrdude that uses the "device signature" command instead, which is supported. You could use that version of avrdude: binaries are included in the Arduino distribution, and the source is at: http://www.arduino.cc/files/avrdude-5.4-arduino-src.tgz. Alternatively, you can force the standard version of avrdude to proceed despite the invalid signature by using the -F option."

Related branches

Revision history for this message
Matias Korhonen (k33l0r) wrote :
Revision history for this message
wayoda (e-fahle) wrote :

The Ubuntu package installs a very recent version of avrdude (5.10) which rules out the explanation given.
Did you go through the troubleshooting page?

http://arduino.cc/en/Guide/Troubleshooting#toc1

Eberhard

Changed in arduino:
assignee: nobody → wayoda (e-fahle)
status: New → Incomplete
Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@Matias Korhonen,

Could you provide the output of these commands, please?
avrdude 2>&1 | grep version
apt-cache policy arduino

Thanks!

Revision history for this message
Matias Korhonen (k33l0r) wrote :

matt@foo:~$ avrdude 2>&1 | grep version
avrdude version 5.10, URL: <http://savannah.nongnu.org/projects/avrdude/>

matt@foo:~$ apt-cache policy arduino
arduino:
  Installed: 0018+dfsg-0ubuntu1~ppa3
  Candidate: 0018+dfsg-0ubuntu1~ppa3
  Version table:
 *** 0018+dfsg-0ubuntu1~ppa3 0
        500 http://ppa.launchpad.net karmic/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
alejandro (laimagendelmundo) wrote :

hi there,

i just downloaded the arduino-0018 PPA and i'm having the same error message : s

i'm running ubuntu karmic and arduino duemilanove (with atmega 168)

my outputs are:
alejandro@alejandro-laptop:~$ avrdude 2>&1 | grep version
avrdude version 5.10, URL: <http://savannah.nongnu.org/projects/avrdude/>

alejandro@alejandro-laptop:~$ apt-cache policy arduino
arduino:
  Installed: 0018+dfsg-0ubuntu1~ppa3
  Candidate: 0018+dfsg-0ubuntu1~ppa3
  Version table:
 *** 0018+dfsg-0ubuntu1~ppa3 0
        500 http://ppa.launchpad.net karmic/main Packages
        100 /var/lib/dpkg/status

--------------------------------------------------------------

Troubleshooting (http://arduino.cc/en/Guide/Troubleshooting#toc23) has an entry related to this error message but i can't seem to find a workaround yet:

"If you get an error like:

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

it can mean one of two things. Either you have the wrong board selected from the Tools > Board menu or you're not using the right version of avrdude. Arduino uses a slightly modified version of avrdude to upload sketches to the Arduino board. The standard version queries for the board's device signature in a way not understood by the bootloader, resulting in this error. Make sure you're using the version of avrdude that comes with Arduino (source code)."

thanks a lot for any advice

Revision history for this message
wayoda (e-fahle) wrote :

I don't have a real solution for this, and I also can't test it really because I don't have a Arduino Diecmeiila or Duemilanove.

What I did try today was to replicate the problem with an old Arduino NG board.

I burned the bootloader for "Arduino Diecimila or Duemilanove with Atmega 168" onto a fresh ATMega168.
I was able to upload the Blink-Sketch without any problems. But this board (NG Rev.C) doesn't have the autoreset feature!
Could you try upload a Sketch with manually reseting the board?
For the Blink sketch it should be good enough to click the upload-button and press the Reset-button on the board at the same time. Timing is a bit tight here, try this a few times if it doesn't work.

The workaround to try would be to change the protocol used by avrdude.
For this you have to edit the file /usr/share/arduino/hardware/arduino/boards.txt (as root!).
Look for the section for your board in the file and change the entry

<your-board>.upload.protocol=stk500
to
<your-board>.upload.protocol=arduino

This is a new option in avrdude 5.10 which AFAIK toggles the autoreset of the board.

Could try this with your boards?

Eberhard

Revision history for this message
alejandro (laimagendelmundo) wrote :

hi eberhard

thanks for your quick reply

i tried pressing the reset button at different times but still doesn't work. the RX TX leds blink for a while and then i get the error message.

i also tried uploading to an old arduino NG with atmega8 which has no auto reset and i get the same thing.

i'll try this afternoon to change the averdude protocol and see what happens. i'll put my results here

bye bye

alejandro

Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@Eberhard,

Right now I'm using Duemilanove with ATmega328 on Ubuntu Karmic amd64 and Arduino package provided through PPA: ti works perfectly!

I'm suspecting that the avrdude shipped with Arduino tarball contains some additional patches.

@alejandro, @Matias Korhonen: Could you test the Arduino tarball released on Arduino website (which should be still contained the modified version of avrdude)?

Alessio

Revision history for this message
Matias Korhonen (k33l0r) wrote :

Just tested the Arduino tarball from arduino.cc. Uploaded Blink to my Nano without any problems.

Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@Eberhard,

The Comment #9 seems confirm that the avrdude shipped with Arduino tarball contains additional patches that upstream avrdude don't contains _or_ that old Arduino Duemilanove and Nano (both with Atmega 168) don't work with a more recent version fo avrdude.

In any case Alejandro and Matias incur in this issue so I mark this bug as confirmed and to low priority (at least for the moment).

Changed in arduino:
status: Incomplete → Confirmed
Revision history for this message
alejandro (laimagendelmundo) wrote :

i just finished testing the tarball, it also works very well for me

thanks!

alejandro

Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@alejandro,

Do you already test the alternative avrdude programmer type as requested by Eberhard in comment #6?

Thanks a lot!

Revision history for this message
alejandro (laimagendelmundo) wrote :

hi,

i didn't test that option, doing it right now ...

changing boards.txt file...

testing with duemilanove (atmega 168)...

hum.. it doesn't work but i get a different error message:

avrdude: stk500_recv(): programmer is not responding

: - S

----------

test # 2: i will try reseting the board manually...

it works!

this is interesting

alejandro

Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@alejandro, @Matias Korhonen:

Could you do this (I hope) last test:

1) Install this modified avrdude https://launchpad.net/~abogani/+archive/broken/+files/avrdude_5.10-1ubuntu1_amd64.deb or https://launchpad.net/~abogani/+archive/broken/+files/avrdude_5.10-1ubuntu1_i386.deb
2) Change boards.txt, like you have already done, with arduino programmer type (instructions are in comment #6)
3) Try to programming Arduino again (please close and re-open the IDE before)

Thanks for your invaluable help in try to figure out this bug!

Please let me know!

Revision history for this message
alejandro (laimagendelmundo) wrote :

hi alessio,

i installed the new avrdude

and it works very well on the duemilanove (with atmega168) now

----------

testing the NG...

but now i'm getting the error message on this board:

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

this is puzzling

alejandro

Revision history for this message
alejandro (laimagendelmundo) wrote :

i just changed boards.txt for the NG in the same way i did for the duemilanove and now both work!!!!

yeah!!

Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@alejandro

Thanks!

@Matias Korhonen,

Could you do the test (comment #14) and verify, as original bug reporter, that the fix works for you too?
Thanks!

Changed in arduino:
assignee: wayoda (e-fahle) → Alessio Igor Bogani (abogani)
Changed in arduino:
importance: Undecided → Low
Revision history for this message
Alessio Igor Bogani (abogani) wrote :

@Matias Korhonen,

Sorry to bother you.

Could you do the test (comment #14) and verify, as original bug reporter, that the fix works for you too?

Thanks!

Revision history for this message
Matias Korhonen (k33l0r) wrote :

Sorry for the delay; it's been busy...

I just confirmed that the fix does indeed work for me too.

Thanks a bunch!

Changed in arduino:
status: Confirmed → In Progress
Changed in arduino:
importance: Low → Medium
Changed in arduino:
status: In Progress → Fix Committed
Changed in arduino:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.