[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

View: New views
10 Messages — Rating Filter:   Alert me  

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.nongnu.org/bugs/?22271>

                 Summary: usb_reset in usb_libusb.c not necessary in FreeBSD
6.x
                 Project: AVR Downloader/UploaDEr
            Submitted by: None
            Submitted on: Saturday 02/09/2008 at 14:49 UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Nick Hibma
        Originator Email: nick@...
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

--- usb_libusb.c~       2008-02-09 15:30:18.000000000 +0100
+++ usb_libusb.c        2008-02-09 15:30:22.000000000 +0100
@@ -211,7 +211,7 @@
    * Without this reset, the AVRISP mkII seems to stall the second
    * time we try to connect to it.
    */
-  usb_reset(udev);
+  //usb_reset(udev);
 
   usb_close(udev);
 }


The usb_reset actually wedges the device while not necessary on FreeBSD
(usb_reset is not yet implemented in FreeBSD, but will be soonish when I get
round to committing the patch).

At the moment on FreeBSD usb_reset doesn't do anything and thereefore can be
safely left out. The programmer continues to work fine during multiple
commands like:

sudo avrdude -P usb -c avrispmkII -p m168 -U \
     flash:w:auxboard.hex:i




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #22271 (project avrdude):

                  Status:                    None => Fixed                  
             Assigned to:                    None => joerg_wunsch          
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #1:

Implemented as a FreeBSD-only change.  On Linux, the usb_reset()
indeed allows to reconnect to the device immediately, whereas
one has to wait for ~ 2 s without the call to usb_reset() there.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #2, bug #22271 (project avrdude):

I had the same problem with the AVRISP mkII freezing when trying to use it
more than once, but on Mac OSX Snow Leopard.

I removed the #if defined(__FreeBSD__) ... #endif around the call to
usb_reset and it fixed the problem.

Is there some way this could be modified to automatically happen on OSX as
well as FreeBSD?



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #22271 (project avrdude):

                  Status:                   Fixed => In Progress            
             Assigned to:            joerg_wunsch => dhoerl                
             Open/Closed:                  Closed => Open                  

    _______________________________________________________

Follow-up Comment #3:

Reopened for the MacOS X issue.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #4, bug #22271 (project avrdude):

The proper way to declare OSX is with "defined(__APPLE__)  &&
defined(__MACH__)" which was added to prevent usb reset.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #22271 (project avrdude):

                  Status:             In Progress => Fixed                  
             Open/Closed:                    Open => Closed                


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by anonymous-98 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #5, bug #22271 (project avrdude):

In my testing, the usb_reset() is necessary on Mac OS X (10.6 Snow Leopard).
Otherwise, the upload process will stall for about 25 seconds on the second
and subsequent attempts.  I suggest that revision 873 be reverted.  

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22271>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

Re: [bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by David Hoerl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/6/09 4:37 PM, David A. Mellis wrote:
>
> Follow-up Comment #5, bug #22271 (project avrdude):
>
> In my testing, the usb_reset() is necessary on Mac OS X (10.6 Snow Leopard).
> Otherwise, the upload process will stall for about 25 seconds on the second
> and subsequent attempts.  I suggest that revision 873 be reverted.
>
>

David,

Well, I kind of agree. Once I made the change, I too then started seeing
more failures. But I also noticed that when it succeeds, its also a bit
slow.

As I posted the other day, what I ended up doing is installing
libusb.1.0, and libcompat.0.1. The current libusb.0.1 is quite old and
will itself never be updated. The combination of the new library and a
glue library fix a lot of issues (according to authors).

Even then, avrdude was running slowly. I actually spend a fair amount of
time putting in debugging command to find out why. It turned out its in
the two library calls to get busses and devices.

Well, it seems Apple suspends unused devices (like iSights), and the
current libusb.1.0 tries to wake them, get their info, and then put them
back to sleep. The code that does this was easily turned off, so I build
a special version of libusb-1.0, and now avrdude is running MUCH faster
than it ever did with the old libusb.0.1

My point in all this is that you can work with avrdude the way it is, do
the same things I did (take less than an hour), and have a much faster
and more reliable system.


That said, if you want it back, well, what I would then suggest is that
I add a new flag to avrdude that forces a usb reset - current systems
would get it, others could request it. This would then allows
FreeBSD/Mac people use either the new or the old library.


David

PS: should avrdude migrate to the new usblib.1.0 someday?


_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

Re: [bug #22271] usb_reset in usb_libusb.c not necessary in FreeBSD 6.x

by Joerg Wunsch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As David Hoerl wrote:

> PS: should avrdude migrate to the new usblib.1.0 someday?

Last time I've been looking at it, the platform support status of
libusb 1.x was lousy, only Linux was supported.  Right now, the
AVR opensource toolchain is proud to run on:

. Win32
. Linux
. MacOS X
. FreeBSD (probably also other *BSDs)
. Solaris

to name those where I've got reports it is being in use.  I wouldn't
want to break that.

--
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
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

RE: Re: [bug #22271] usb_reset in usb_libusb.c notnecessary in FreeBSD 6.x

by Weddington, Eric :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 

> -----Original Message-----
> From:
> avrdude-dev-bounces+eric.weddington=atmel.com@...
> [mailto:avrdude-dev-bounces+eric.weddington=atmel.com@...
> rg] On Behalf Of Joerg Wunsch
> Sent: Friday, November 06, 2009 3:10 PM
> To: avrdude-dev@...
> Subject: [avrdude-dev] Re: [bug #22271] usb_reset in
> usb_libusb.c notnecessary in FreeBSD 6.x
>
> Right now, the
> AVR opensource toolchain is proud to run on:
>
> . Win32
> . Linux
> . MacOS X
> . FreeBSD (probably also other *BSDs)
> . Solaris

IIRC, we've heard of it running on NetBSD.


_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev