AVRDUDE does not work with IDE version 1.8.7 and 1.8.8

I have recently needed to do some work on programming an Uno using an AVR programmer. I have a couple of USBasp programmers and both work fine with IDE version 1.6.11. Neither work with version 1.8.7 or the latest version 1.8.8. I am using the standalone Windows versions supplied in ZIP files.

The following error is reported in both of the newer versions:

Arduino: 1.8.8 (Windows 7), Board: "Arduino/Genuino Uno"

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: Warning: cannot query manufacturer for device: No such file or directory
avrdude: Warning: cannot query product for device: No such file or directory
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I used the verbose option but this does not yield any further information. A separate standalone version of avrdude has no problem finding the controller:

C:\Temp\avrdude>avrdude -c usbasp -p m328p

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f (probably m328p)

avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

avrdude done.  Thank you.

Version 1.6.11 of the IDE (which I used previously) also works just fine.

At least with version 1.8.8 I was able to narrow it down to the file ..\arduino-1.8.8\hardware\arduino\avr\platform.txt. Replacing this file with the one from version 1.6.11 seemed to resolve the issue. Although the file has some differences, there did not seem to be any one particular change or line that when reverted to the 1.6.11 version resolved the issue, so it seems to be down to a combination of changes. Although it seems to provide a workaround, I am not certain whether replacing the file is likely to cause other problems so I'm using version 1.6.11 to upload sketches on Windows. The same trick didn't work for version 1.8.7 and I got Java errors instead.

The Linux version 1.8.7 of the IDE does not appear to have this issue and works just fine.

Clearly avrdude works Ok with the programmer hardware, but something has changed in the recent Windows versions of the IDE package that has caused the bundled version of avrdude to fail when using USBasp. I have seen various forum posts on the subject but so far no resolution. I couldn't find an official link to submit bugs, so am reporting it here in the hope that the problem can be resolved in the next release.

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here

BitSeeker:
At least with version 1.8.8 I was able to narrow it down to the file ..\arduino-1.8.8\hardware\arduino\avr\platform.txt. Replacing this file with the one from version 1.6.11 seemed to resolve the issue

This is extremely odd, considering the relevant section of the two are functionally identical.

The problem is not the IDE version, but may be the driver you are using for your USBasp. What version of Windows are you using? Did you use Zadig to detect and install the correct Windows driver for you?

pert:
Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here

Thanks for your reply. I did as you suggested (using Sketch > Upload Using Programmer) and the result is attached.

pert:
This is extremely odd, considering the relevant section of the two are functionally identical.

They are functionally identical perhaps, but not syntactically and bits have been added. One line at least had additional double-quote marks (although I think it unlikely this makes a difference) and additional compilation flags have been added. I'm not expert enough to understand what effect these additional flags would have. Its also possible that the workaround is a bit of a fluke.... but yes, rather weird.

Perehama:
The problem is not the IDE version, but may be the driver you are using for your USBasp. What version of Windows are you using? Did you use Zadig to detect and install the correct Windows driver for you?

Thanks for your observation, but I think it unlikely to be a driver issue. However, just to aswer the questions you raise, I am using 64-bit Windows version 7 Pro and the libusb driver was installed using Zadig. The device is recognized in Device Manager with the correct vendor and device ID: USB\VID_16C0&PID_05DC. Both of my USBasp devices are also recognized and work fine with version 1.6.11 of the Arduino IDE as well as a standalone version of avrdude. I would respectfully suggest that if the correct driver was not installed then the programmer would not be recognized by any program.

ideerr.txt (29.1 KB)

BitSeeker:
Thanks for your observation, but I think it unlikely to be a driver issue. However, just to provide the information you requested, I am using 64-bit Windows version 7 Pro and the libusb driver was installed using Zadig. The device is recognized in Device Manager with the correct vendor and device ID: USB\VID_16C0&PID_05DC. The device is also recognized and works with version 1.6.11 of the Arduino IDE as well as a standalone version of avrdude. I would respectfully suggest that if the correct driver was not installed then the programmer would not be recognized by any program.

Did you select libusb or did it auto-detect that one for you?

This is a little odd:

K:\Install\Arduino\arduino-1.8.8\hardware\tools\avr.ori/bin/avrdude -CK:\Install\Arduino\arduino-1.8.8\hardware\tools\avr.ori/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -Uflash:w:C:\Users\John\AppData\Local\Temp\arduino_build_815247/sketch_jan09a.ino.hex:i

Why is the folder name "avr.ori" instead of "avr"?

BitSeeker:
They are functionally identical perhaps, but not syntactically and bits have been added. One line at least had additional double-quote marks (although I think it unlikely this makes a difference) and additional compilation flags have been added. I'm not expert enough to understand what effect these additional flags would have. Its also possible that the workaround is a bit of a fluke.... but yes, rather weird.

