LUFA based AVRISP-MKII doesn't work with avrdude 6.0.1

17 posts / 0 new
Last post
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a USBTINY MKII programmer that seems to work with avrdude 6.0.1, on Linux, without issue. The LUFA image was furnished by the seller (Tom Light) so I don't know the details about that build. I believe it was built against the 120318 LUFA. Avrdude was compiled with, ../configure --enable-linuxgpio. Perhaps the problem is Windows specific? I hope this helps a bit.

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

Thanks Jörg, that information was very helpful and I was able to build avrdude with USB capabilities. That is sufficient at this point to enable debugging. Hope you feel better.

@tfeldman, thanks for letting me know that this is working on Linux. It is a problem with the avrdude Windows binary and the LUFA AVRISP-MKII. Not sure why yet.

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

Quote:
Those are the same defines as in the avrdude versions 5.10 and 5.11.1 and they work fine.

Although I did not know those defines were present before, I should have mentioned that I had gotten to those defines by looking through the usb_libusb.c code. Previously, the define was effectively ignored, because a search for a read endpoint was always performed (by looking at the endpoint direction). The new code will only perform this search if the endpoint wasn't already assigned (which it is, in stk500v2.c to the aforementioned define).

I also had the same dependency issues with MinGW, but I will try again tonight. I will try forcing the read endpoint search.

@tfeldman, that's good to know. Now that I think of it, AVRDUDE 5.x always worked for me regardless of whether or not libusb compatibility mode was enabled.

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

Success!!!

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

The if statement:

		  if (fd->usb.rep) == 0)
		  {

prevents Dean's masqueraded endpoint from being discovered.

Here is the output with the if statement removed and debug statement showing the original read endpoint.

C:\avrdudenew>avrdude -c avrispmkii -p t2313 -P usb -vv

avrdude: Version 6.0.1, compiled on Dec  6 2013 at 15:33:18
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

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

         Using Port                    : usb
         Using Programmer              : avrispmkii
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200312345
avrdude: usbdev_open(): original read endpoint fd->usb.rep 0x82
avrdude: usbdev_open(): using read endpoint 0x83
         AVR Part                      : ATtiny2313
         Chip Erase delay              : 9000 us
         PAGEL                         : PD4
         BS2                           : PD6
         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        128    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      2048   32     64  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 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
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 0
         Firmware Version Master : 1.23
         Vtarget         : 4.9 V
         SCK period      : 1.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e910a
avrdude: safemode: lfuse reads as A4
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF

avrdude: safemode: lfuse reads as A4
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (H:FF, E:DF, L:A4)

avrdude done.  Thank you.

I will follow up by filing a bug report.

EDIT: I come back after working the code to find the problem and to file this and discover that both physicist and I had found the problem. Cosmic. :wink:

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

Excellent! I was just about to try the same exact thing (see above post).

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

Bug report is #40831.

Cascadia rocks again!

Pages