32nd: Construction of USB2.0 debugging environment in WinDbg

Source: Internet
Author: User

2011, in order to develop the USB Mass storage-UASP (USB attached SCSI Protocol) device driver, from America bought two USB2.0 debug small device (for example, each seems to be 80 U.S. knives, thieves expensive things).

is mainly used to replace the serial port 115200 baud rate of slow response, in order to solve the problem of debugging efficiency.


At that time, according to WinDbg's help document, but also Google a number of web-related reference content, simply did not put USB2.0 debugging environment to build up.

Later, a friend to develop the driver, he used to have a PCI to 1394 card to debug, but now to use a notebook, but without 1394 interface, so, Ask me to borrow this USB2.0 debugging equipment a use, but this drive master, engaged in a half-day, also simply did not put USB2.0 debugging environment to build up.


So, this little thing, has been lying in the corner of the laboratory, I still as usual, in the Win7 with serial debugging, on the WIN8 with net debugging.


The recent development of display-related DLLs has also been using net debugging on WIN8/8.1/10 systems.

In order to Win7 debugging environment, plus this platform does not have a serial port, so, and think of this USB2.0 debugging equipment.


Based on WDK8.1 WinDbg's help documentation, try to build on the first type of platform.

But without success, the reason is simple, the USB2.0 debug device can only directly connect the host with the EHCI host on target.

And the first type of platform tuning machine, any one EHCI host PORT1, are embedded in a generic USB HUB.

Since the PORT1 under the root hub is occupied and does not meet the requirements of the environment, it is naturally not connected.

USB debugging does not work over a hub or docking station. (from Help documents)

PCI to USB host controller     
<span style= "White-space:pre" ></span>root Hub           
<span style= "White-space:pre" ></span>port1:generic USB hub                    
<span style= "White-space:pre" ></span>port 1--plug physical Port of the debug cable                    
<span style= "White-space:pre" ></span>port 2           
<span style= "White-space:pre" ></span>port2

After the change of a test machine, according to the Help document, before and after spending less than 10 minutes, the commissioning environment to build a success.


Here are a few main steps:

On the machine being debugged:

1. Bcdedit/debug off

2. Restart

3. Locate the root HUB via Usbview PORT1

4. When found, record this EHCI host's PCI bus, device, and function numbers via Device Manager

5.

    1. Settings on Windows 7 systems
    1. Bcdedit/debug on
      bcdedit/dbgsettings USB targetname: Somename
      bcdedit/set "{dbgsettings}" Busparams x.y.z

      where x, y, and z is the bus, device, and function numbers for the host controller. The bus, device, and function numbers must is in decimal format (for example,busparams 0.29.7).

6. Restart


On the debug host:

Simply connect the device to the EHCI host and install the driver at the same time.


To establish a debugging session:

File-->kernel debug-->usb2.0 Tab-->enter the target Name-->ok

Or, in command PROMPT windows:

windbg/k usb2:targetname= Targname



In fact, not every PC can be debugged as a USB2.0 debug machine:

    • The target computer must has a USB 2.0 controller that's compatible with the EHCI specification and that supports kernel Debugging. Not all ehci-compatible controllers has this support.


32nd: Construction of USB2.0 debugging environment in WinDbg

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.