-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use windows's winusb driver #5
Use windows's winusb driver #5
Conversation
…e are compatible with the winusb driver.
Hi, in case after you flashed the firmware it doesn't work automatically, you must delete the device associated key in usbflags from the windows registry. Windows stores all the usb devices that answer or not the os string descriptor call. If the device doesn't answer the os string descriptor call, windows store that information in the registry and doesn't call again for that device "triplet" so it won't load the winusb driver. If the device answers, then it stores that it needs to call during enumeration, for feature descriptor associated with the MS_VENDOR_CODE. The registry key is : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags<VVVVPPPPRRRR> meaning that for usbasp 1.07 is : Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\16C005DC0107 |
Why is the OS String descriptor array 18 bytes long, but bLength is 20 (0x14)? |
Hi,
Because this is what the caller requires. "Version 1.00 of the OS string descriptor has a fixed length of 18 bytes, with a structure as shown in the following table. This format MUST be used by all OS string descriptors.
Length: An unsigned byte and MUST be set to 0x14. Type: An unsigned byte and MUST be set to 0x03. Signature: A Unicode string and MUST be set to "MSFT100". MS Vendor Code: An unsigned byte, it will be used to retrieve associated feature descriptors. Pad: An unsigned byte and MUST be set to 0x00." See "3.3.5.3.9 Processing an OS Descriptor request" https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeusb/c2f351f9-84d2-4a1b-9fe3-a6ca195f84d0.
Maybe you're right. I personally prefer it as an array in progmem because it's a simple array as stated in the "3.3.5.3.9 Processing an OS Descriptor request" document : "•The Signature field contains a Unicode character array that identifies the descriptor as an OS string descriptor and includes the version number. For version 1.00, this array must be set to "MSFT100" (0x4D00 0x5300 0x4600 0x5400 0x3100 0x3000 0x3000)." |
Hi, I added some comments explaining in general the mechanism. EDIT: As I re-read the "Microsoft OS Descriptors for USB Devices" I missed that this process is supported and in Windows 7, so you can test it on your windows box. |
This link says 18 (0x12), which makes more sense:
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-interface-model-supplement
I can't test it anyway, so I probably won't merge it.
…On Sat, Mar 20, 2021, 17:31 Dimitrios Chr. Ioannidis < ***@***.***> wrote:
Hi,
Why is the OS String descriptor array 18 bytes long, but bLength is 20
(0x14)?
Because this is what the caller requires.
"Version 1.00 of the OS string descriptor has a fixed length of 18 bytes,
with a structure as shown in the following table. This format MUST be used
by all OS string descriptors.
Length Type Signature MS Vendor Code Pad
0x14 0x03 MSFT100 unsigned byte 0x00
Length: An unsigned byte and MUST be set to 0x14."
See "3.3.5.3.9 Processing an OS Descriptor request"
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeusb/c2f351f9-84d2-4a1b-9fe3-a6ca195f84d0
.
I think the code would be cleaner using a UTF-16 string initialization.
i.e. u“MSFT100”.
Maybe you're right. I personally prefer it as an array in progmem because
it's a simple array as stated in the "3.3.5.3.9 Processing an OS Descriptor
request" document :
"•The Signature field contains a Unicode character array that identifies
the descriptor as an OS string descriptor and includes the version number.
For version 1.00, this array must be set to "MSFT100" (0x4D00 0x5300 0x4600
0x5400 0x3100 0x3000 0x3000)."
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKNZ6RSE2Q3SEICA56YNN3TEUAZLANCNFSM4ZO3H45Q>
.
|
Hi,
IMHO, you can test it on your windows 7 box but it's your call. |
The MS docs are inconsistent and even contradictory in places. I guess I'll give it a try and see. I'll bump the release number (bcdDevice) to ensure the cached libusb driver association isn't used. |
@dioannidis, is there a reason why this is in RAM, and not flash? I was going to open an issue in your fork, but you don't seem to have it enabled. |
I cloned your fork, turned on -Wextra, and found some warnings that I think should be cleaned up:
|
Hi,
For no specific reason except that I used Marius code . If you look at the code above typedef's you'll see a comment : "/* TODO: Change them to progmem consts */" |
Hi, < snip >
As I don't have a box or vm with windows 7 ( and didn't had the time to setup one ) I'm curious to see if it works as Microsoft claims . |
…entioned in nerdralph/usbasp#5 (comment) . Rebuild the atmega8 firmware.
Hi,
< snip >
Moved to flash. Tested in Windows 10 64bit. I don't think there is anything more to do. @nerdralph, If there is something I missed, I'll be happy to fix it. regards, |
Add OS Descriptor support and report to windows (
8.1 and up) that we are compatible with the winusb driverand use that. No need for zadig or libusb anymore.EDIT: Forgot to mention, that this patch is based on the work done by Marius Greuel @mariusgreuel at repo USBasp. Because, the code, it was too intrusive for me, I modify it to work without the need to change the V-USB code at all.