dioannidis / usbasp

usbasp improved firmware
GNU General Public License v2.0
77 stars 12 forks source link

Can't get it working with win10 #30

Open usr97629238 opened 11 months ago

usr97629238 commented 11 months ago

Works perfect across the table on linux, but no matter what I try it won't work with windows (tried with avrdude 7.0 and 7.2_mingw64.zip)

In device manager it's listed under USB Devices as USBasp and is using the winusb.sys driver and USBaspHIDUART.exe sees it connected:

Enumerating USBasp HIDUART (Hid Api Library Version : 0.12.0 )
-----------
USBasp List index : 0

Type : 16C0 05DC
Path : \\?\HID#VID_16C0&PID_05DC&MI_01#8&69f9ab7&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Serial number : 0000
Manufacturer  : www.fischl.de
Product       : USBasp
Release       : 1.11
Interface     : 1

-----------
USBasp List index : 1

Type : 16C0 05DC
Path : \\?\HID#VID_16C0&PID_05DC&MI_02#8&2a76d879&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Serial number : 0000
Manufacturer  : www.fischl.de
Product       : USBasp
Release       : 1.11
Interface     : 2

But avrdude fails at avrdude usbasp_transmit():

avrdude: Version 7.2
         Using Port                    : USB
         Using Programmer              : usbasp
         Setting bit clk period        : 10.0
avrdude: seen device from vendor >www.fischl.de<
avrdude: seen product >USBasp<
avrdude: input file attiny85.ino.hex auto detected as Intel Hex
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         RESET disposition             : possible i/o
         Serial program mode           : yes
         Parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         PollIndex                     : 3
...

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/
avrdude: usbasp_initialize()
avrdude: usbasp_transmit("USBASP_FUNC_GETCAPABILITIES", 0x00, 0x00, 0x00, 0x00)
avrdude usbasp_transmit() [usbasp.c:365] OS error: No such file or directory
avrdude: usbasp_spi_set_sck_period(5e-06)
avrdude: try to set SCK period to 5e-06 s (= 200000 Hz)
avrdude: connected USBasp is not cabable of 3 MHz SCK
avrdude: set SCK frequency to 187500 Hz
avrdude: usbasp_transmit("USBASP_FUNC_SETISPSCK", 0x09, 0x00, 0x00, 0x00)
avrdude usbasp_transmit() [usbasp.c:365] OS error: No such file or directory
avrdude usbasp_spi_set_sck_period() [usbasp.c:979] error: cannot set sck period; please check for usbasp firmware update
avrdude: usbasp_transmit("USBASP_FUNC_CONNECT", 0x00, 0x00, 0x00, 0x00)
avrdude usbasp_transmit() [usbasp.c:365] OS error: No such file or directory
avrdude: usbasp_program_enable()
avrdude: usbasp_transmit("USBASP_FUNC_ENABLEPROG", 0x00, 0x00, 0x00, 0x00)
avrdude usbasp_transmit() [usbasp.c:365] OS error: No such file or directory
avrdude usbasp_spi_program_enable() [usbasp.c:734] error: program enable: target does not answer (0x00)
avrdude main() [main.c:1301] error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower the bit clock frequency, e.g. -B 125kHz
        - use -F to override this check
avrdude: usbasp_close()
avrdude: usbasp_transmit("USBASP_FUNC_DISCONNECT", 0x00, 0x00, 0x00, 0x00)
avrdude usbasp_transmit() [usbasp.c:365] OS error: No such file or directory
avrdude done.  Thank you.

Changing the -B parameter affects nothing.

dioannidis commented 11 months ago

Hi @usr97629238 ,

Is the USBasp's device driver WINUSB ? You can check using the device manager ( the image at https://github.com/dioannidis/usbasp/discussions/29 shows how the USBasp using WINUSB looks like ) .

Also, maybe there are driver conflicts from previous libusb and/or zadig installations . Use device manager to uninstall / delete all the drivers that Windows associates to USBasp device . Using device manager, right click on the usbasp device and uninstall / delete all the drivers assigned to it until windows reports it as unknown . Then unplugged it and plugged it again. It should work .

regards,

usr97629238 commented 11 months ago

Thanks! Uninstalling the drivers somehow fixed it, despite the fact that there weren't any libusb and/or zadig drivers ever installed.

usr97629238 commented 11 months ago

Actually there is more to the issue:

- It turns out it only works until the next disconnect, then (on the next reconnect) it would require another round of uninstall the driver, reconnect the dongle. That's on USB 2.0 ports that are Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller (PCI\VEN_8086&DEV_1C2D&SUBSYS_844D1043&REV_05)

Disregard the 1st issue, that only happens after tinkering with the ASMedia USB 3.0 controller, and that controller is actually known to be flaky as it comes back from the days when USB 3.0 was in beta. Still strange though, never had any problems with any devices, and strange how (and if) that might affect the USB 2.0 controller.

dioannidis commented 11 months ago

Hi,

maybe you should clean the Windows Registry reg. USBasp .

This is how I do it using USBDview . Run USBDView as Administrator, go to Options and check the "Display Disconnected Devices" . Sort the list clicking at the VendorID Header, select all the devices with VendorID = 16c0 and ProductID = 05dc. Right-Click on one of the selected device and uninstall them using the "Uninstall Selected Devices" menu item .

i.e. :

USBDViewClean

Hope it helps .

regards,

usr97629238 commented 11 months ago

Screenshot

Nah, like I've said, there were no other drivers, as I'm usually wary about spamming the system with hacks like zadig and questionable drivers.

dioannidis commented 11 months ago

Hi,

did you uninstalled those devices I see in your post, tried again and you get the same results ?

regards,

usr97629238 commented 10 months ago

Yes, removed all the 5 drivers and did a fresh re-test and here how it goes:

Screenshot

And I now believe that it wasn't working (the first post) because I've inserted it into the ASMedia controller first.

So it's up to you to decide if you want to investigate this any further or just close the issue. My take is that it's due to a flaky ASMedia controller or driver. If you want me to perform any tests of what might be wrong with it - feel free to ask.