-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move away from libusb-0.1 and libusb-win32 #974
Comments
Right now avrdude under Windows is using avrdude-libwinusb which is good to support both libusb0.sys and WinUSB. It has a limitation though -- some issues with USB Composite Device support. Long term solution is to use libusb-1.0 as per @mariusgreuel, but probably after libusb Windows supports get better with libusb0.sys. |
@dl8dtl mentioned below.
I see that usbasp already has the support of libusb-1.0 if it is present and otherwise fall back to libusb-0.1 API . So one way is to replace one by one if there are developers who are interested to create the patch for libusb-1.0 API, using the approach of usbasp. Some candidates which may affect less users: libftdi based programmers -- it is probably good to move away from libftdi-0.1 and move to libftdi-1.0 (which is based on libusb-1.0). It seems okay to use libusb0.sys and libusb-1.0.26 and libftdi-1.0 together with avrdude under Windows. I tested with Amontec JTAGKey-2. There is also a concern about the libusb-1.0 support of libusb0.sys, which is the motivation of avrdude-libwinusb. I will test out libusb0.sys and libusb-1.0.26 with usbasp later. |
usbasp test with official Windows binary which is using avrdude-libwinusb and not libusb-1.0. It supports libusb0.sys and WinUSB. It actually supports libusbk.sys as well (since libusbk.sys supports most of the driver ioctl codes from libusb0.sys) Run log using libusbk.sys.
|
Testing usbasp with MSYS2 binary using libusb0.sys and libusb-1.0.26.
|
Testing usbasp with MSYS2 binary using libusbk.sys and libusb-1.0.26.
|
Basically my testing using the usbasp clone and Arduino Uno clone, it shows with the release of libusb-1.0.26, avrdude is okay with all three drivers: WinUSB, libusb0.sys and libusbk.sys. The main problem of libusb0.sys with libusb-1.0 (especially in version 1.0.24) was sorted out in libusb-1.0.25 release. I believe there may be other issues with libusb0.sys and libusb-1.0, but for the purpose of avrdude, I tend to believe it works fine. Hopefully more testing can be done by other users to check if libusb-1.0 I do not see any error messages from libusb-1.0.26 debug log. detailed libusb-1.0.26 debug log
|
Just for compleleness, here is the run log for WinUSB with this usbasp clone.
|
@dl8dtl mentioned below.
I mentioned in earlier comments:
I will close this one since it will not be a general direction as mentioned by @dl8dtl. So it will only happen if someone provides updates to the existing codes using libusb-1.0 (but with libusb-0.1 as the fallback). The main advantage of libusb-1.0 vs libusb-0.1 API is the support of asynchronous API. But it may not bring too much speed improvement for avrdude. |
OpenOCD has done the migration from libusb-0.1 to libusb-1.0 API. libusb-0.1 support was removed in March 2000. Before that it has both support for libusb-0.1 and libusb-1.0. |
It will be good to move away from libusb-0.1 (or libusb-compat-0.1) from Linux, macOS, FreeBSD, etc. It is also good to move away from libusb-win32 under Windows.
Main affected file.
dfu.h
usb_libusb.c
micronucleus.c
pickti2.c [better move to hidapi and not libusb-1.0]
usbasp.c
usbtiny.c
Depending on the approaches used, it could affect more files as well like jtag3.c, jtagmkII.c and stk500v2.c.
Earlier attempts for stk500v2 and related programers.
The text was updated successfully, but these errors were encountered: