2

So, I have had this working on Ubuntu before. But then I upgraded to 11.10. Now, no such luck.

Note: if you are still messing with getting this to work on eclipse, you might want to try this command line stuff... if it doesnt work here, its not going to work in eclipse.

I have this error:

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.

I have tried with all different configurations. ie: -B 1 ,10, 1000,

-F doesn't help becuase then you just get back 000000 or whatever as your serial. Also, I should mention, clearly from the output below, you can see that it gets to the programmer and even to the target board and reads its voltage out. You can also see the target chip reset. (ie: i have tested on a number of devices includeing a DB101 and you can see when it resets)

The full output is like this:

> avrdude -c avrispmkII -P usb -p m1281 -B 100 -v

avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
     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/david/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : usb
     Using Programmer              : avrispmkII
     Setting bit clk period        : 100.0
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200037289
     AVR Part                      : ATMEGA1281
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
       flash         65    10   256    0 yes    131072  256    512  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 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 : STK500V2
     Description     : Atmel AVR ISP mkII
     Programmer Model: AVRISP mkII
     Hardware Version: 1
     Firmware Version Master : 1.13
     Vtarget         : 5.1 V
     SCK period      : 100.37 us

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.


avrdude done.  Thank you.

I already have the udev stuff set up: ie:

cat /etc/udev/rules.d/60-avrisp.rules SUBSYSTEM!="usb_device", ACTION!="add", GOTO="avrisp_end"

# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", SYSFS{idProduct}=="2103", MODE="660", GROUP="dialout"

# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", SYSFS{idProduct}=="2104", MODE="660", GROUP="dialout"

# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", SYSFS{idProduct}=="2107", MODE="660", GROUP="dialout"

LABEL="avrisp_end"

The board AND the programmer work with AVR studio on another machine. Apparently a lot of people have this issue on Linux. :( Dont really want to have to dig up a winblows box.

SpiRail
  • 1,377
  • 19
  • 28

2 Answers2

4

I had a really hard time getting mine to work as well. In the end, I tripped over http://wiki.dataflow.ws/Electronix/AvrIsp2OnOSX and found that I had actually missed a package. After installing uisp

sudo apt-get install uisp

I ran

sudo avrdude -c avrispmkII -p m168 -P usb: -B 8 -v -U lock:w:0x3f:m -U lfuse:w:0xff:m -U hfuse:w:0xdf:m -U efuse:w:0x0:m

And got a nice pretty green LED.

Chris Hanson
  • 2,043
  • 3
  • 16
  • 26
  • Thanks... but even a year later i still struggle wiht the avrisp mkii. Its really adhoc on Ubuntu. It will work, then you change boards and it doesnt, then you change back and it still doesnt work. Drives me crazy. I tend to program with an Arduino UNO now. Its WAY cheaper and seems more reliable. Its just a lot slower to program with however. – SpiRail Feb 21 '13 at 22:10
1

Just for the record (same error message) and because I also spent some time fiddling with my AVR ISP MKII:

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

It did work OK for me only after adjusting the timing using the -B parameter! Looks like even a current mini PC is just too fast.

Avrdude now works for me reliably under straight Debian 7. Also, it works under Windows 8 with WinAVR driver installed, then VirtualBox VM running a Debian 7 non-UI installation, after passing through the AVRISP to the VM in VirtualBox.

avrdude -c avrispmkII -P usb -p t13 -B 10 -v
...
mgaert
  • 2,338
  • 21
  • 27