PORTS Forum

Ports and Interfaces => USB => Topic started by: goodnewsjim on January 20, 2015, 02:12:38 pm

Title: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on January 20, 2015, 02:12:38 pm
Hello,

I have a project and board that works fine with Windows 8 thanks to Jan, Tsuneo, and other helpful people on Microchip forums.
We're trying to install it on Windows 7 to see what steps we need to push it out the door to clients.

I did a search on this forum, and got lots of information, but I can't seem to get stuff to run...

One thing is that we couldn't find on the Internet is winusb.dll.  Is there a link for that.

With device driver: Winusb.sys the windows 8 phone driver, the driver has an error: This device cannot start (Code 10)

We tried copying the 3 driver files manually from our working windows8 computer:
winusb.sys
WdfCoInstaller01011.dll
and
WinUSBCoInstaller2.dll

But that didn't take.

Also obviously the plug and play of windows 7 installing a driver didn't work.

Any help you guys could provide would be greatly appreciated.  We're about out of things to try.

,Jim
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: Jan Axelson on January 20, 2015, 04:43:21 pm
Does the PC have an INF file with your device's GUID or does the device have MS OS descriptors that contain the GUID?

What does the setupapilog file say?

http://sourcedaddy.com/windows-7/using-setupapi-log-file.html

Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on January 20, 2015, 11:57:34 pm
Thank you for the reply Jan.  I might not get a chance to approach this problem until Monday. 

We use an .inf file with a GUID.

I'm glad you're still answering on forums.  It has been over a year since I last talked with you.

,Jim
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 04, 2015, 01:40:01 pm
Ok Jan, here are some raw data files.
I wonder what the problem is.  If you give me some sort of idea where to go, it'd be great.

Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 04, 2015, 01:40:27 pm
Raw data file winusbdemo.inf:
; Adapted from the example INF in the Microsoft document "How to Use WinUSB to Communicate with a USB Device"

[Version]
Signature = "$Windows NT$"
Class = USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
Provider = %ProviderName%
DriverVer=02/07/2008,1.0.0
;CatalogFile=MyCatFile.cat

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ProviderName% = MyDevice_WinUSB,NTx86,NTamd64

[MyDevice_WinUSB.NTx86]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0925&PID_1456

[MyDevice_WinUSB.NTamd64]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0925&PID_1456

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUSB,0x00000002,WinUSB_ServiceInstall

[WinUSB_ServiceInstall]
DisplayName     = %WinUSB_SvcDesc%
ServiceType     = 1
StartType       = 3
ErrorControl    = 1
ServiceBinary   = %12%\WinUSB.sys

[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install
UmdfServiceOrder=WINUSB

[WinUSB_Install]
KmdfLibraryVersion=1.7

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{42CA71EC-CE1C-44c2-82DE-87D8D8FF6C1E}"

[USB_Install.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WinUSBCoInstaller.dll","WUDFUpdate_01007.dll","WdfCoInstaller01007.dll,WdfCoInstaller"

[CoInstallers_CopyFiles]
WinUSBCoInstaller.dll
WdfCoInstaller01007.dll
WUDFUpdate_01007.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

; ================= Source Media Section =====================

[SourceDisksNames.x86]
1 = %DISK_NAME%,,,\i386

[SourceDisksNames.amd64]
2 = %DISK_NAME%,,,\amd64

[SourceDisksFiles.x86]
WinUSBCoInstaller.dll=1
WdfCoInstaller01007.dll=1
WUDFUpdate_01007.dll=1

[SourceDisksFiles.amd64]
WinUSBCoInstaller.dll=2
WdfCoInstaller01007.dll=2
WUDFUpdate_01007.dll=2

; Copy Files section
;------------------------------------------------------------------------------
[_CopyFiles_sys]
winusb.sys

;************************************************* *****************************
; Destination Directories
;------------------------------------------------------------------------------
[DestinationDirs]
DefaultDestDir = 12 ; %SystemRoot%\system32\drivers
_CopyFiles_sys = 12

; =================== Strings ===================

[Strings]
ProviderName="Lakeview Research"
USB\MyDevice.DeviceDesc="WinUSB Demo"
WinUSB_SvcDesc="WinUSB Demo"
DISK_NAME="My Install Disk"

Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 04, 2015, 01:49:46 pm
here is some from setupapi.dev.  The api file is too long to post, and even was crashing pastebin.com, what parts would you want from it?

http://pastebin.com/sLJvBnZR


Let me know what info you need from me, or if you can supply some information to me.

Thanks a bunch Jan,
Jim
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: Jan Axelson on February 04, 2015, 03:46:07 pm
I would start with winusb.inf in \windows from a PC that is running the edition of Windows you want your INF file to work on.

Save it under a different name.

Delete

pnplockdown=1 

Replace %MS% with your Provider name.

Replace:

[Generic.Section.NTamd64]
%USB\MS_COMP_WINUSB.DeviceDesc%=WINUSB,USB\MS_COMP_WINUSB

with your:

; ========== Manufacturer/Models sections ===========

and edit the section names to match what's in the above section and edit the strings as needed.

For 64-bit Windows, the INF file will need to be digitally signed.

Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 05, 2015, 01:04:55 pm
Jan,

I'm probably more confused than I'm letting on.   How does the Windows Driver Installer know how to find a .inf?  Am I supposed to search for drivers in the directory of an .inf?

It has been a year since I worked on this project, but it for physics universities and they want to get it into production eventually.

,James
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: Jan Axelson on February 05, 2015, 03:26:18 pm
Windows searches in a few defined places for INF files. If it can't find a match, it should ask the user for a location.
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: Barry Twycross on February 05, 2015, 03:50:35 pm
Getting the user to specify an .inf location is an inobvious process. It goes something like this:

1. Browse my computer for driver software
2. Let me pick from a list of device drivers on this computer
3. Have Disk (its a button in the bottom corner).

You then get to point to your .inf file.
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 06, 2015, 05:38:10 pm
Thanks guys.  I'll try that on Monday.
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 09, 2015, 01:28:42 pm
So:

When we try and install drivers it says:  Windows has determined the driver software for your device is up to date.

But in the drivers device manager list it says: This device cannot start.  (and has a yellow !)

I wonder what the problem can be. 

Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: Tsuneo on February 09, 2015, 02:12:58 pm
Quote
When we try and install drivers it says:  Windows has determined the driver software for your device is up to date.

Wipe out the trace of previous INF file from your PC.
Here is the procedure,

0) Plug off your device from the PC

1) Uninstall old device instances on the Device Manager
Make a new text file, "DevManager.bat", and copy these two lines into the file.

