Skip to content
New issue

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

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

Already on GitHub? # to your account

Windows Device Manager shows error: "This device cannot start. (Code 10)" #2

Closed
stefandz opened this issue Aug 19, 2015 · 7 comments
Closed
Assignees
Labels
conclusion: resolved Issue was resolved type: imperfection Perceived defect in any part of project

Comments

@stefandz
Copy link

I just end up with a composite device in Device Manager that has This device cannot start. (Code 10) as its status. Board is Leonardo, Arduino Build is 1.6.6 2015/08/19 10:30, code is MIDIUSB_test.ino, OS is Windows 7 x86 64.

@stefandz stefandz changed the title Can't get this working in Windows Can't get this working in Windows 7 x86 64 Aug 19, 2015
@stefandz
Copy link
Author

Hi @facchinm - happy to help with anything I can at this end. Nice to see the commits resulting in a generic composite device now 👍 Can't wait for that to hit the mainstream!

@facchinm
Copy link
Contributor

facchinm commented Sep 1, 2015

Hi @stefandz , I had tested the library on XP and it was working so I thought everything was ok even on 7... I obviously was wrong 😄
As a workaround you could modify two lines in the core

diff --git a/hardware/arduino/avr/cores/arduino/USBCore.cpp b/hardware/arduino/avr/cores/arduino/USBCore.cpp
index f12d326..8374862 100644
--- a/hardware/arduino/avr/cores/arduino/USBCore.cpp
+++ b/hardware/arduino/avr/cores/arduino/USBCore.cpp
@@ -68,10 +68,10 @@ const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER;
 #define DEVICE_CLASS 0x02

 //     DEVICE DESCRIPTOR
-const DeviceDescriptor USB_DeviceDescriptor =
+const DeviceDescriptor USB_DeviceDescriptorB =
        D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);

-const DeviceDescriptor USB_DeviceDescriptorB =
+const DeviceDescriptor USB_DeviceDescriptor =
        D_DEVICE(0xEF,0x02,0x01,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);

 //==================================================================

I believe the bug is due to how Windows Vista and successors handle USB descriptors (much more compliant with standards than XP, Linux and OSX).
The patch is not so safe so it would require a lot of testing before merging, however if you could try it and report the results it would be great!

@NicoHood
Copy link

NicoHood commented Sep 1, 2015

Thats what I also said about HID. the descriptor is technically wrong. It has to be different if its an HID device + Serial, Serial only etc. But its hard to add this to a pluggable USB-Core, I am aware of that. But this can cause you some trouble on several PCs. I dont know if you followed the Windows 10 issue (that got solved with the pluggable HID for some reason) but this could have been a similar issue. I still dont know why Pluggable HID solved the Windows 10 bug though.

@stefandz
Copy link
Author

stefandz commented Sep 9, 2015

I shall get on to testing this when I have some time, hopefully next week. @NicoHood - is it not possible to just use a 0x00, 0x00, 0x00, ... device descriptor as a general composite device descriptor no matter what the actual implemented interfaces are, leaving the OS to take a look at the interface descriptors and assign drivers appropriately? Also, what (if anything) is the difference between a 0x00, 0x00, 0x00, ... descriptor and a 0xEF, 0x02, 0x01, ... descriptor? As far as I understand, they are equivalent - but I feel I must be wrong!

@NicoHood
Copy link

NicoHood commented Sep 9, 2015

Normally zeros work, yes. But this could cause some issues on some Os. It is just an idea that you can test.

@agdl
Copy link
Member

agdl commented Jan 29, 2016

Hi all after the PR made by @sandeepmistry that I merged it works good on windows

#10

Can you please try now? I also released it in the library manager wit the tag 1.0.1

@facchinm
Copy link
Contributor

Should be working now (all core have been updated accordingly)

@per1234 per1234 changed the title Can't get this working in Windows 7 x86 64 Windows Device Manager shows error: "This device cannot start. (Code 10)" Aug 11, 2023
@per1234 per1234 added type: imperfection Perceived defect in any part of project conclusion: resolved Issue was resolved labels Aug 11, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
conclusion: resolved Issue was resolved type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants