avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] Time Problem Avrdude 5.3.1 on mac


From: Joerg Wunsch
Subject: Re: [avrdude-dev] Time Problem Avrdude 5.3.1 on mac
Date: Fri, 27 Apr 2007 21:35:54 +0200
User-agent: Mutt/1.5.11

As Yannick PODGORSKI wrote:

>    if (result == kIOReturnSuccess) {
>      /* wait for write to complete */
>      if (CFRunLoopRunInMode(kCFRunLoopDefaultMode, (timeout+999)/ 1000, true) 
> == kCFRunLoopRunTimedOut) {
>        (*(device->interface))->AbortPipe(device->interface, pipeRef);
>        CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true); /* Pick up aborted 
> callback */
>        if (usb_debug)
>          fprintf(stderr, "usb_bulk_read: input timed out\n");
>      }
>    }

Well, the comments there don't particularly match. :-/

/* wait for write to complete */ vs.
            ^^^^^
"usb_bulk_read: input timed out\n"
          ^^^^

> The program takes 10 seconds in the CFRunLoopRunInMode function.

What is the call stack for it, in particular, what line of the avrdude
code?

> I don't know where this function is.

It's part of Apple's "Core Foundation", as a simple google lookup
shows:

http://developer.apple.com/documentation/CoreFoundation/Reference/CFRunLoopRef/Reference/reference.html#//apple_ref/c/func/CFRunLoopRunInMode

The timeout calculation appears to be a bit stupid to me, as they are
rounding up to full seconds when actual timeouts inside libusb are
given in milliseconds, and the timeout argument to the Core Foundation
function is a double value...  Methinks, using "timeout / 1000.0"
would be a much better representation.

Anyway, that doesn't appear to be your problem.

Try increasing the libusb debug level.  Either set usb_debug to say a
value of 10 in the debugger, or place a call

usb_set_debug(10);

into avrdude's source code.  Maybe we should do that if avrdude's
verbosity level is >= 5?  Verbosity level 4 logs the entire
communications trace, but levels above that are not really used now.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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