avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] jtag2 and usb timeout


From: Dave N6NZ
Subject: Re: [avrdude-dev] jtag2 and usb timeout
Date: Wed, 30 Aug 2006 14:20:44 -0700
User-agent: Thunderbird 1.5 (X11/20051201)

Since this was smelling very much like a timing issue, I tried the expedient solution: a hub. (D-Link DUB H-7 USB 2.0, FWIW).

Instant success! (at least at reading fuses, see below).

So... timing issue where??
1) JTAG ICE MKII maybe close-but-not-quite USB??
2) libusb just a little bit off?
3) Linux 2.4 kernel bug

All seem about equally likely to me.

The USB folks are going to tell me to upgrade to a 2.6 kernel before taking any bug report seriously. I really should do that, but I'd rather spend my time write AVR code just now....

In any case, it appears that the repeater function of the hub is cleaning up whatever is going wrong. I'll report again after more testing.

-dave

address@hidden:~/robot/libcleddemo$ avrdude -c jtag2 -B 8 -p atmega32 -P usb -U lfuse:r:lfuse:i

avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9502
avrdude: reading lfuse memory:

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

avrdude: writing output file "lfuse"

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

address@hidden:~/robot/libcleddemo$ more lfuse
:01000000E11E
:00000001FF

Joerg Wunsch wrote:
As Dave N6NZ wrote:

Stretching the time-out value passed by avrdude causes the failure
to take longer, so it would seem that the time out is legitimate.

I'm thinking that there is a basic connectivity issue in the USB
configuration someplace.

If it were connectivity, it couldn't get as far as reading the string
entries from the device, like the serial number:

avrdude: jtagmkII_open()
avrdude: usbdev_open(): Found JTAGICE mkII, serno: 00A000004986

This rings a bell...  I continually had to fix libusb in the FreeBSD
port to allow for "short" transfers, i. e. to accept the device
returning less bytes than requested.  Maybe that's your problem as
well?  Did they add some API in the new version to allow to pass this
``short transfer is OK'' down from the upper layer?

OTOH, it fails similarly to your problem on that Linux laptop at my
employer, while it works (IMHO using the same libusb version) on the
Linux desktops.  Also, the FreeBSD glue in libusb is vastly different
from the Linux glue layer, and the libusb authors appear to know about
the details of Linux' USB pretty well, while they admit in the
preamble of the BSD glue layer that they only wrote that part based on
man pages.  So it's not surprising they might have missed a detail or
two in the BSD implementation.

Again, I suggest you get in contact with the libusb developers for
that.  Note there's a function called usb_set_debug(int level),
supposedly you could make libusb talk a lot more about what it's
currently doing that way.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]