Pages: [1]   Go Down
Author Topic: avrdude 5.10, Arduino Uno, Invalid device signature.  (Read 1968 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again,

I have everything working and I am able to upload a hex file to my Uno chip, but I'm not sure why it's saying the device signature is invalid.
Apparently I'm supposed to use a custom version of avrdude?
If possible I'd really like to get this working with no warnings just using the standard build of avrdude.

Does anyone know how to achieve this?

Here are the commands being issued during reset/upload.
Code:
for STTYF in 'stty --file' 'stty -f' 'stty <' ; \
                  do $STTYF /dev/tty >/dev/null 2>/dev/null && break ; \
                done ;\
                $STTYF /dev/ttyACM0  hupcl ;\
                (sleep 0.1 || sleep 1)     ;\
                $STTYF /dev/ttyACM0 -hupcl
/usr/bin/avrdude -q -V -p atmega328p -C /etc/avrdude.conf -c stk500v1 -b 115200 -P /dev/ttyACM0 -F \
                        -U flash:w:build-cli/helloworld.hex:i

avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "build-cli/helloworld.hex"
avrdude: writing flash (2212 bytes):
avrdude: 2212 bytes of flash written

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Thanks~
Logged

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

Try "arduino" instead of "stk500v1".
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have already tried that, but there is not an "arduino" programmer entry in avrdude.conf although I did add the settings for the ATmega328P chip.

Does anyone have an edited avrdude.conf that I could use for the Uno?
Logged

Left Coast, USA
Offline Offline
Sr. Member
****
Karma: 5
Posts: 499
Sometimes I just can't help myself.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have already tried that, but there is not an "arduino" programmer entry in avrdude.conf although I did add the settings for the ATmega328P chip.

Does anyone have an edited avrdude.conf that I could use for the Uno?

Try the following:

Navigate to the arduino-0022/hardware/tools/arduino directory.
Enter the following on the command line:

./avrdude -P/dev/ttyACM0 -C ./avrdude.conf  -p atmega328p -c stk500v1 -v

This works for me on my Centos 5.5 Linux system.

Depending on your operating system, you may have to do something like the following:  (See Footnote.)

stty -F /dev/ttyACM0 -hupcl && ./avrdude -P/dev/ttyACM0 -C ./avrdude.conf  -p atmega328p -c stk500v1 -v

If it doesn't work without stty, find a single stty command that makes the LED blink (four rapid flashes)  on the Uno so that you know it "takes." Then that in your script, followed by the avrdude command.


Anyhow, if you can get these to give you something meaningful you can change your script accordingly.


Regards,

Dave

Footnote:
Sometimes people have older versions of avrdude installed on their systems and they don't quite cut the mustard with more recent Arduino boards and bootloaders.  The second step is to make sure you are invoking the latest version.  (The first step when asking for help is to tell us what operating system you are using and where you got your version of avrdude.)

In my opinion (based on personal experience), mixing versions of avrdude and avrdude.conf doesn't work very well, and trying to get a version of avrdude.conf from someone else is an exercise in futility.

Here's my story with Centos 5.5 Linux:

I had previously built avrdude version 5.10 from source and installed it as /usr/local/bin/avrdude.  The configuration file for this ended up at /usr/local/etc/avrdude.conf and it had the "arduino" programmer in it.  When I invoked that version of avrdude with the stk500v1 programmer I got the signature error that you reported.  When I invoked it with the "arduino" programmer, the operation was flawless.

If you just invoke avrdude (without the -C stuff, but with everything else), the -v flag will let it tell you where it is looking for the configuration file.  (Don't try to help it unless you really know how to change it (and why).
« Last Edit: April 09, 2011, 01:39:13 pm by davekw7x » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I'm not using the avrdude that comes with the Arduino IDE.
I installed avrdude 5.10 from Portage and I'm running Gentoo Linux 64bit.

If you look at the commands being used in my first post you can see that the board is being reset first.

Here is verbose output of the upload, if anyone wants to see it.
Code:
for STTYF in 'stty --file' 'stty -f' 'stty <' ; \
                  do $STTYF /dev/tty >/dev/null 2>/dev/null && break ; \
                done ;\
                $STTYF /dev/ttyACM0  hupcl ;\
                (sleep 0.1 || sleep 1)     ;\
                $STTYF /dev/ttyACM0 -hupcl
/usr/bin/avrdude -q -V -p atmega328p -C /etc/avrdude.conf -c arduino -b 115200 -P /dev/ttyACM0 -F -v \
                        -U flash:w:build-cli/helloworld.hex:i

avrdude: Version 5.10, compiled on Apr  5 2011 at 18:25:20
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/grant/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 3
         Firmware Version: 3.3
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "build-cli/helloworld.hex"
avrdude: writing flash (2212 bytes):
avrdude: 2212 bytes of flash written

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Does it really matter that the device signature is invalid? Does it affect the upload somehow?
Logged

Pages: [1]   Go Up
Jump to: