[patch #8954] Enable usage of libusb-1.0 for stk500v2 (aka avrispmkii) #1436
Replies: 9 comments
-
Joerg Wunsch <joerg_wunsch> This does unfortunately not compile under FreeBSD where the OS
So it seems the libusb_has_capability() needs an explicit The warnings about char vs. uint8_t * can probably safely |
Beta Was this translation helpful? Give feedback.
-
I believe this issue has been fixed in later version of FreeBSD. |
Beta Was this translation helpful? Give feedback.
-
@dl8dtl can you confirm? |
Beta Was this translation helpful? Give feedback.
-
Well, it's supposed to be in the latest FreeBSD 11.x release (11.4 – 11.x is discontinued now), and since 12.2 in the 12.x release line (and then all more recent ones). So yes, with any supported FreeBSD version, it compiles now. It causes a bunch of warnings though:
In the quoted case, there's even a Just reviewed the header file at Thus, the code needs a bit of cleanup at first, and thorough testing against all affected devices (AVRISPmkII, JTAGICEmkII, JTAGICE3, AtmelICE, STK600, AVR Dragon – did I forget any?) afterwards, as it changes the underlying transport library for all these devices. |
Beta Was this translation helpful? Give feedback.
-
I have the AVR Dragon so I can help out testing. Related topic: |
Beta Was this translation helpful? Give feedback.
-
Just post the patch code here for easier view.
|
Beta Was this translation helpful? Give feedback.
-
From the direction given by @dl8dtl in the following issue, avrdude will probably continue using libusb-0.1 API in the foreseable future. 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. And then the above patch does not use asynchronous API at all. |
Beta Was this translation helpful? Give feedback.
-
I will close this one for now. |
Beta Was this translation helpful? Give feedback.
-
Move this to discussion. |
Beta Was this translation helpful? Give feedback.
-
Thu 24 Mar 2016 12:32:46 PM UTC
I tried using an AVRISPmkII in Windows 10 with avrdude 6.3, but libusb couldn't find the device ("avrdude.exe: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)").
Since libusb 0.1 is marked deprecated in cygwin, I installed libusb-1.0 and had a look at usbasp.c, where v1.0 is already in use. I then added support for libusb-1.0 in usb_libusb.c, and expanded the corresponding preprocessor conditions in jtag3.c, jtagmkII.c and stk500v2.c.
After replacing the ATMEL driver of the AVRISP by the WinUSB driver using Zadig avrdude is once more able to flash my AVRs using AVRISPmkII.
I also successfully applied and tested my patch with said AVRISPmkII in a virtual machine running xubuntu 14.04.
file #36745: libusb.patch
This issue was migrated from https://savannah.nongnu.org/patch/?8954
Beta Was this translation helpful? Give feedback.
All reactions