Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xinaovo opened this issue Jun 5, 2024 · 22 comments
Open

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

xinaovo opened this issue Jun 5, 2024 · 22 comments

Comments

@xinaovo
Copy link

xinaovo commented Jun 5, 2024

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
Copy link
Author

xinaovo commented Jun 5, 2024

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
Copy link
Owner

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
Copy link
Author

xinaovo commented Jun 6, 2024

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
Copy link
Owner

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

@xinaovo
Copy link
Author

xinaovo commented Jun 7, 2024

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
Copy link
Owner

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

@xinaovo
Copy link
Author

xinaovo commented Jun 9, 2024

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

@wagiminator
Copy link
Owner

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
Copy link
Author

xinaovo commented Jun 17, 2024

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
Copy link
Owner

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

@wagiminator
Copy link
Owner

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
Copy link
Author

xinaovo commented Jul 6, 2024

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
Copy link
Owner

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

@wagiminator
Copy link
Owner

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
Copy link
Author

xinaovo commented Jul 7, 2024

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
Copy link
Author

xinaovo commented Jul 7, 2024

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
Copy link
Owner

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

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

@xinaovo
Copy link
Author

xinaovo commented Jul 30, 2024

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
Copy link
Author

xinaovo commented Jul 30, 2024

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

@wagiminator
Copy link
Owner

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
Copy link
Author

xinaovo commented Aug 1, 2024

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants