daynix / UsbDk

Usb Drivers Development Kit for Windows
Apache License 2.0
535 stars 142 forks source link

FTDI 2232H based devices don't show up #33

Closed tsailer closed 7 years ago

tsailer commented 7 years ago

FTDI 2232H based devices (VID 0403 PID 6010) don't show up in UsbDkController.exe -n

The following is a trace from when attaching the FTDI device. I fear it's quite empty... https://sailer.fedorapeople.org/trace.zip

This is with UsbDk_1.0.15_x64

dmitryfleytman commented 7 years ago

The log is not empty.

dmitryfleytman commented 7 years ago

@tsailer, the log is short indeed. Is it a log of device attach (physical plug-in) or enable via device manager?

tsailer commented 7 years ago

This is a physical plug in. The device is already configured and Windows just loads the FTDI driver

dmitryfleytman commented 7 years ago

I don't see bus re-enumeration events. It looks like UsbDk was not properly installed. Did you use MSI package to install it? Did installer ask to reboot the system after installation?

tsailer commented 7 years ago

I did use MSI. And I rebooted (I think it asked, but I did anyway). Then when it didn't work I did subdkcontroller -u and then usbdkcontroller -i

dmitryfleytman commented 7 years ago

Could you please check in regedit, that

HKLM\System\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\ UpperFilters

contains string "UsbDk"? Is there anything else except UsbDk?

