On Thu, 2009-07-09 at 01:11 -0700, Gary Carlson wrote:
> 
> 
> On 7/9/09 12:57 AM, "Spencer Oliver" <[email protected]> wrote:
> 
> > 
> >> Zach/Spencer/Xiaofan,
> >> 
> >> I did some more experimentation on the latest subversion
> >> (2499) and was able to tweak the jlink.c code slightly to
> >> possibly achieve three objectives:
> >> 
> >> 1. Make jlink dongles work under Windows for Spencer.
> >> 2. Make jlink dongles work under Mac OS X for me.
> >> 3. Make jlink dongles work under Linux for Zach and Xiaofan.
> >> 4. Note the possible future problem that Xiaofan uncovered
> >> with libusb interactions in the Linux kernel and use it in
> >> such a way that the code in jlink.c won't cause future problems.
> >> 
> >> I have confirmed #2 and believe that #4 is satisfied.  What I
> >> don't know is whether #1 and #4 are.  Could you try this out
> >> with your dongles and let me know what happens?
> >> 
> >> If the patch works, I need to do a little cleanup but I
> >> didn't want to focus on that until I knew for sure whether it
> >> would solve the issues at hand.
> >> 
> > 
> > This patch will not work on windows as after the reset the handle is
> > invalid.
> > so the usb_close will fail. Also the dev structure is not valid either after
> > the usb_reset.
> > 
> > This is why in my patch i search for the device again after the reset.
> > 
> > Cheers
> > Spen
> 
> It is starting to look like there is no single solution that will fix all OS
> issues with respect to this issue.  I am starting to think it is time to
> turn to conditional compilation directives.
> 
> Any thoughts, comments, or reservations?

If you have to use conditionals to use libusb, then libusb is not
portable.  Perhaps I am wrong, but I thought that was one of the entire
points for existing: to provide a _portable_ USB library.  

If this understanding is correct, then we are either seeing a bug in
libusb, or we are misusing its APIs.  Conditionals will attempt to solve
libusb's problems in the OpenOCD code.  Or did I miss something here?

As a quick sanity check, what versions of libusb are undergoing testing
in this thread?  If only older versions that fail, then this thread may
have been chasing ghosts.  If nothing else, investigating how to unify
this behavior inside libusb seems to be the right approach.  Doesn't it?

Cheers,

Zach


_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to