I would like to make a few proposals for improving the Windows version of avrdude.
IMHO, the biggest issue with avrdude on Windows is the lack of native driver support, which is due the dependency on libusb and libftdi. Both implementations are based on the Windows port libusb-win32, which includes its own kernel driver libusb0.sys. While libusb-win32 does provide the functionality, it has its own set of problems. Most importantly, libusb it is not the way to go on Windows: The proper way to access USB devices is to either use the vendor stock drivers or system supplies drivers, for instance the Atmel or FTDI supplies drivers. Windows users of avrdude are well aware of the required workarounds to get libusb installed, such as using Zadig. It really becomes a nightmare when you use other applications in parallel, where one application, such Atmel Studio, requires the vendor drivers and avrdude requires libusb. Now, for Windows users, it would be nice if avrdude just "works out of the box", as it does on Linux. One of the key points is to move away from the libusb0.sys driver to the WinUSB driver. WinUSB is the Windows equivalent of libusb, which is what people use (including Atmel) when you do not want to cook up your own USB driver. Some choose to use the HID stack, which works equally well. As a first step, I hacked up a libusb compatible library for avrdude, that adds support for both libusb(K) and WinUSB. Having WinUSB support enables Windows users to move away from libusb, while providing backwards compatibility. All in all, my patches seem to work for the devices I own, such as AVRISP MKII, but there are probably issues that need to be fixed. My avrdude repo with the patched libraries in the 'external' folder can be viewed here: https://github.com/mariusgreuel/avrdude The second step, which is not really related to avrdude, is to increase awareness of the problems, and get people to actually support WinUSB for their devices. The easiest way to get Windows to load the WinUSB driver automatically, is to add a WinUSB compatibility descriptor to the device firmware. Alternatively, a signed INF file referencing WinUSB will do. Here is a demo for USBasp: https://github.com/mariusgreuel/USBasp The question for me is how we proceed with regards to avrdude. I am curious on a) whether there is any interest at all, b) what your thoughts on this are, c) what the requirements would be to get changes accepted. Note that my repo contains a bunch of other patches, which should not be the scope of this discussion - the patched libusb library is well isolated from these patches. If there is sufficient interest, I'd be willing to spend some time cleaning up the code, make changes, and perhaps move the libusb patches into a library. I think this can be done in a minimal intrusive way that won't offend Linux users. Marius