Also, what is your USB controller? Could you post dump of UsbView output (https://github.com/daynix/UsbDk/blob/master/Documentation/UsbInfo.txt)?

tsailer commented 7 years ago

See for yourself. Spoiler: UpperFilters is UsbDk.

ftdi.reg.txt

dmitryfleytman commented 7 years ago

Ok, could you please post dump of UsbView. With your device attached, of course.

tsailer commented 7 years ago

Still downloading the SDK, will take at least one more hour

tsailer commented 7 years ago

Intel Mobile 5th Gen EHCI

tsailer commented 7 years ago

usbview segfaults on dump (it starts up with the GUI window though)

tsailer commented 7 years ago

usbview1

dmitryfleytman commented 7 years ago

I see, if UsbView starts with GUI, try to save log with File->Save All... I would like to see your USB HC and Root hubs topology.

Also could you please provide installation log of UsbDk? You need to uninstall it with "usbdkcontroller -u" and the collect log produced during "usbdkcontroller -i".

Thanks!

On 31 Jan 2017, at 19:20, Thomas Sailer notifications@github.com wrote:

usbview segfaults on dump (it starts up with the GUI window though)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

tsailer commented 7 years ago

The problem is, Save from the GUI makes USBView crash too.

Without the docking station, save as text at least works, save as XML still crashes it

Without the FTDI device: USBViewAll.txt

With the FTDI device: USBViewAll2.txt

dmitryfleytman commented 7 years ago

Thanks!

Could you also provide installation log of UsbDk? You need to uninstall it with "usbdkcontroller -u" and the collect log produced during "usbdkcontroller -i"?

tsailer commented 7 years ago

Here you go: usbdkinstall.txt

Uninstall did not produce any log entries

dmitryfleytman commented 7 years ago

I don't see any UsbDk log entries there. Did you use the same UsbDk logging script?

tsailer commented 7 years ago

No just usbdkcontroller -i. What script do I need to use?

dmitryfleytman commented 7 years ago

I mean script for tracing, UsbDkTraceToFile.bat.

tsailer commented 7 years ago

https://sailer.fedorapeople.org/trace1.zip

Both uninstall, then install

dmitryfleytman commented 7 years ago

Parsed log is here Thanks, I'll investigate it.

tsailer commented 7 years ago

Similar to Issue #21 ? This is Windows 7 (x64) too.

dmitryfleytman commented 7 years ago

Hi @tsailer ,

I did a change in UsbDk that should fix the problem you observe and prepared a test build. Could you please give it a try and collect a new install and plug-in traces in case it does not work?

You will need to enable test signing mode on your system in order to load this driver, see instructions here Also, please uninstall original UsbDk version before installing this one.

tsailer commented 7 years ago

Enumerate USB devices Found 6 USB devices:

  1. FilterID: 1, Port: 1, ID: 8087:8001, Configs: 1, Speed: 3 USB\VID_8087&PID_8001 1 Descriptor for configuration #0: size 25
  2. FilterID: 3, Port: 3, ID: 8087:0a2a, Configs: 1, Speed: 2 USB\VID_8087&PID_0A2A 3 Descriptor for configuration #0: size 177
  3. FilterID: 3, Port: 6, ID: 1bcf:2b8d, Configs: 1, Speed: 3 USB\VID_1BCF&PID_2B8D 6 Descriptor for configuration #0: size 737
  4. FilterID: 3, Port: 7, ID: 0a5c:5804, Configs: 1, Speed: 2 USB\VID_0A5C&PID_5804 0123456789ABCD Descriptor for configuration #0: size 269
  5. FilterID: 5, Port: 1, ID: 0403:6010, Configs: 1, Speed: 3 USB\VID_0403&PID_6010 AX00000003 Descriptor for configuration #0: size 55
  6. FilterID: 9, Port: 1, ID: 0403:6010, Configs: 1, Speed: 2 FTDIBUS\VID_0403+PID_6010+AX00000003B 0000 Descriptor for configuration #0: size 32

Much better, thanks !

tsailer commented 7 years ago

There is one weirdness:

When trying to use the FTDI supplied driver with UsbDk installed, I get: Driver file operation error. DeviceIoControl failed (The system cannot find the file specified. Error code = 2) But it still seems to work, after a couple of seconds delay. This output must come out of the FTDI supplied DLL

dmitryfleytman commented 7 years ago

This printout is from UsbDk API DLL, If you collect UsbDk trace we will know what happens exactly.

dmitryfleytman commented 7 years ago

Original issue fixed by db95b4651e079e59353d8bafa84cc5ad23c4f2b1

tsailer commented 7 years ago

https://sailer.fedorapeople.org/trace2.zip

dmitryfleytman commented 7 years ago

Parsed log

dmitryfleytman commented 7 years ago

The problem is:

[3]1EB8.01B8::02/02/2017-14:58:28.804 [UsbDk]CUsbDkControlDevice::AddRedirectionToSet Adding new redirection [3]1EB8.01B8::02/02/2017-14:58:28.804 [UsbDk]CUsbDkRedirection::Dump Redirect: DevID: FTDIBUS\VID_0403+PID_6010+AX00000003B, InstanceID: 0000 [3]1EB8.01B8::02/02/2017-14:58:28.804 [UsbDk]CUsbDkControlDevice::AddRedirectionToSet failed. Cannot redirect unknown device.

Client tries to open a device by name FTDIBUS\VID_0403+PID_6010+AX00000003B. This name is not proper USB device name receives from UsbDk enumeration results.

Not sure why this happens, but UsbDk has nothing to do with it.

I'm closing this issue because original problem is fixed. Please open a new one if there are other problems with this device.

tsailer commented 7 years ago

It's working, just the message is irritating. So could you silence the message in the release build? Thanks.

dmitryfleytman commented 7 years ago

This message is intended to go to the debug stream. Is it printed on the console? If so, it's client application prints it. I would avoid silencing it because it actually indicates a real problem with client's code.

tsailer commented 7 years ago

It ends up in the debug stream, but also on stdout. I cannot see where the client application could do that, it never does WaitForDebugEvent*

dmitryfleytman commented 7 years ago

Let me check, maybe UsbDk prints it indeed...

Sent from my iPhone

On 2 Feb 2017, at 19:34, Thomas Sailer notifications@github.com wrote:

It ends up in the debug stream, but also on stdout. I cannot see where the client application could do that, it never does WaitForDebugEvent*

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

tsailer commented 7 years ago

UsbDkHelper.cpp:42

static void printExceptionString(const char *errorStr) { auto tString = string2tstring(string(errorStr)); OutputDebugString(tString.c_str()); tcout << tString; }

So besides outputting to the debug stream, UsbDk also outputs it via stdout.

dmitryfleytman commented 7 years ago

Printout removed by d47bd4d2378df1c49ef064979cf8b751e09e4c5e

tsailer commented 7 years ago

Thanks for the printout removal!

When do you plan to release an installer with that changeset included? Thanks!

dmitryfleytman commented 7 years ago

We are going to release a new version next week after a few more fixes pushed.