Author Topic: USB LVR WinUSB getting started Unexpected Exception Not Found  (Read 15994 times)

bebetxx

  • Member
  • ***
  • Posts: 11
USB LVR WinUSB getting started Unexpected Exception Not Found
« on: October 20, 2013, 04:31:00 pm »
Good day people and Jan,

I recently bought the book(quite hard for me), and firstly I was able to make easy the Microchip WinUSB example to work after a few days of working. Because my project needs a transfer between 4 and 5 Mega bits/s I decided to use the Jan Axelson's WinUSB bulk transfer example from the Download. I downloaded it, and I was able to program in my PIC18F4550. Then I created a folder with the following files: "WdfCoInstaller01009.dll", "winusbcoinstaller2.dll" and the INF file provided by Jan in winusb_cs archive. The driver was installed correctly and Windows says me that the hardware is ready to use. After I compiled the Visual C++ example which sends data as bulk I receive the following error:

Message Title: Unexpected Exception
Content: Exception: Not Found
Module: FrmMain
Method: ThrowWithExtendedInfo

I used Visual C++ debug system and I was able to find that the software it is not able to find it properly the device and it throws this error message.

Can anyone give me a hint of how to make it work properly? Is there any website of how to make everything right step by step(compilling the firmware, the software) or a video?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #1 on: October 20, 2013, 05:22:47 pm »
Follow these instructions and you don't need an INF file:

http://blogs.msdn.com/b/usbcoreblog/archive/2012/09/26/how-to-install-winusb-sys-without-a-custom-inf.aspx

The setupapilog file can help you find out what is going wrong:

http://support.microsoft.com/kb/927521

bebetxx

  • Member
  • ***
  • Posts: 11
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #2 on: October 21, 2013, 01:21:51 am »
Do I need to change anything from your firmware source code or from the Visual C++ project?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #3 on: October 21, 2013, 09:49:15 am »
My WinUSB example is C#. My latest Microchip code includes the needed OS descriptors with the GUID.

bebetxx

  • Member
  • ***
  • Posts: 11
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #4 on: October 22, 2013, 07:07:57 am »
Can I also use the tutorial from Microsoft http://blogs.msdn.com/b/usbcoreblog/archive/2012/09/26/how-to-install-winusb-sys-without-a-custom-inf.aspx to install the driver from your example also on Windows XP or 7?

Thank you again Jan, and very shortly I will tell you if I was able to install the driver correctly and I can use your Visual C# software example.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #5 on: October 22, 2013, 10:17:14 am »
yes

bebetxx

  • Member
  • ***
  • Posts: 11
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #6 on: October 23, 2013, 05:37:39 pm »
I read the article but it doesn't say anything about how to do exactly in order to install the driver http://blogs.msdn.com/b/usbcoreblog/archive/2012/09/26/how-to-install-winusb-sys-without-a-custom-inf.aspx .

I tried the steps from http://msdn.microsoft.com/en-us/library/windows/hardware/ff540283(v=vs.85).aspx#inf but I get an error  "The required section was not found in the INF". There is no file called MyCatFile.cat and I have two folders called winusb and wdf from WinDDK

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #7 on: October 23, 2013, 05:58:00 pm »
If you are using a 64-bit Windows edition, the INF file must be digitally signed. (That is one reason to use the Windows-provided INF file.)

You can test-sign the INF file for use on your computer only:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff546236%28v=vs.85%29.aspx

bebetxx

  • Member
  • ***
  • Posts: 11
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #8 on: October 24, 2013, 02:05:08 am »
Nothing works. Why you guys don't want to explain better of how to do or just publish an archive which contains the driver for the first run.

I have the following files:
winusbdemo.inf
i386\WdfCoInstaller01009.dll
i386\winusbcoinstaller2.dll
i386\WUDFUpdate_01009.dll
amd64\WdfCoInstaller01009.dll
amd64\winusbcoinstaller2.dll
amd64\WUDFUpdate_01009.dll


the inf file:
Code: [Select]
; ; 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={ecceff35-146c-4ff3-acd9-8f992d09acdd}
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_150C

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

; =================== 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,"winusbcoinstaller2.dll","WUDFUpdate_01009.dll","WdfCoInstaller01009.dll,WdfCoInstaller"

[CoInstallers_CopyFiles]
winusbcoinstaller2.dll
WdfCoInstaller01009.dll
WUDFUpdate_01009.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

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

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

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

[SourceDisksFiles.x86]
WdfCoInstaller01009.dll=1
winusbcoinstaller2.dll=1
WUDFUpdate_01009.dll=1

[SourceDisksFiles.amd64]
winusbcoinstaller2.dll=2
WdfCoInstaller01009.dll=2
WUDFUpdate_01009.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"


