Operation not permitted / initialization failed, rc=-1
Moderators: adafruit_support_bill, adafruit

Operation not permitted / initialization failed, rc=-1

by ChuckJaxFL on Sun Jul 01, 2012 1:41 am

I just received and built this kit. After building it, I used it to program blink on an Arduino Nano w/ a 328.

I booted the same machine into Ubuntu, tried to do the same thing, and got the below error.

avrdude: error: usbtiny_transmit: error sending control message: Operation not permitted
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: error: usbtiny_transit: error sending control message: Operation not permitted


The help page says, "It is ALWAYS a bad chip or a wiring, clocking, bit-speed, powering or output-resistor problem", which I am reluctant to accept, as it seems those problems would exist on both systems, not just on Ubuntu. I thought there was nothing required to get it running under linux, but I've got to be overlooking something, obviously.
ChuckJaxFL
 
Posts: 4
Joined: Mon Jun 25, 2012 12:19 am

Re: Operation not permitted / initialization failed, rc=-1

by ChuckJaxFL on Sun Jul 01, 2012 1:49 am

FIRST: Are you using a USBtiny from a kit or from DIY? Make sure you mention that in your post
Kit purchased here.

SECOND: What OS and computer are you using?
The issue exists under ubuntu 12.04 LTS.

THIRD: Which programming software are you using, and what chip?
Arduino 1.0.1, programming a Arduino Nano w/ 328.

FOURTH: Did the USBtinyISP ever work (even once) or is it your first time trying to talk to a chip
Yes, it works as expected under Windows XP, using the same machine.

FIFTH: Post screenshots (NOT copy&paste) of what is happening
I'll take screenshots if you feel it's really necessary. The error is what it is, though.

SIXTH: Post clear, in-focus, not-blurry, easy to see photos of the top and bottom of the kit. If the photos are blurry, unfocused, and difficult to see they will only make it harder to debug what is going on
I can take some and post these if you feel it's really necessary, but I don't suspect it's a physical issue with the board.
ChuckJaxFL
 
Posts: 4
Joined: Mon Jun 25, 2012 12:19 am

Re: Operation not permitted / initialization failed, rc=-1

by adafruit on Sun Jul 01, 2012 3:26 pm

did you follow our instructions about running it as root?

http://ladyada.net/make/usbtinyisp/avrdude.html
User avatar
adafruit
 
Posts: 11712
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Operation not permitted / initialization failed, rc=-1

by ChuckJaxFL on Sun Jul 01, 2012 8:51 pm

Not until you just told me to, no!

From the terminal window:
chuck@chuck-desktop:~$ sudo avrdude -c usbtiny -p t84
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e930c
avrdude: safemode: Fuses OK
avrdude done. Thank you.
chuck@chuck-desktop:~$


So, it's only in the Arduino IDE that I'm having the difficulty.
I take it this means I need to create rule file for the USB port? I'll try that and report back.
Attachments
terminal.png
terminal.png (31.92 KiB) Viewed 5023 times
ChuckJaxFL
 
Posts: 4
Joined: Mon Jun 25, 2012 12:19 am

Re: Operation not permitted / initialization failed, rc=-1

by ChuckJaxFL on Sun Jul 01, 2012 9:35 pm

That worked, using the third option, SUBSYSTEM=="usb", ATTR{product}=="USBtiny", ATTR{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE="0666"

I loaded up blink, changed pin 13 to pin 5, and loaded it right from the Arduino IDE to the ATtiny84 via the USBtinyISP. It works great.

I don't yet know how to write in anything other than the Arduino IDE, so I didn't look under the AVRdude and AVRstudio sections. I guess I should have. Mark this one solved.
ChuckJaxFL
 
Posts: 4
Joined: Mon Jun 25, 2012 12:19 am

Re: Operation not permitted / initialization failed, rc=-1

by Dheath on Thu Sep 06, 2012 7:59 pm

adafruit wrote:did you follow our instructions about running it as root?

http://ladyada.net/make/usbtinyisp/avrdude.html


In Ubuntu 12.04 64-bit this did not work for me no matter what I did.
The way I got it working was to put the rule file in /lib/udev/rules.d/ instead of placing the udev rule in /etc/udev/rules.d/ and then $ sudo udevadm trigger

The exact reason why my Ubuntu system does not seem to read rules from /etc/udev/rules.d/ is still a bit mystery.
Dheath
 
Posts: 1
Joined: Thu Sep 06, 2012 7:46 pm

Re: Operation not permitted / initialization failed, rc=-1

by mikeceranski on Tue Oct 23, 2012 8:19 pm

Dheath you rock! I had the same issue with my ubuntu x64 install. Your solution worked like a charm. Thanks!
mikeceranski
 
Posts: 2
Joined: Fri Jan 20, 2012 9:01 pm

Re: Operation not permitted / initialization failed, rc=-1

by mikeceranski on Tue Oct 23, 2012 8:19 pm

Dheath you rock! I had the same issue with my ubuntu x64 install. Your solution worked like a charm. Thanks!
mikeceranski
 
Posts: 2
Joined: Fri Jan 20, 2012 9:01 pm

Re: Operation not permitted / initialization failed, rc=-1

by timretniw on Mon Aug 12, 2013 9:08 am

Hei folks!

I am struggling since the whole morning with precise the problem you all described, I'm using ubuntu 12.04 and tried to write both into etc and lib, but still get this anoying message that the operation is not permitted. I'm not sure about which of the 3 different code lines have to go into the 10...file, could someone help me with that??
Thanks a lot in advance!
timretniw
 
Posts: 1
Joined: Tue Jul 16, 2013 8:50 am

Re: Operation not permitted / initialization failed, rc=-1

by slado on Fri May 02, 2014 5:56 pm

In my case (Ubuntu 12.04, USBtiny, Atmega328p, using Arduino Uno settings/bootloader) only the following rules worked:

SUBSYSTEM=="usb", ATTR{idVendor}=="1781", ATTR{idProduct}=="0c9f", GROUP="plugdev", MODE="0666"
slado
 
Posts: 1
Joined: Fri May 02, 2014 5:51 pm

Re: Operation not permitted / initialization failed, rc=-1

by ron_bean on Fri Jul 04, 2014 7:26 pm

I've been puzzling over this issue, and this thread finally pointed me in the right direction, with a bit of a twist:

I'm running Ubuntu 14.04, and I discovered that there is already a file called /etc/udev/rules.d/usbtinyisp.rules which contains this: SUBSYSTEM=="usb", ATTR{pro duct}=="USBtiny", ATTR{idPro duct}=="0c9f",
ATTRS{idVendo r}=="1781", MODE="0660", GROUP="dialout"

Note the weird spaces in "pro duct", "idPro duct" and "idVendo r". I removed those spaces, but still no luck. Following the clue from "Dheath" above, I copied this file into /lib/udev/rules.d/ (adding a number to the beginning of the filename, to match the format of the other files in that directory), and then ran $ sudo udevadm trigger (it won't work if you don't do this).

Now it works, either from the command line or from within the Arduino IDE. I would suggest updating the documentation somewhere to include this information.
ron_bean
 
Posts: 6
Joined: Sat Jul 16, 2011 7:07 am