[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avrdude-dev] Time Problem Avrdude 5.3.1 on mac
From: |
Yannick PODGORSKI |
Subject: |
RE: [avrdude-dev] Time Problem Avrdude 5.3.1 on mac |
Date: |
Wed, 2 May 2007 13:45:57 +0200 |
I try to check "the way of functions" :
- "usbdev_recv_frame" in usb_libusb.c (line 445)
- "usb_bulk_read" in usb_libusb.c (line 362)
=> where the timeout is 10 000 ms (10s)
- "usb_bulk_transfer" in darwin.c (line 913 libusb-0.1.12)
- "CFRunLoopRunInMode" in darwin.c (line 841 libusb-0.1.12)
Maybe the timeout is too long (how was it decided ? I try with 5s or 2s, it
works.
Can I change it without problems or create a variable to modify it in the
avrdude command ?
Thanks for help.
Yannick PODGORSKI.
-----Message d'origine-----
De : address@hidden
[mailto:address@hidden De la part de Joerg Wunsch
Envoyé : vendredi 27 avril 2007 21:36
À : address@hidden
Objet : Re: [avrdude-dev] Time Problem Avrdude 5.3.1 on mac
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/CFRunLoop
RunInMode
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. ;-)
_______________________________________________
avrdude-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avrdude-dev
- RE: [avrdude-dev] Time Problem Avrdude 5.3.1 on mac,
Yannick PODGORSKI <=