Author Topic: How do I get the drivers for windows 7 to run Winusb?  (Read 13727 times)

goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
How do I get the drivers for windows 7 to run Winusb?
« 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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #1 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


goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #2 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

goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #3 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.


goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #4 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"


goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #5 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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #6 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.


goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #7 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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #8 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.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #9 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.

goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #10 on: February 06, 2015, 05:38:10 pm »
Thanks guys.  I'll try that on Monday.

goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #11 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. 


Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #12 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

goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #13 on: February 09, 2015, 02:59:30 pm »
Thanks Tsuneo.  I'll try that tomorrow.

I appreciate you guys hand holding me through this. 

goodnewsjim

  • Frequent Contributor
  • ****
  • Posts: 52
Re: How do I get the drivers for windows 7 to run Winusb?
« Reply #14 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!