setupapi.log
Code: [Select]
[2013/10/24 09:41:37 772.3 Driver Install]
#-019 Searching for hardware ID(s): usb\vid_0925&pid_150c&rev_0100,usb\vid_0925&pid_150c
#-018 Searching for compatible ID(s): usb\ms_comp_winusb,usb\class_ff&subclass_ff&prot_ff,usb\class_ff&subclass_ff,usb\class_ff
#-198 Command line processed: C:\WINDOWS\system32\services.exe
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#W059 Selecting best compatible driver failed. Error 0xe0000228: There are no compatible drivers for this device.
#W157 Default installer failed. Error 0xe0000228: There are no compatible drivers for this device.
[2013/10/24 09:41:39 5400.2]
#-199 Executing "C:\WINDOWS\system32\rundll32.exe" with command line: rundll32.exe newdev.dll,ClientSideInstall \\.\pipe\PNP_Device_Install_Pipe_0.{E4FAAEDA-F6BA-40A3-8EA1-D81BEE8D60C0}
#I060 Set selected driver.
#-019 Searching for hardware ID(s): usb\vid_0925&pid_150c&rev_0100,usb\vid_0925&pid_150c
#-018 Searching for compatible ID(s): usb\ms_comp_winusb,usb\class_ff&subclass_ff&prot_ff,usb\class_ff&subclass_ff,usb\class_ff
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#W059 Selecting best compatible driver failed. Error 0xe0000228: There are no compatible drivers for this device.
#W157 Default installer failed. Error 0xe0000228: There are no compatible drivers for this device.
#I060 Set selected driver.
#-019 Searching for hardware ID(s): usb\vid_0925&pid_150c&rev_0100,usb\vid_0925&pid_150c
#-018 Searching for compatible ID(s): usb\ms_comp_winusb,usb\class_ff&subclass_ff&prot_ff,usb\class_ff&subclass_ff,usb\class_ff
#-019 Searching for hardware ID(s): usb\vid_0925&pid_150c&rev_0100,usb\vid_0925&pid_150c
#-018 Searching for compatible ID(s): usb\ms_comp_winusb,usb\class_ff&subclass_ff&prot_ff,usb\class_ff&subclass_ff,usb\class_ff
#I022 Found "USB\VID_0925&PID_150C" in c:\usbdevice\winusbdemo.inf; Device: "WinUSB Demo"; Driver: "WinUSB Demo"; Provider: "Lakeview Research"; Mfg: "Lakeview Research"; Section name: "USB_Install".
#I087 Driver node not trusted, rank changed from 0x00000001 to 0x00008001.
#I023 Actual install section: [USB_Install]. Rank: 0x00008001. Effective driver date: 02/07/2008.
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#I063 Selected driver installs from section [USB_Install] in "c:\usbdevice\winusbdemo.inf".
#I320 Class GUID of device remains: {ECCEFF35-146C-4FF3-ACD9-8F992D09ACDD}.
#I060 Set selected driver.
#I058 Selected best compatible driver.
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#I063 Selected driver installs from section [USB_Install] in "c:\usbdevice\winusbdemo.inf".
#I320 Class GUID of device remains: {ECCEFF35-146C-4FF3-ACD9-8F992D09ACDD}.
#I060 Set selected driver.
#I058 Selected best compatible driver.
[2013/10/24 09:42:00 5400.5]
#-199 Executing "C:\WINDOWS\system32\rundll32.exe" with command line: rundll32.exe newdev.dll,ClientSideInstall \\.\pipe\PNP_Device_Install_Pipe_0.{E4FAAEDA-F6BA-40A3-8EA1-D81BEE8D60C0}
#I140 Installing device class: "USB" {ecceff35-146c-4ff3-acd9-8f992d09acdd}.
#E067 Could not locate section [ClassInstall32].
#E142 Class: {ECCEFF35-146C-4FF3-ACD9-8F992D09ACDD}. Install failed. Error 0xe0000101: The required section was not found in the INF.

Please tell me what I am doing wrong. Please write more details, about how to install the driver.
« Last Edit: October 24, 2013, 02:49:02 am by bebetxx »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #9 on: October 24, 2013, 10:10:45 am »
The setupapi log says that your INF file isn't trusted (not signed)

#I022 Found "USB\VID_0925&PID_150C" in c:\usbdevice\winusbdemo.inf; Device: "WinUSB Demo"; Driver: "WinUSB Demo"; Provider: "Lakeview Research"; Mfg: "Lakeview Research"; Section name: "USB_Install".
#I087 Driver node not trusted, rank changed from 0x00000001 to 0x00008001.

The system winusb.inf will work only if you have the required Microsoft OS descriptors that contain your device's GUID.

bebetxx

  • Member
  • ***
  • Posts: 11
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #10 on: October 28, 2013, 04:02:53 am »
How can I fix that problem in order to install the driver correctly on my Windows XP machine?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #11 on: October 28, 2013, 10:06:00 am »
Does your device have the required Microsoft OS descriptors? See Microchip's example code.
« Last Edit: October 28, 2013, 10:54:50 pm by Jan Axelson »

bebetxx

  • Member
  • ***
  • Posts: 11
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #12 on: October 29, 2013, 06:34:06 am »
The Device's firmware is the same with LVR's firmware. When I plug the device onto a Windows 8 x64 machine, the device is recognized automatically, installed and actually the Visual Studio's example software is able to send and receive bulk data via USB. But when I try to install the driver(Windows Driver Kit along with the inf file provided by the LVR example) I get that error. What should I do in order to install it also on my Windows XP machine?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB LVR WinUSB getting started Unexpected Exception Not Found
« Reply #13 on: October 29, 2013, 03:49:38 pm »
Try the INF file that comes with the Microchip WinUSB example.

Save a copy using a different filename.

Comment out this line; the cat file won't be valid after you edit the INF:

CatalogFile=mchpwinusb.cat

Replace the Vendor and Product IDs with your device's values.

Replace the GUID with the GUID in your application.