wagiminator / AVR-Programmer

Collection of AVR Programmers and Accessories
Other
153 stars 28 forks source link

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

Open xinaovo opened 5 months ago

xinaovo commented 5 months 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 5 months 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 5 months 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 5 months 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 5 months 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 5 months 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 5 months ago

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

xinaovo commented 5 months ago

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

wagiminator commented 5 months 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 5 months 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 5 months ago

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

wagiminator commented 4 months 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 4 months 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 4 months ago

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

wagiminator commented 4 months 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 4 months 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 4 months 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 4 months ago

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

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

xinaovo commented 3 months ago

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 commented 3 months ago

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

wagiminator commented 3 months ago

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.

xinaovo commented 3 months ago

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?

wagiminator commented 3 months ago

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