How Do I Sniff the Traces of a Virtual USB Device?

Photo by Andreas Goellner

Question from the Customer:

I have a question about analyzing and monitoring a virtual USB device.

The concept:

  • The server CPU will be connected to a USB bridge controller using a USB audio

The virtual setup:

  • The USB bridge will be connected to a virtual USB device. With this setup, the driver from the host will see a device, but no physical device is connected to the USB bridge.

The purpose of this setup is to debug a protocol issue. We are trying to use the Beagle USB 5000 v2 SuperSpeed Protocol Analyzer with a T-connection. However, whether we connect the analyzer to the device side or the host side, we have not been able to capture any traces.

Here are the results we have so far:

Measuring USB voltage when sending commands:

  • Power: 3.3V
  • Data- : 0.005~0.007V
  • Data+ : 0.006V

Measuring USB voltage when idle, not sending commands:

  • Power: 3.3V
  • Data- : 0.006V
  • Data+ : 3.02V.

Here is a screenshot of the data.

Analyzer is not capturing data.

Is there a way to capture traces from a virtual device?

Response from Technical Support:

Thanks for your question! We have two suggestions for you: One is setting up the Beagle USB 5000 v2 analyzer to override the VBUS. The other is verifying how a trigger is configured.

VBUS and Device Recognition

By default, to detect a host USB device, 5V must be present on the VBUS. As the virtual target system cannot provide 5V, you can override VBUS in software. We have two options for that: Software and Beagle Software API.

Data Center Software VBUS Override

With the Data Center Software application, you can the override this requirement entering device({'usb.vbus_override': True}) in the Command Line window as shown below.

Data Center Software command to override VBUS requirement

Triggering Virtual USB Devices

In the Device Settings dialog, make sure the Trigger Immediately option is selected. This way, triggering occurs when capture starts.

Data Center Software with immediate trigger option set

Additional Information for Debug and Filtering

To help you move forward, here are a few examples and suggestions for troubleshooting and using the API.

Debugging SuperSpeed USB

This video shows an example of using the Beagle USB 5000 v2 SuperSpeed Protocol Analyzer to quickly debug and monitor the USB traffic between a USB 3.0 device and the host computer:

Complex Match and Triggers

This video shows how to set a multi-state USB 2.0 compete trigger with the Beagle USB 5000 v2 SuperSpeed Protocol Analyzer:

API Software VBUS Override

If you need to fully customize your monitoring and analysis, we recommend using the Beagle Software API. Our API supports multiple operating systems and programming languages. Functional scripts are provided with the API that can be used as-is or modified as needed. Here is the API call for VBUS override:

bg_usb5000_usb2_target_configure() with the BG_USB2_VBUS_OVERRIDE flag

For more information about API calls, refer to the API Documentation section of the Beagle Protocol Analyzer User Manual.

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.