set devmgr_show_nonpresent_devices=1
start devmgmt.msc

Right click above DevManager.bat file, "run as administrator", and the Device Manager comes up.
- enable "Show hidden devices" on View menu

Find the device instance of your WinUSB device.
- properties - Hardware ID: USB\VID_0925&PID_1456
Right click on the instance - Uninstall

2) Clean up DriverStrore and oemxx.inf in Windows\inf folder
Run command prompt under administrator privilege (right-click, "run as administrator")
copy these two lines (right click - paste) to the dialog.

cd %WINDIR%\inf
findstr "VID_0925&PID_1456" *.inf

Above "findstr" lists up oemXX.inf (XX: number) file(s), which include your device VID/PID.
Delete these INF files using pnputil (which deletes DriverStore and .pnf files, too)

pnputil -d oemXX.inf


And then, try the new INF file.


Quote
I have a project and board that works fine with Windows 8

But ChkINF utility on WDK points out severe errors on the INF file in your above post.
This INF shouldn't work on Windows 8, too.
I suppose your device is a "WinUSB Device", which gives MS OS descriptors.
And then, you may apply winusbcompat.inf/.cat (**1) to your Win7 PC,

(**1) described on this post to Microchip forum
'MS-official "WinUSB class" driver for XP, Vista and 7'
http://www.microchip.com/forums/m790429.aspx

Tsuneo
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 09, 2015, 02:59:30 pm
Thanks Tsuneo.  I'll try that tomorrow.

I appreciate you guys hand holding me through this. 
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: goodnewsjim on February 10, 2015, 02:31:59 pm
Updates:

The board works directly being connected into a Windows8 machine which is a big time relief, but we can't get it working on Windows7.

Tsuneo: We followed your instructions, but on the findstr, we couldn't find the device you're pointing to, nor our device.  Even when we plug in our device, we don't see it.
We tried different VIDs to search too, since my device is 04D8...

We tried installing that Windows Phone driver, and got the .inf from there, but when plugging the USB cable in, it didn't find it automatically or after a directed directory search.

Hmmm...  You'd think if it recognized it automatically on a windows8 computer, there would just be something you could install on VISTA/7 to do the same thing...?

Any help is appreciated.  I thank you guys for this much help already.  I couldn't do this without you guys!
Title: Re: How do I get the drivers for windows 7 to run Winusb?
Post by: Tsuneo on February 12, 2015, 02:08:43 am
I need more valid confirmation.

Quote
The board works directly being connected into a Windows8 machine
You mean, on Win8 (8.1), WinUSB driver is assigned to the device without installing any INF file. Doesn't it?
- It suggests "WinUSB Device", which provides MS OS descriptors.

Quote
but we can't get it working on Windows7.
We tried installing that Windows Phone driver, and got the .inf from there, but when plugging the USB cable in, it didn't find it automatically or after a directed directory search.

a) Did you uninstall the device instance once on the Device Manager, before plug-in the device to the PC, described on my above post?
- Windows request MS OS descriptors just when there isn't any device instance of the device on the registry.

b) Is the USB port on the Win7 machine USB3.0 one?
- It is known that Renesas USB3.0 driver (2.1.28.1) has a problem around MS OS descriptors.
http://www.microchip.com/forums/m802958.aspx

Anyway, what is the USB example, your device derives from?
Microchip MLA? Which version?

Tsuneo