1
\$\begingroup\$

I have a bunch of defunct arduino boards that I'm trying to restore - Arduino Uno with ATmega328p chips. They do not respond to the usual flashing commands, so I'm trying to flash via the arduino ICSP headers, through an intermediate bus pirate.

The process fails due to an invalid signature, like so:

$ avrdude -c buspirate -P /dev/buspirate -p m328p -v -F

avrdude: Version 6.0.1, compiled on Sep 21 2013 at 11:40:49

         Using Port                    : /dev/buspirate
         Using Programmer              : buspirate
         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    20     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 : BusPirate
         Description     : The Bus Pirate

Attempting to initiate BusPirate binary mode...
BusPirate binmode version: 1
BusPirate SPI version: 1
avrdude: Paged flash write enabled.
AVR Extended Commands not found.
avrdude: initialization failed, rc=-2
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x881608
avrdude: Expected signature for ATmega328P is 1E 95 0F
BusPirate is back in the text mode

avrdude done.  Thank you.

(this is just running -v but trying to set fuses or flash fails the same way)

Weird thing is that the device signature changes slightly on each attempt, so something is definitely not behaving correctly.

I tried the same process by hooking up to the atmega328p pins directly (and not via arduino board ICSP header pins), but with no success.

Is there any salvaging the atmega328p or is it beyond repair?

\$\endgroup\$
6
  • \$\begingroup\$ Does this happen with other AVR's too? With the exact same device signature? Have you successfully flashed any AVR with your buspirate? Remove the -F from your command. I'm curious where the avrdude: initialization failed, rc=-2 came from. \$\endgroup\$
    – jippie
    Dec 1, 2013 at 15:08
  • \$\begingroup\$ I don't want to break any working AVRs I have, so I didn't try on other chips. But I'll try if there's no other way to debug this problem. \$\endgroup\$
    – Yuval Adam
    Dec 1, 2013 at 15:10
  • \$\begingroup\$ You can safely read an AVR \$\endgroup\$
    – jippie
    Dec 1, 2013 at 15:12
  • \$\begingroup\$ What happens if you execute a avrdude -p m328p -c puspirate -P /dev/buspirate -U signature:r:/dev/stdout:i ? It reads the signature from the AVR. Are you sure buspirate doesn't take a -b for baudrate? \$\endgroup\$
    – jippie
    Dec 1, 2013 at 15:16
  • \$\begingroup\$ optionally try ascii mode by adding -x ascii. BinMode is supported in firmware 2.7 and newer, older FW's either don't have BinMode or their BinMode is buggy. \$\endgroup\$
    – jippie
    Dec 1, 2013 at 15:24

1 Answer 1

2
\$\begingroup\$

You need to put an external oscillator. I suppose that the fuses for those chips are programmed for a external oscillator. Once you can flash it with the external oscillator change the fuses so you can program it without an oscillator.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.