Adafruit is open and shipping! Let's build back better, together!
0

initialization failed, rc=-1
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

initialization failed, rc=-1

by SubjectiveCaml on Sun Jun 19, 2016 10:14 pm

I am programming a (brand new) ATtiny85 using a USBtinyISP I assembled from the kit sold on this site. Unfortunately, I get the error "initialization failed, rc=-1" every time I try to upload a program onto the board (program compiles fine, just doesn't upload). I tried checking all the wires to make sure they're in the right spot, even re-doing them a few times, but I cannot seem to fix the error. I also tried using an ATmega328P-PU but it does the same thing.

I setup Atmel Studio to use avrdude v6.3 as an external tool with the command "-c usbtiny -p t85 -v -v -v -u flash:w:$(targetDir)$(TargetName).hex:i", which is what I used to upload the program. I also installed the drivers and the USBtinyISP is recognized by my computer (also lights up properly).

Some pictures of the programmer:
Image
Image
Image

And the breadboard (sorry the wires are hard to follow, I don't have many colors):
Image

I followed this diagram (using the notch as a reference) to determine which pins go where:
Image

And the full error log:

avrdude.exe: Version 6.3, compiled on Feb 17 2016 at 09:25:53
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\avrdude\avrdude.conf"

Using Port : usb
Using Programmer : usbtiny
avrdude.exe: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
AVR Part : ATtiny85
Chip Erase delay : 4500 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
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 6 4 0 no 512 4 0 4000 4500 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash 65 6 32 0 yes 8192 64 128 4500 4500 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

Programmer Type : USBtiny
Description : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude.exe: programmer operation not supported

avrdude.exe: Using SCK period of 10 usec
CMD: [ac 53 00 00] [00 00 00 00]
CMD: [ac 53 00 00] [00 00 00 00]
avrdude.exe: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude.exe done. Thank you.

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by marke3 on Mon Jun 20, 2016 5:47 am

Mine started doing this to me yesterday. Rebooting the laptop fixed it.

Another thing to try is different USB cables or even sockets.

marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: initialization failed, rc=-1

by SubjectiveCaml on Mon Jun 20, 2016 3:58 pm

marke3 wrote:Mine started doing this to me yesterday. Rebooting the laptop fixed it.

Another thing to try is different USB cables or even sockets.


Neither worked, unfortunately.

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by marke3 on Mon Jun 20, 2016 5:37 pm

This is always weird to me too. I know I'm being a bit hit and miss, but try knocking out the -v -v -v.

marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: initialization failed, rc=-1

by SubjectiveCaml on Mon Jun 20, 2016 7:12 pm

Now it just prints:

avrdude.exe: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude.exe done. Thank you.

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by franklin97355 on Mon Jun 20, 2016 7:57 pm

Some things to check. https://learn.adafruit.com/usbtinyisp/help or

Stuff that can go wrong: AVR initilization failed
If the programmer is not properly connected to the chip, you'll get the following message: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check

Don't use -F to override the check, even though it is suggested!

This means that the programmer couldn't talk to the chip. If you are using a "simple" programmer such as a serial or parallel port bitbang programmer, it could mean the programmer is at fault. Otherwise, it usually means the programmer is OK but it couldn't find the chip.

Check that the chip is powered, plugged into the socket or programmer properly, the programming cables are plugged in correctly, the header is wired correctly, etc. 99% of the time, it is a problem with wiring.

franklin97355
 
Posts: 21647
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: initialization failed, rc=-1

by SubjectiveCaml on Wed Jun 22, 2016 12:26 am

franklin97355 wrote:Check that the chip is powered, plugged into the socket or programmer properly, the programming cables are plugged in correctly, the header is wired correctly, etc. 99% of the time, it is a problem with wiring.


This is what I don't understand. Everything that I've read seems to lead me to "it's the wiring". I checked the wiring a bunch of times, including re-wiring it a few times. But the 6-pin header and the MCU have a notch on them, so I am certain that I am inserting the wires in the correct way.

Maybe I missed some step? Wrong avrdude command? Do the pictures of the programmer look like it's assembled correctly? What is the problem the other 1% of the time?

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by marke3 on Wed Jun 22, 2016 6:54 am

A couple more ideas. A 0.1uf cap across vcc and gnd, as close to the avr as you can. I can't get enough resolution to see in the photo but I'm sure you've triple checked the chip isn't back to front. Have you tried another '85 in case that one is damaged. Do you have the Arduino IDE - you could try there to see if AS is doing something different. And running the Avrdude command native on the command line might do something different too... None of these are definite fixes but somewhere another clue might pop up.

marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: initialization failed, rc=-1

by marke3 on Wed Jun 22, 2016 7:22 am

I only just noticed the jumper missing in your photos. That'll be the problem - no power. I pulled mine off and tried it and replicated your message.

Code: Select all | TOGGLE FULL SIZE
        Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
CMD: [ac 53 00 00] [00 00 00 00]
CMD: [ac 53 00 00] [00 00 00 00]
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: initialization failed, rc=-1

by SubjectiveCaml on Wed Jun 22, 2016 7:26 am

I made sure the dot on the chip aligns with the notch on the pinout diagrams. Adding a capacitor between the VCC and GND did not do anything. I have a second chip, it doesn't work either. Trying to burn the bootloader from the Arduino IDE (installed the option for ATtiny chips) did not work, and neither did running avrdude from the command line.

Also, running the command "avrdude -c usbtiny -p t85" still gives off the same error, if that means anything.

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by SubjectiveCaml on Wed Jun 22, 2016 7:28 am

marke3 wrote:I only just noticed the jumper missing in your photos. That'll be the problem - no power. I pulled mine off and tried it and replicated your message.


Which jumper?

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by marke3 on Wed Jun 22, 2016 7:30 am

Fits over the two pins poking out next to the cable.

marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: initialization failed, rc=-1

by SubjectiveCaml on Wed Jun 22, 2016 7:41 am

I found the jumper, put it on, tried a few times with no luck. I eventually went to check the connections again only to find out the chip had gotten incredibly hot.

So it did something, but I think that something killed the chip.

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by SubjectiveCaml on Wed Jun 22, 2016 8:13 am

The breadboard actually now has a small deformation in it and the programmer refuses to show up (or shows up as a malfunctioning device) if the jumper is in place and it's wired to the chip.

I think that chip is definitely dead at this point. I checked the wiring and I'm 99.99% certain it's installed correctly. I don't think I'm going to throw another chip at it yet until I can figure out why the programmer murdered my ATtiny.

SubjectiveCaml
 
Posts: 14
Joined: Sun Jun 19, 2016 4:20 am

Re: initialization failed, rc=-1

by marke3 on Wed Jun 22, 2016 8:24 am

So what's shorting now that there is power? Back to the wiring photo of the breadboard and I think I see that problem. Your reference schematic is of the 6 pin socket but you've used it for the plug, effectively reversing the connections - most importantly vcc and gnd at their opposite corners. That's what smoked the chip.

https://www.adafruit.com/products/1465

marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Please be positive and constructive with your questions and comments.