Page 1 of 1

V-USB device connected through VMWare Workstation

Posted: Wed May 15, 2013 12:42 am
by p1gl3t
Hello,
I'm a student and my current project involves programming an atmega324pa by USB.
I tried with both BootloadHID and USBaspLoader but couldn't get the MCU to be seen as an usb device when connected to a Ubuntu guest VM running in VMWare Workstation on a Windows 7 host. The device works correctly when used from the Windows host.
Even tried setting the usb quirks mode in the vmx file, but it was a no go. The connection fails in a few minutes after clicking "Connect (Disconnect from Host)" and the little usb icon in the status bar remains grayed out.
I suspect that V-USB does not implement some kind of reinitalization required when connecting the device to the VM. Though I really have no experience with USB firmware or drivers, I could try to implement the needed functionality if someone could point out the specific problem.
I'm really grateful to you guys for providing V-USB.

Re: V-USB device connected through VMWare Workstation

Posted: Wed May 15, 2013 6:25 pm
by vouvoume
When I use it within Qemu it works pretty perfekt. (Slower, but works.)

Because USB within Qemu really sucks, I would have had assumed VMWare should be no problem at all.
If your schematic is correct than V-USB does implement all the necessary stuff to be enumerated correctly on any USB Host Controller.
(It even passes the tests in usb.org’s test utility.)
Because (during enumeration and during USBaspLoaders normal work) only the control endpoint is used, it should really be no problem to use it in VMWare.
Perhaps close all "outside VM" software using the device and try it again in VM.

What is your problem in detail? Does the VM enumerate the device? Can you perhaps post your VMs syslog after plug and unplugging the USBaspLoader?
What outputs "lsusb -vvvv" ?

Out of curiosity: What USBaspLoader do you use? The recent "https://github.com/baerwolf/USBaspLoader" one?

Best regards,

Re: V-USB device connected through VMWare Workstation

Posted: Wed May 22, 2013 1:59 pm
by p1gl3t
vouvoume, thanks for your quick reply. Unfortunately I was busy with other stuff and didn't have the time to reply.
The problem is really more annoying as I can't use the device at all when the Ubuntu VM is running. I must suspend it or else the HIDBootFlash utility can not identify the bootloadHID device.
From what I can tell after looking in the VMWare logs the device does not even connect to the VM. It seems to fail midway while being handled by the VM manager.
Here are some lines from the log file:

2013-05-22T14:42:41.632+03:00| vmx| I120: VUsbUpdateVigorFieldsAndAutoconnect: New set of 4 USB devices
2013-05-22T14:42:41.632+03:00| vmx| I120: USB: Found device [name:VOTI\ HIDBoot vid:16c0 pid:05df path:1/0/0/4 speed:low family:vendor,hid instanceId:USB\\VID_0E0F&PID_0001\\6&13F4C3E&0&5 arbRuntimeKey:b version:2]
// some other devices were listed here
2013-05-22T14:42:50.889+03:00| vmx| I120: USBGW: Write arbitrator op:13 len:18 // repeated 4 times
2013-05-22T14:42:53.889+03:00| vmx| I120: USB: Connecting pattern [path:1/0/0/4 version:2] controller []
2013-05-22T14:42:53.889+03:00| vmx| I120: USB: Connecting device 0x2000000b16c005df
2013-05-22T14:42:53.889+03:00| vmx| I120: USBGW: Write arbitrator op:8 len:8
2013-05-22T14:42:53.889+03:00| vmx| I120: MsgHint: msg.usb.generic.stopDevice
// After I instruct vmware to connect the device to the VM
2013-05-22T14:42:53.889+03:00| vmx| I120+ A USB device is about to be unplugged from the host and connected to this virtual machine. It will first be stopped to enable safe removal. With some devices, the host may display the message "The device can now safely be removed."
2013-05-22T14:42:53.889+03:00| vmx| I120+ ---------------------------------------
2013-05-22T14:42:53.920+03:00| vmx| I120: USBGW: Write arbitrator op:6 len:22
2013-05-22T14:42:53.921+03:00| vmx| I120: USBGW: Write arbitrator op:13 len:18 // 13 times
2013-05-22T14:44:53.939+03:00| vmx| W110: USBGA: Failed to connect device 2000000b16c005df, error (4)
2013-05-22T14:44:53.939+03:00| vmx| I120: Msg_Post: Warning
2013-05-22T14:44:53.939+03:00| vmx| I120: [msg.usb.connectFailedErr] The connection for the USB device "VOTI HIDBoot" was unsuccessful. Driver error.
2013-05-22T14:44:53.939+03:00| vmx| I120: ----------------------------------------
2013-05-22T14:44:53.980+03:00| vmx| I120: USB: Disconnecting device 0x2000000b16c005df
2013-05-22T14:44:53.980+03:00| vmx| I120: USBGW: Disconnecting device: 3BE9DD8 id: 2000000b16c005df


No ideea how I should debug it. I'd be really satisfied if only VMW Workstation could leave the device alone so I can use it in the Windows host.

Re: V-USB device connected through VMWare Workstation

Posted: Thu May 23, 2013 11:40 am
by vouvoume
And how does it work with USBaspLoader. Since it uses just one (control)endpoint ist might be more stable?

Maybe you can post a log with USBaspLoader

Best regards