Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Com port fail. This device cannot start. (Code 10) #52

Closed
MarkOstis opened this issue Jul 23, 2019 · 14 comments
Closed

Virtual Com port fail. This device cannot start. (Code 10) #52

MarkOstis opened this issue Jul 23, 2019 · 14 comments

Comments

@MarkOstis
Copy link

Hi Guys. I am trying to emulate the STMicroelectronics Virtual Com Port via the usbip vhci.
As result I have net issue:
image

The USBIP/VHCI driver was installed properly:
image

Here is a log from the usbip.exe:

D:\Projects\USBIP\usbip-win\Debug\output_copy3>usbip.exe --debug attach -r localhost -b 1-1
usbip: debug: d:\projects\usbip\usbip-win\userspace\src\usbip\usbip.c:133:[run_command] running command: `attach'

usbip: debug: d:\projects\usbip\usbip-win\userspace\src\usbip\usbip_vhci.c:58:[usbip_vhci_driver_open] device path: \\?\root#unknown#0000#{d35f7840-6a0c-11d2-b841-00c04fad5171}
usbip: debug: d:\projects\usbip\usbip-win\userspace\src\usbip\usbip_attach.c:57:[import_device] got free port 1

As a device that emulate device I use project https://github.com/lcgamboa/USBIP-Virtual-USB-Device. I run cdc-acm and get this:

cdc started....
Connection address:127.0.0.1
Header Packet
command: 0x8003
attach device
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 2147483647
usbip devid 65538
usbip direction 1
usbip ep 0
usbip flags 0
usbip number of packets 0
usbip interval 0
usbip setup 9225060895304978944
usbip buffer lenght  18
#control requests
8006000200001200
  UC Request Type 128
  UC Request 6
  UC Value  2[0]
  UCIndex  0-0
  UC Length 18
handle_get_descriptor 2 [0]
Configuration
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 1
usbip devid 65538
usbip direction 1
usbip ep 0
usbip flags 0
usbip number of packets 0
usbip interval 0
usbip setup 9225060891010011648
usbip buffer lenght  18
#control requests
8006000100001200
  UC Request Type 128
  UC Request 6
  UC Value  1[0]
  UCIndex  0-0
  UC Length 18
handle_get_descriptor 1 [0]
Device
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 2
usbip devid 65538
usbip direction 1
usbip ep 0
usbip flags 0
usbip number of packets 0
usbip interval 0
usbip setup 9225060895304976640
usbip buffer lenght  9
#control requests
8006000200000900
  UC Request Type 128
  UC Request 6
  UC Value  2[0]
  UCIndex  0-0
  UC Length 9
handle_get_descriptor 2 [0]
Configuration
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 3
usbip devid 65538
usbip direction 1
usbip ep 0
usbip flags 0
usbip number of packets 0
usbip interval 0
usbip setup 9225060895304991488
usbip buffer lenght  67
#control requests
8006000200004300
  UC Request Type 128
  UC Request 6
  UC Value  2[0]
  UCIndex  0-0
  UC Length 67
handle_get_descriptor 2 [0]
Configuration
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 4
usbip devid 65538
usbip direction 1
usbip ep 0
usbip flags 0
usbip number of packets 0
usbip interval 0
usbip setup 9225060895304976641
usbip buffer lenght  265
#control requests
8006000200000901
  UC Request Type 128
  UC Request 6
  UC Value  2[0]
  UCIndex  0-0
  UC Length 265
handle_get_descriptor 2 [0]
Configuration
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 5
usbip devid 65538
usbip direction 0
usbip ep 0
usbip flags 1
usbip number of packets 0
usbip interval 0
usbip setup 2534374302023680
usbip buffer lenght  0
#control requests
0009010000000000
  UC Request Type 0
  UC Request 9
  UC Value  0[1]
  UCIndex  0-0
  UC Length 0
handle_set_configuration 0[1]
------------------------------------------------
handles requests
usbip cmd 1
usbip seqnum 6
usbip devid 65538
usbip direction 0
usbip ep 0
usbip flags 1
usbip number of packets 0
usbip interval 0
usbip setup 75153818798522368
usbip buffer lenght  0
#control requests
010B000001000000
  UC Request Type 1
  UC Request 11
  UC Value  0[0]
  UCIndex  0-1
  UC Length 0
SET_INTERFACE
------------------------------------------------
handles requests

Please help.

@cezuni
Copy link

cezuni commented Jul 23, 2019

@MarkOstis : What version did you test ? More detailed logs are required to resolve the issue. Please read the tail part of README.md. I have just added the information about how to generate usbip-win logs.

@MarkOstis
Copy link
Author

@MarkOstis : What version did you test ? More detailed logs are required to resolve the issue. Please read the tail part of README.md. I have just added the information about how to generate usbip-win logs.

I am using commit 59c0929.
OS: Windows 10 Version 1809 (OS Build 17763.557)
The project was built with the VS 2017 (v141), Windows SDK Version: 10.0.17763.0.

Here is the usbip.exe log file:
debug_pdu.log

Note, I also tried to emulate hid-mouse and hid-keyboard devices. The device attached/detached successfully without errors.

One more thing, I was not able to sign USB/IP VHCI driver. To be able to install the driver I temporary disabled the driver signature checks in Windows 10.

@cezuni
Copy link

cezuni commented Jul 24, 2019

I am using commit 59c0929.

Please try more recent one. I just have upload new binary release. Please check..

debug_pdu.log

In this case, debug_pdu.log does not say useful things. Can you share windows kernel log?

One more thing, I was not able to sign USB/IP VHCI driver. To be able to install the driver I temporary disabled the driver signature checks in Windows 10.

Driver signing is explained in README and many stories will be found in comments of closed issues.

@MarkOstis
Copy link
Author

I installed new release 0.0.6 version. The behavior the same. I got Code 10.

Here is the Kernel log file:
KernelLog_StartEmulate.LOG

And usbip debug log file:
debug_pdu.log

@cezuni
Copy link

cezuni commented Jul 25, 2019

@MarkOstis : Can you share STMicroelectronics drivers? I tried to reproduce your case but my result logs are different from yours. Maybe STMicroelectronics driver must seem to be installed.

@MarkOstis
Copy link
Author

@cezuni : Here is my STMicroelectronics driver:
stm32_vcp_driver.zip

dm

As I mentioned before, I use USBIP-Virtual-USB-Device and try to emulate cdc-acm.c device. It seems like it is a Virtual comport. I rewrote the cdc-acm.c file to emulate STMicroelectronics Virtual com port. Here is my version of USBIP-Virtual-USB-Device cdc-acm.c file:
cdc-acm.txt

@MarkOstis
Copy link
Author

@cezuni : If need I can share full USBIP-Virtual-USB-Device project.

@cezuni
Copy link

cezuni commented Jul 25, 2019

@MarkOstis : I have same results with you after installing STMicroelectronics driver and replacing with your cdc-acm.c. Sadly, there's no faulty log about usbip-win.
In my opinion, the reason why STMicroelectronics device goes into wrong state is that STMicroelectronics driver have removed the device. (guessed from IRP_MN_REMOVE_DEVICE in kernel logs) VHCI seems to be not guilty. :) I recommend you to check cdc-acm.c source.

@MarkOstis
Copy link
Author

I was looking thought my Kernel log file and found next:
00000141 0.06881560 usbip_vhci: vhci_internal_ioctl: Leave: STATUS_INVALID_PARAMETER

Could it be the root of this issue?

@cezuni
Copy link

cezuni commented Jul 25, 2019

I was looking thought my Kernel log file and found next:
00000141 0.06881560 usbip_vhci: vhci_internal_ioctl: Leave: STATUS_INVALID_PARAMETER

Could it be the root of this issue?

I don't think so. That warning is not important because next usb commands proceed successfully.

@MarkOstis
Copy link
Author

@cezuni : Thank you for your help. I will try to fix cdc-acm file and respond to this issue.

@halimselim
Copy link

halimselim commented Jul 27, 2019

We have an OMRON PLC and getting same error code 10 This device cannot start
When PLC connected directly to usb port(without usbip) it works well on win10 with the usb drivers

Other basic usb devices(usb drive,barcode scanner, serial converter) also work without problem through usbip.

Could you please check and confirm you get the same error ?
usbip.exe list -r 79.137.39.83 (This is an orangepi linux server, usb bus id 7-1 is binded)

If needed we can give ssh root access to orangepi.
We can also pepare a test environment with a virtual windows pc directly connected to omron plc through usb.(to show it is working well without usbip). You may use this windows pc to compile and debug usbip code.

We are a new startup based in Turkey. If we could solve this problem we will be happy to contribute to this project in some way. For example we have bought the usb token certificate from GlobalSign to sign the driver. We can share the signed driver with public. So people don't need to do bcdedit etc.
Could this be harmful to us ? What is your opinion?

Thank you

@cezuni
Copy link

cezuni commented Jul 27, 2019

@halimselim : What version did you test with ? More detailed logs would be very helpful. Please check README to obtain logs.

@cezuni
Copy link

cezuni commented Jul 27, 2019

@halimselim : It would be more desirable that your issue is discussed in other page even though plc failed similar to this issue. I'll create a new issue for your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants