PORTS Forum
Ports and Interfaces => USB => Topic started by: ADB on November 15, 2019, 05:55:58 am
-
Hi Jan,
I've developed a C++ console program to communicate with a microcontroller board using a Winusb template in Visual Studio 2017. My program is in 2 parts, a USB application using WindowsApplicationForDrivers10.0 platform which is a dll. The 2nd part is an exe application which calls the aforementioned dll and also uses WindowsApplicationForDrivers10.0 platform. The program works fine from within Visual Studio. I followed the procedure here to deploy:
https://docs.microsoft.com/en-us/cpp/windows/walkthrough-deploying-a-visual-cpp-application-by-using-a-setup-project?view=vs-2019
Unfortunately the deployed program is unable to communicate over USB.
Do you have any experience with this?
Regards,
Alan
-
Hard to say without more information. What do you mean by "unable to communicate over USB"? What happens when you run the application? Where does it fail?
-
Hi Jan,
Thank you for getting back to me. I have been doing my development on Windows 10 with Visual Studio 2017. I've been able to get my hands on a laptop with a fresh installation of Windows 10. I was able to add debug comments to my application and compare them to what I was seeing on my development machine.
My USB device has 2 interfaces. I've used Microsoft OS descriptors to specify that I want to use winusb. My USB device's 2 interfaces were coming up correctly in Windows' device manager as using winusb. Upon closer examination of the registry here:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_1FC9&PID_008A&MI_03\6&2ccef474&36&0003\Device Parameters
I noticed that neither of my USB interfaces had DeviceInterfaceGUIDs. Once I created these keys manually, my PC application worked ok.
Does this mean that I haven't implemented my Microsoft OS descriptors correctly?
Thanks in advance for your comments,
Regards,
Alan
-
That could explain it.
If you make any changes to the descriptors, to keep Windows from using previous descriptors, with the device attached, open Windows Device Manager and uninstall the device (under Driver). Then reattach.
-
Is upping the descriptors version number sufficient to get around Windows descriptor caching?
-
You can change idProduct or bcdDevice.