AVR-Programmer icon indicating copy to clipboard operation
AVR-Programmer copied to clipboard

avrdude does not recognize picoAVR programmer in USBasp mode.

Open xinaovo opened this issue 1 year ago • 23 comments

Hi there. I made a picoAVR and uploaded the pre-compiled firmware in the repository. A WINUSB device with product name picoAVR and a serial device did show up in the device manager. However, when I attempted to detect a chip with avrdude, it complained

avrdude error: cannot find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
avrdude error: unable to open port usb for programmer usbasp

It this problem related to the product name of the programmer? Or special parameter should be added for avrdude? Thank you! 屏幕截图 2024-06-05 084353 屏幕截图 2024-06-05 084939

xinaovo avatar Jun 05 '24 00:06 xinaovo

Hi there. I also tried to use zadig to replace the driver with libusb-win32 and select usbasp-clone model(avrdude only cares the PID and VID in this mode) in avrdude. However, it is still complaining can not find USB device. I hope this screenshot is also helpful. Thank you! image

xinaovo avatar Jun 05 '24 11:06 xinaovo

Do you have a "normal" USBasp? If so, does it work? I'm asking because there can generally be problems with newer versions of Windows (regardless of the USBasp device itself). I only have Linux myself and it works without any problems.

wagiminator avatar Jun 05 '24 12:06 wagiminator

Do you have a "normal" USBasp? If so, does it work? I'm asking because there can generally be problems with newer versions of Windows (regardless of the USBasp device itself). I only have Linux myself and it works without any problems.

well, no... the reason I made this programmer is that I have a bricked Zhifengsoft and I want to burn a USBasp firmware for it. However, picoASP did work fine under a linux vm. So I guess the problem is related to Windows driver and avrdude instead of the firmware. image

xinaovo avatar Jun 06 '24 02:06 xinaovo

That's what I suspected too. Unfortunately, I can't really get to the bottom of the matter without a Windows PC.

wagiminator avatar Jun 06 '24 11:06 wagiminator

Today, I used the picoASP to burn a proper USBasp firmware to the bricked fake "Zhifengsoft USBISP" under Linux. The USBISP with USBasp firmware works fine under both Linux and Windows. Just like before, I used zadig to replace its driver into libusb-win32. Afterward, the avrdude DID recognize it. This means a normal USBasp works fine under Windows. However, the picoASP with libusb-win32 driver still can't be detected by avrdude, which is a bit weird. The picture shows the USBasp recognized by avrdude under Windows. image

xinaovo avatar Jun 07 '24 13:06 xinaovo

That's really strange. If I ever get sufficient access to a Windows PC, I'll look into it more closely.

wagiminator avatar Jun 08 '24 09:06 wagiminator

perhaps you can use a Windows VM and redirects the picoASP device into the VM to test it?

xinaovo avatar Jun 09 '24 04:06 xinaovo

I have now tested both the picoAVR and an "original" USBasp on a Windows 10 PC. Neither worked (as you described). Do you have a link to the firmware that you uploaded to your USBasp? Maybe the source code is there, then I can look at what was done differently.

wagiminator avatar Jun 16 '24 07:06 wagiminator

I got the firmware on this repository and the file link is here. I'm not sure if there's different between this firmware and the original firmware from here. Also, you might need to install a libusb-win32 driver for your USBasp with zadig.

xinaovo avatar Jun 17 '24 00:06 xinaovo

Thank you. As soon as I have some time, I will get to the bottom of it.

wagiminator avatar Jun 22 '24 15:06 wagiminator

I bought one of those USB ISP clones. I was able to upload the "USBasp" firmware without any problems following the instructions on the page you linked. However, the device now doesn't work on either Linux or Windows. Very strange... USB_ISP_v2

wagiminator avatar Jul 06 '24 09:07 wagiminator

I bought one of those USB ISP clones. I was able to upload the "USBasp" firmware without any problems following the instructions on the page you linked. However, the device now doesn't work on either Linux or Windows. Very strange... USB_ISP_v2

Hmmm, have you removed the 0r resistor(shown in the picture 1) near the silkscreen "A"? It seems it won't work if you didn't remove this resistor in my case. 1 1720270371912

xinaovo avatar Jul 06 '24 12:07 xinaovo

Oh, I guess I forgot something ... ;-)

wagiminator avatar Jul 06 '24 17:07 wagiminator

I desoldered the resistor, and it then worked under Linux. It didn't work with the libusb-win32 driver under Windows, but it did with WinUSB. So I thought, I'll just install the WinUSB driver for the picoAVR as well. To do this, select this driver in Zadig, then click the arrow next to the Install button and select "Install driver". The button text will then change to "Replace driver". After installation, the picoAVR also worked for me under Windows, at least until unplugging and plugging it back in. Then I had to repeat this procedure. Maybe it's due to the WCID. Please try it out and see if it works for you as well.

wagiminator avatar Jul 07 '24 11:07 wagiminator

I desoldered the resistor, and it then worked under Linux. It didn't work with the libusb-win32 driver under Windows, but it did with WinUSB. So I thought, I'll just install the WinUSB driver for the picoAVR as well. To do this, select this driver in Zadig, then click the arrow next to the Install button and select "Install driver". The button text will then change to "Replace driver". After installation, the picoAVR also worked for me under Windows, at least until unplugging and plugging it back in. Then I had to repeat this procedure. Maybe it's due to the WCID. Please try it out and see if it works for you as well.

So you mean both the USBasp and the picoAVR works fine under Windows using WinUSB driver? If so, I will test it out as soon as I have access to the hardware(I think I can test it a couple weeks later since I'm not at home these weeks.).

xinaovo avatar Jul 07 '24 15:07 xinaovo

Hi there. I made a picoAVR and uploaded the pre-compiled firmware in the repository. A WINUSB device with product name picoAVR and a serial device did show up in the device manager. However, when I attempted to detect a chip with avrdude, it complained

avrdude error: cannot find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
avrdude error: unable to open port usb for programmer usbasp

It this problem related to the product name of the programmer? Or special parameter should be added for avrdude? Thank you! 屏幕截图 2024-06-05 084353 屏幕截图 2024-06-05 084939

In the first comment, the Windows installed WinUSB driver for picoASP automatically, but it didn't work either. Perhaps there're some difference between your Windows and my Windows? Can you provide me with something related to your Windows' version?

xinaovo avatar Jul 07 '24 15:07 xinaovo

That's certainly possible and another reason against using Windows for MCU software development ;-)

"My" Windows: Windows 10 Pro, version 22H2.

wagiminator avatar Jul 07 '24 15:07 wagiminator

Really strange... I got the picoASP today and plug it into my PC, then opened up the AVRDUDESS and selected the corect programmer model as well as the MCU model. Then something miracle happened, it works just fine without tossing the driver and something else! The driver is still libusb-win32, but something different is that the device name shown in the device manager, which changed from picoASP to USBasp. I think this is because I used to plug the "original" USBasp to this PC and installed driver for it. Then when I plugged the picoASP with same VID and PID to this PC, it simply recognized the picoASP as a "original" USBasp, so it works fine. So is this means before you use a picoASP, you have to plug a original USBasp and install driver for it? How weird! image

xinaovo avatar Jul 30 '24 13:07 xinaovo

btw, the Windows11 running on this PC has been updated to 22631.3880, but I don't think it's relevant.

xinaovo avatar Jul 30 '24 13:07 xinaovo

I think this is because the picoASP behaves exactly like a USBasp. In contrast, the picoAVR adds a COM port. This likely causes some confusion for Windows.

wagiminator avatar Jul 31 '24 09:07 wagiminator

I think so. The serial port disappeared after installing driver for the original usbasp, as the screenshot shows. Something I'm curious is that is your "working" picoASP showing serial port on the PC?

xinaovo avatar Aug 01 '24 05:08 xinaovo

I hadn't paid any attention to that, I'll try it again soon.

wagiminator avatar Aug 01 '24 19:08 wagiminator

Avrdude v7+ uses libwinusb instead of libusb, which doesn't support composite devices. Please use the unofficial build using mingw64 ( avrdude-mingw-* ) from mcuee repo.

Rinat84 avatar Mar 31 '25 09:03 Rinat84