Olimex ISP MK2 error on Mac OSX 10.9

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, Im new here and new to pure (outside arduino) AVR programming.

My setup is a 168p chip and an Olimex ISPMK2 programmer using the 10 pin ICSP connector.

My error: (both with sudo and without)
sudo avrdude -c avrisp2 -p m168p -v -v -v -v
Password:

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/x/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : usb
Using Programmer : avrisp2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200012345
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): usb_bulk_read: An error occured during read (see messages above)
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_send(): wrote -107 out of 1 bytes, err = usb_bulk_write: An error occured during write (see messages above)
avrdude: stk500_send_mk2(): failed to send command to serial port

Any help or ideas?
Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's a known problem with avrdude 6.01 (and it's likely to also affect 6.1 as well) communicating with programmers based on Dean's LUFA avrisp firmware. The olimex avr-isp-mkii is one such programmer.

https://www.avrfreaks.net/index.p...

You have several options - use an earlier version of avrdude, or build a patched version of avrdude, or wait until a bugfixed version comes out.

- S

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi and thanks.

as far as see this is the problems (?):

Quote:

I found the problem in usbdev_open in file usb_libusb.c.

The if statement:
Code:
if (fd->usb.rep) == 0)
{

prevents Dean's masqueraded endpoint from being discovered.

Are there any patch files around? Is it just commenting etc that line?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I compiled 5.11 but I get the error here too.

x:avrdude-5.11svn-20111019 x$ ./avrdude -c avrisp2 -p m168p -v -v -v -v -C avrdude.conf -P usb

avrdude: Version 5.11svn-20111019, compiled on Mar 27 2014 at 09:32:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

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

         Using Port                    : usb
         Using Programmer              : avrisp2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200012345
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: Sent: . [01] 
avrdude: usbdev_recv_frame(): usb_bulk_read(): Broken pipe
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01] 
avrdude: usbdev_recv_frame(): usb_bulk_read(): Broken pipe
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_send(): wrote -32 out of 1 bytes, err = Broken pipe
avrdude: stk500_send_mk2(): failed to send command to serial port

Ideas?

EDIT: more tests and updates....

~x$ avrdude -c avrispmkII -P usb -p m168p -vvvv

avrdude: Version 5.11.1, compiled on Feb 12 2013 at 01:24:54
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/local/CrossPack-AVR-20130212/etc/avrdude.conf"
         User configuration file is "/Users/x/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200012345
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: Sent: . [01] 
avrdude: usbdev_recv_frame(): usb_bulk_read(): usb_bulk_read: An error occured during read (see messages above)
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_send(): wrote -106 out of 1 bytes, err = usb_bulk_write: An error occured during write (see messages above)
avrdude: stk500_send_mk2(): failed to send command to serial port
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ummmmm... Check that you have the correct firmware. There are two versions of the firmware. One works with the avrstudio, the other with avrdude. It should ship with the avrdude version by default.

I tried a build of 6.1, from:

$ svn co svn://svn.sv.gnu.org/avrdude/tags/RELEASE_6_1/avrdude

The patch that I use is:

$ svn diff
Index: stk500v2.c
===================================================================
--- stk500v2.c  (revision 1295)
+++ stk500v2.c  (working copy)
@@ -1626,7 +1626,7 @@
     PDATA(pgm)->pgmtype = PGMTYPE_AVRISP_MKII;
     pgm->set_sck_period = stk500v2_set_sck_period_mk2;
     pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
-    pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
+    pgm->fd.usb.rep = 0;
     pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
     pgm->fd.usb.eep = 0;           /* no seperate EP for events */
 #else

I get the following happening:

$ ./avrdude -p x32a4u -c avrispmkii -Usignature:r:-:h -v -v

avrdude: Version 6.1, compiled on Mar 28 2014 at 00:11:40
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : usb
         Using Programmer              : avrispmkii
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200012345
avrdude: usbdev_open(): using read endpoint 0x83
         AVR Part                      : ATxmega32A4U
 
<...>

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude: stk500v2_recv_mk2: error in USB receive
         Hardware Version: 109
         Firmware Version Master : 1.17
         Vtarget         : 3.3 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9541
avrdude: NOTE: Programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.
avrdude: reading signature memory:

Reading | ################################################## | 100% 0.01s

avrdude: writing output file ""
0x1e,0x95,0x41

avrdude done.  Thank you.

- S