<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 4/06/12 11:51 AM, Andrew Leech wrote:
<blockquote cite="mid:4FCC14A8.9070700@gmail.com" type="cite">Hi,
<br>
I'm just starting to use dfu-util to program some hardware based
on the lpc3131 processor which has a built in dfu mode.
<br>
Unfortunately I can't make it work with any new dfu-util compiled
from source (git).
<br>
<br>
The new versions all rely on libusb-1.0 as far as I can tell,
which on windows is currently limited to WinUSB backend driver
which does not support usb reset. This usb reset certainly appears
to be required on my lpc3131 to start the loaded code, is this the
same on other dfu device?
<br>
<br>
</blockquote>
<br>
<blockquote cite="mid:4FCC14A8.9070700@gmail.com" type="cite">Apparently
there's proposed patches to libusb-1.0 to support the original
libusb-win32 driver somewhere too, although I couldn't find the
patches myself to try them.
<br>
<br>
</blockquote>
Hi,<br>
To follow up on my previous post, I've got a new git compile working
with libusbk.sys and the (unsupported) libusb-pbatard K branch:<br>
<br>
$ git clone <a class="moz-txt-link-freetext" href="git://git.libusb.org/libusb-pbatard.git">git://git.libusb.org/libusb-pbatard.git</a> -b K<br>
<br>
and a patch to fix the libusbk export names (attached); in
libusb-pbatard the libusbk functions all have a capital 'L' in front
of them, must be from an old version of libusbk.<br>
I found it useful to use "./configure --disable-shared" to ensure I
din't have any dll dependencies hiding in the compiled libs.<br>
<br>
I installed libusbk.sys vers 3.0.5.13 from
<a class="moz-txt-link-freetext" href="http://sourceforge.net/projects/libusbk/files/">http://sourceforge.net/projects/libusbk/files/</a><br>
and compiled dfu-util unmodified but linked against the custom
libusb:<br>
<br>
$ USB_CFLAGS="-I../../libusb-pbatard/libusb/"
USB_LIBS="-L../../libusb-pbatard/libusb/.libs/ -lusb-1.0"
./configure --host=i586-mingw32msvc<br>
<br>
I initially cross compiled on linux (hence the
--host=i586-mingw32msvc above), but as an exercise I've also
compiled it with mingw/msys on windows. I had to install pkg-config
to make configure work, it ignores the USB_CFLAGS/USB_LIBS without
it.<br>
I had previously tried to compile with cygwin/mingw (with CC="gcc
-mno-cygwin") but had lots of problems with trying to statically
link libpthreads required by libusb and eventually gave up. The
libraries included in mingw/msys seemed to work without any setup.<br>
<br>
I've also been able to compile it under ms visual c, but had to add
a seperate getopt library and find a couple of header files not
supplied by msvc. It got a bit messy in the end, if I get a chance
I'll clean that up and post my changes. I may end up re-writing some
of the code to allow use from a dll rather than a standalone exe,
but that will depend on project requirements at works end and
looking into the gnu aspects a bit closer.<br>
<br>
Hopefully in a few months libusbx will have libusbk.sys /
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
libusb0.sys support and I'll be able to compile against a supported
library rather than Pete Batard's old libusb-1 repo, considering
he's one of the primary libusbx developers.<br>
<br>
Cheers,<br>
Andrew<br>
<br>
</body>
</html>