For Upload Using Programmer, only the tools.avrdude.program recipes are used. Within the two, the only difference is this in 1.8.8:

# tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value
tools.avrdude.program.verify=

That line should have absolutely no effect in any IDE version newer than 1.6.8.

BitSeeker:
Thanks for your observation, but I think it unlikely to be a driver issue.

Although it was a bit different, I have encountered incompatibility with USBasp using the libusb-win32 driver with the new versions of AVRDUDE that Arduino distributes. The equivalent version distributed directly from the AVRDUDE project did not have this incompatibility, which seems very similar to what you're experiencing. For me, it was solved by changing from libusb-win32 to the libusbK driver, using Zadig:

  1. Download Zadig: http://zadig.akeo.ie/
    Note that Zadig is recommended on the official USBasp page: USBasp - USB programmer for Atmel AVR controllers - fischl.de.
  2. Plug in your USBasp
    1, Start Zadig
  3. From the dropdown menu, select USBasp. If it doesn't show up on the menu, then select Options > List all devices and check again.
  4. Click the up or down arrows next to the Driver selection box on the right side until you see "libusbK".
  5. Click the Replace Driver button.

After it finishes with the driver installation you can close Zadig.

Reference:

1 Like

Perehama:
Did you select libusb or did it auto-detect that one for you?

I had to select libusb-win32(v1.2.6.0) as per online tutorials. By default it showed me WinUSB(v6.1.7600.1635). In device manager, the device shows up in "libusb-win32 devices" as "USBasp". Driver details shows the following is installed:

libusb0.sys
libusb0.dll
libusbk.dll

The device status shows: "This device is working properly."

pert:
This is a little odd:

K:\Install\Arduino\arduino-1.8.8\hardware\tools\avr.ori/bin/avrdude -CK:\Install\Arduino\arduino-1.8.8\hardware\tools\avr.ori/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -Uflash:w:C:\Users\John\AppData\Local\Temp\arduino_build_815247/sketch_jan09a.ino.hex:i

Why is the folder name "avr.ori" instead of "avr"?

Ok, that was my fault. My first troubleshooting step was to replace first the ..\arduino-1.8.8\hardware\tools\avr and ..\arduino-1.8.8\hardware\arduino\avr folders with the ones from version 1.6.11. Replacing the complete folders does work as a workaround. However it seems that I forgot to rename avr.ori back to avr. Bit odd that the script would look in there though. The avr folder was still present. Replacing platforms.txt was a "red herring" and does not change anything, just gives Java errors as it did in version 1.8.7.

BitSeeker:
I had to select libusb-win32(v1.2.6.0) as per online tutorials. By default it showed me WinUSB(v6.1.7600.1635). In device manager, the device shows up in "libusb-win32 devices" as "USBasp". Driver details shows the following is installed:

libusb0.sys
libusb0.dll
libusbk.dll

The device status shows: "This device is working properly."

I trust Windows every time it tells me that.... NOT.
I use a USBasp and IDE 1.8.8 on Windows 10 every day. I don't have this problem. I am using libusbK as Pert suggested.

Just to be sure, I deleted versions 1.8.7 and 1.8.8 and unpacked them again to create a clean instance of each. I then replaced the libusb-win32(v1.2.6.0) that I previously installed following online instructions with the libusbK(v3.0.7.0) driver as suggested by pert. This does seem to have fixed it for both versions, 1.87 and 1.88. Version 1.6.11 still works as does the standalone version. Thanks for the reference link.

So I take it back! IT WAS A DRIVER ISSUE after all!

Thank you pert and Perehama for your help.

BTW, Perehama, I'm not even going to try and figure out that signature!

BitSeeker:
BTW, Perehama, I'm not even going to try and figure out that signature!

There's nothing to figure out... It's all the ways to represent a Farad. When trying to figure out what resistor you need and what capacitor you need in an RC circuit, it's nice to be able to think of capacitors in seconds per ohm, for example.

I'm really glad to hear the libusbK driver solved the issue. This caused me a lot of confusion also when I first started using the newer AVRDUDE. If you read the bug report I submitted, I was never really able to convince Arduino this was a legitimate issue. At that time, I was the only person who was encountering the error. Over time, it has come up a few more times. Now I'm remembering that I did have a VID/PID type of error initially, then it changed to the error message in the bug report after I upgraded to the latest version of libusb-win32 and I couldn't figure out which driver version I had that caused the initial error.

I know it's something specific to Arduino's build of AVRDUDE because if I use the same version of AVRDUDE downloaded from the AVRDUDE website it works fine with libusb-win32.

It's a shame this was never resolved. However, libusbK works fine and has even solved a different bug with my AVRISP mkII programmer and AVRDUDE.