-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
libusb0.dll missing #15
Comments
@kristofmulier It seems like the Arduino release uses libusb0. May I suggest that you use the official MSVC avrdude releases instead, or the MSVC build procedure if you wish to build it yourself? The Windows MSVC build is very different from the MinGW build, as it links against a rewritten libusb and ftdi library. I designed these libraries to fix some of the most common problems of the previous releases, which is the lack of native WinUSB and FTDI driver support. If you link against libusb0, that means your release it lacking WinUSB support, which is terrible for Windows users, because many devices will not work with a WinUSB based plug-and-play driver. Details here: https://github.com/avrdudes/avrdude/wiki/The-story-on-libusb-for-Windows In short, we should not enforce the use of outdated driver technology such as libusb0.sys by not supporting WinUSB. I would appreciate it very much if a major distribution such as Arduino would pick up the official Windows release from |
@mariusgreuel , and the Linux binaries from: (because the official Correct? |
I did not know about this story. For sure, we will try to solve the problem. Thanks for the detailed report, and for the explanation. |
Yes.
Even if you link statically to libusb-0.1, the library introduces a DLL dependency to libusb0.dll. That DLL ships with the libusb0.sys driver package, I guess with the intention that there is another layer in between, which allows for breaking changes in the libusb0.sys driver. However, the design flaw is that libusb-0.1 has a static dependency to libusb0.dll - if the driver package is not installed (because it is not needed), you get the error message you attached. The fix would have been to load libusb0.dll dynamically. To workaround that problem, everybody ships libusb0.dll as a side-by-side DLL with avrdude - thus breaking the idea of being able to update that DLL via the driver package. So, the Arduino release links libusb-0.1 correctly - it is your responsibility to ship libusb0.dll as well for those people who do not have the libusb0.sys driver package installed. Note that if you choose to use the MSVC release of avrdude, you should NOT ship libusb0.dll. Instead, you can rely on the libusb0.sys driver package to install a matching libusb0.dll. |
Great to hear that PS: My knowledge about |
WinUSB driver is the way to go. libusb0.sys (or libusbk.sys) is not available by default under Windows -- you usually use Zadig (or libusbk-inf-wizard) to instal the driver which will then install libusb0.dll/libusbk.dll for you as well. Best way is for the HW vendors to go with WCID, then you do not need to worry about driver installation for newer version of Windows. There are good alternative FW to offer WCID compatible FW for USBASP. My favorite is this one but it does not work with official avrdude 7.0 Windows binary due to avrdudes/avrdude#968 The following WCID compliant FW is also pretty good and should work with the official avrdude 7.0 binary. BTW, quite some Microchip AVR tools now use WinUSB as the driver, for example, the popular AVR ISP mkii. |
There is no static mingw-compatible libary for libusb-win32 in reality. libusb-win32 project and libusbk project do not support building the driver or static library using mingw. The only thing we support is the way to dynamically import the DDK/MSVC dll to use with MinGW. |
It is neither a Windows provided driver, nor a Plug-And-Play driver (i.e. provided through the Windows Update Catalog). It can only be installed manually by the user or by third-party applications. Hence, the author lost total control over his ability to update the driver. As there has not been any updates in years, I would think it is safe to assume that millions of computers are left vulnerable through this unmanaged driver package. Just one of the many reasons not to distribute (or promote distribution of) libusb0.sys. |
Even though I am one of the admins of libusb-win32 project, I do not really recommend to use it as it is in maintainence mode.
That being said, we have not declared libusb-win32 project dead yet as there are still many users. The current developer (Peter Dons Tychsen) has fixed a few issues in libusb-win32 1.2.6.0 release and come out with release 1.2.7.3. It is marked as snapshot release due to missing the driver installers and some updates (like porting to new WDK). It should be a good upgrade for the existing users who still want to keep using libsub-win32 for various reasons. Update history: 1.2.7.3 is the default download in libusb-win32 Sourceforge site and I can see there are more downloads of 1.2.7.3 version compared to 1.2.6.0 version. |
@umbynos The other solution is to switch to libusb-compat-0.1 which sits on top of libusb-1.0. With libusb-1.0.26 release, libusb0.sys can be used without issues, at least for the purpose of avrdude/Arduino. Edit to update: if you follow the instructions in the official avrdude wiki, you will actually use the second option and the result binary will actually not depend on libusb0.dll (all libusb-win32 library). Same if you use My personal avrdude MSYS2 mingw64 build here are all using the second option (to use libusb-1.0 + libusb-compat-0.1). |
@mcuee thanks for the suggestion! |
This would indeed fix a few issues, but we should remember what @mariusgreuel said:
Native |
@kristofmulier And avrdude-libwinusb may have other issues other than the lack of support for USB composite device since it is rather new. You can refer to the comments by @mariusgreuel himself. That being said, I have not encountered issues myself other than the above USB composite Device support issue. Still I do not use the MSVC build often as I prefer to use MSYS2 mingw64. avrdude-libftdi does have benefits compared to libftdi-1.0 (or libftdi-0.1) as you do not need to swap out the FTDI vendor driver. That being said, there are licensing concerns. So I am not so sure if @umbynos will accept that. Persoanlly I believe the approach by @mariusgreuel is acceptable though (avrdude-libftdi is kind of a wrapper around D2XX DLL). But I've seen heated debate in the openocd project many years ago which resulted in the removal of D2XX support (and the exit of the original developer and a few others). |
Unfortunately, I'm a complete noob in this topic, so my input is limited. Regardless of the build decisions you take - I (and many other AVRDUDE users) just need a single webpage to download all the latest binaries from: both for Windows and Linux. The binaries should just work, even if the user misses a few dll's here and there. I know this sounds simple, but it is very hard to achieve. Software distribution is damn hard - we experience it first-hand ourselves with Embeetle IDE. Therefore I express my sincere gratitude to each of you involved in the distribution of AVRDUDE @mcuee , @mariusgreuel and @umbynos ! |
I think we started using libusb-compat-0.1.7 and libusb-1.0.26 from release 7.0-arduino.2 -> see here and here. Should I include the lib here using |
@umbynos |
I use a simple tool to check the dll dependency of the windows avrdude.exe (there are many other tools, depenancy walker is the most famous but does not seem to work with my Windows 11 laptop). CFE Explorer: Results for the the binary from this repo (https://github.com/arduino/avrdude-packing/releases/download/7.0-arduino.3/avrdude_7.0-arduino.3_Windows_32bit.tar.gz) |
Results for the mingw32 build from avrdude github action. |
@umbynos As of now, BTW, PICKit 2 is currently not supported by avrdude under macOS because it has not been ported to hidapi. |
Ok, I think I've found why it's including that dep: https://github.com/arduino/crossbuild/blob/f1e2bb941634c461c94f3f7bad10cd00ff7e775c/deps/build_libs.sh#L25-L33 |
@umbynos Personally I like to use native build though (for projects like: libusb, libftdi, hidapi, openocd and avrdude) -- usually using MSYS2 mingw32/64, occassionaly using MSVC. |
I could have some news: I tried to use libusb-compat instead of libusb-win32. I'm also updating ncurses from 5.9 to 6.3 in the build container. After some attempt this is the resulting binary
Please @mcuee could you help me in checking if the deps are correct and if the binary is working correcly? 🔧 |
@umbynos
The output is similar to what I get from mingw32 static link version of avrdude git main, and avrdude 7.0 release msvc build.
|
I also tested with usbasp using all three different drivers (libusbk, libusb0.sys and WinUSB) and all three work fine.
|
Could you also attach the Linux and macOS build? I can test them as well. Thanks. BTW, the container works well with avrdude 7.0 release and avrdude git main 32bit Linux i686 build as well as macOS x86_64 build. But I'd like to test your build as the build flags may not be exactly the same. And I think you have a more up-to-date container than the published one. |
I do not know how to set up Arduino to use this new version of avrdude. So I just overwrite the official 6.3 version with the new version. It seems to work fine as well, tested using @MCUdude's MiniCore with Arduino 2.01 under Windows 11.
It is also good with MegaCoreX after I overwrite the default
|
It also works with the megaTinyCore from @SpenceSpenceKonde, after I overwrite the default
|
For DxCore, other than overwriting the default
|
Hi @mcuee, I just managed to release a test version of avrdude with the new container, I know, It took me a bit of time... 😓
The base commit is avrdudes/avrdude@4c92030 I'm trying to update everything so that when the new version of avrdude (7.1) comes out we are ready and can build a version that is production ready and that we can start to distribute to our users |
Also, please @kristofmulier if the new 7.0-arduino.4-rc1 fixes the problem could we close this issue? 😄 |
I'm very excited about the Avrdude 7.1 release. It's packed with new and awesome features and functionality, and the fact that Arduino is ready to distribute a 7.1 so it can be bundled with 3rd party Arduino cores is very cool! |
Thanks a lot. The container is very useful. I am able to use the container to build avrdude git main without issues.
That will be wonderful. |
Hi @umbynos , So, if I understand correctly, avrdude 7.1 will be released soon, and the libusb-problem I reported above will be fixed. That's great news. @umbynos , @mariusgreuel and @mcuee , So I never really know which one to choose :-) |
Should be solved in https://github.com/arduino/avrdude-packing/releases/tag/7.1-arduino.1 |
Tried the *alt.zip file on MacOS 10.15.7 and got this error.
Same error with other one too, used sudo also. |
@umbynos This isn't looking resolved to me. I tried 7.1 and got the following result.
|
As of now, PICkit 2 is not supported under macOS. It has not been ported to HIDAPI yet. Reference: |
I have answered in other place. Just to mention here as well. As of now, avrdude project only provides official Windows binary (x86, x64 and ARM64). The expectation is that you get from the distros (eg: Linux distros, or Homebrew/Macports under macOS). If you need cross-platform support, please use the binary release from Arduino avrdude-packing project. |
That's a pity. Sometimes you don't want to "get it from the distros". Our Embeetle IDE is the typical use case: we just want to add a working
Thank God this exists. Otherwise, we'd be unable to put |
libusb0.dll missing
At Embeetle IDE, we provide one of your Windows releases on our download server. One of our users experienced the following error on Windows 10 when trying to run the executable:
The error message reads:
AVRDUDE version
The user downloaded the following AVRDUDE version:
https://new.embeetle/downloads/beetle_tools/windows/avrdude_7.0.0_32b.7z
It's basically one of your
7.0
releases. I don't remember if it's7.0-arduino.1
,7.0-arduino.2-rc1
or7.0-arduino.2
(it certainly isn't7.0-arduino.3
yet). When I run the executable on my PC, I only get this version output:So I know it's version
7.0
- but not more specific.Notes
libusb
library statically? Why is AVRDUDE looking around for thedll
?7.0-arduino.3
release to the user experiencing the above mentioned problem. He just ran a test and the problem is still there.The text was updated successfully, but these errors were encountered: