wagiminator / AVR-Programmer

Collection of AVR Programmers and Accessories
Other
133 stars 27 forks source link

avrdude does not recognize picoAVR programmer in USBasp mode. #9

Open xinaovo opened 1 month ago

xinaovo commented 1 month ago

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 commented 1 month ago

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

wagiminator commented 1 month ago

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.

xinaovo commented 1 month ago

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

wagiminator commented 1 month ago

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

xinaovo commented 1 month ago

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

wagiminator commented 1 month ago

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

xinaovo commented 4 weeks ago

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

wagiminator commented 3 weeks ago

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.

xinaovo commented 3 weeks ago

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.

wagiminator commented 2 weeks ago

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

wagiminator commented 2 days ago

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

xinaovo commented 2 days ago

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

wagiminator commented 1 day ago

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

wagiminator commented 1 day ago

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.

xinaovo commented 1 day ago

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 commented 1 day ago

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?

wagiminator commented 1 day ago

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

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