次の方法で共有


Running the USB Host-Controller Driver Test (Windows Embedded CE 6.0)

1/6/2010

There are several aspects to running the USB Host-Controller Driver test.

Loading the Loop-back Driver

Running Individual Tests

Manual Testing

Porting and Modifying Tests

Running a Complete Test Pass

Loading the Loop-back Driver

The following procedure describes loading and using the loop-back driver.

To load the loop-back driver

  1. From the command line, start lufldrv.exe. This program loads the loop-back driver on the function side.

    The following table describes the configuration that each DLL of the provided loop-back driver supports.

Loop-back Configuration #1 Loop-back Configuration #2

LpBkCfg1.dll configures a USB function controller with six endpoints in addition to endpoint zero:

  • A pair of Bulk (IN/OUT) endpoints
  • A pair of Interrupt (IN/OUT) endpoints
  • A pair of Asynchronous (In/Out) endpoints
  • You can load this driver from the command line with the following command:
    s lufldrv -1

LpBkCfg2.dll configures a USB function controller with four endpoints in addition to endpoint zero:

Note

You can use any USB function controller. If neither of the previous configurations matches your controller, you can build and configure your own loop-back driver that is based on LpBkCfgNew.dll. Load the customized DLL by using the following command: lufldrv -3. For more information, see the Porting and Modifying Tests section of this topic.

Running Individual Tests

The host computer and the USB function controller must not be connected when they are first booted. Instead, execute one loop-back test on the host computer and connect it to the USB function controller with a USB cable when the test instructs you to do this by displaying the message: Please connect USB host with USB test device now in the Platform Builder Debug Output Window.

After the host computer and USB function controller have been booted as described above, you can execute additional tests without disconnecting and reconnecting the host computer and test device. However, as soon as the two are disconnected, you must repeat the procedure that is described above before you start any new loop-back tests.

To run a single loop-back test

  1. Download the runtime image to the test device equipped with the NetChip 2280 card.

  2. After the system boots, run lufldrv.exe, as described in the Loading the Loop-back Driver section of this topic. Verify that the appropriate driver is loaded.

  3. Download the runtime image to the platform with the USB host controller.

  4. After this system boots, make sure that the host computer and the device are not connected with a USB cable.

  5. At the command line, type the following command:

    tux –o –n -d usbtest –xYYYY

    where YYYY is the test case number of the test that you want to run. The test reminds you to make sure that the host and device are disconnected from one another.

  6. After a seven-second delay, the test asks you to connect the host computer to the test device that uses a USB cable. As soon as the two are connected, the main body of the test will run.

Manual Testing

We recommend running manual tests to verify the functionality of the device. The following list describes some sample manual tests that you may run.

  1. Attach several USB devices to the system. Then suspend and resume the system. The expected result is that the USB devices remain connected, is recognized by the system, and is functional.
  2. Attach a single USB device to the system.
    1. Suspend the system.
    2. Detach the USB device from the system.
    3. Attach a different device to the port vacated by the device that you removed.
    4. The expected result is that the system enumerates the new device correctly.
  3. Run one of the data-transfer tests.
    1. During the transfer stage, suspend the system on the host computer.
    2. Resume the system.
    3. The expected result is that the test may fail, but does not crash the system.

Porting and Modifying Tests

To test a Windows Embedded CE USB host-controller driver or a USB function controller with a nonstandard configuration, modify the existing test code for the USB function client-data loop-back driver that you load on the function side.

To modify the test source code

  1. Open the setconfig.cpp file in the …\USBFN\Drivers\LpBkNewCfg folder.

  2. Search for all lines of code marked with the //``<--``USER INPUT comment, and change the configuration, interface, and endpoint settings, or endpoint settings to meet the compatibility requirements for the USB function controller that you are using.

    The following code example shows several lines of code with the //``<--``USER INPUT comment in bold:

    // --- ``set endpoints for highspeed config 0, interface 0 ---

    //---endpoint 1---

    PUSB_ENDPOINT_DESCRIPTOR pCurEP = &pCurIf->pEPs[0].usbEP;

    pCurEP->bEndpointAddress = 0x81; ``//<--USER INPUT

    pCurEP->bmAttributes = USB_ENDPOINT_TYPE_BULK;``//<--USER INPUT

    pCurEP->wMaxPacketSize = 0x200;``//<--USER INPUT

    pCurEP->bInterval = 0x0;``//<--USER INPUT

    //will it work with another endpoint to be a loopback pair?

    pCurIf->pEPs[0].iPairAddr = 1; ``//<-- USER INPUT

  3. After you make the necessary modifications, build the source code in this directory. A USB function client-data loopback driver is created by using the name LpBkNewCfg.dll.

  4. To load the newly configured client-data loopback driver, at the Windows Embedded CE Command Prompt within Platform Builder, type lufldrv -3.

Note

There are three key considerations when you create your own loop-back driver:

  • Even if your host controller supports only USB 1.1, you still must set up configuration, interface, and endpoint data for a high-speed device. In this case, you can use the same configuration settings that you specify for a full-speed device.
  • Pair the endpoints so that each pair contains an endpoint of the same type.
  • Neither multiple configurations, nor multiple interfaces are supported on the function side. However, the data structure does support these two features.

You may add or modify as many tests as frequently as you want.

Running a Complete Test Pass

To run a complete test pass

  1. Download the runtime image with USB support to both the host computer and the test device. Make sure that the two are not connected to one another.

  2. From the Windows Embedded CE Command Prompt within Platform Builder, run lufldrv.exe, by using the appropriate command-line parameters, as described in the Loading the Loop-back Driver and the Running Individual Tests sections of this topic.

  3. Run the appropriate 3000-series job on the host computer to set the packet size for the tests.

  4. Attach the USB cable from the USB controller on the host computer to the NetChip 2280 card on the test device.

  5. Run the basic and short USB tests: at the Windows Embedded CE Command Prompt within Platform Builder, type s tux–o –n –d usbtest –x1001-2013.

  6. Reset the test device: at the Windows Embedded CE Command Prompt within Platform Builder, type s tux–o –n –d usbtest –x9001. Then detach the USB cable from the host computer and the test device.

  7. Suspend and then resume the test device: at the Windows Embedded CE Command Prompt within Platform Builder, type s tux–o –n –d usbtest –x9003-9004. When you are prompted to do this, attach the USB cable to both the host computer and the test device.

  8. Execute the Endpoint 0 tests: at the Windows Embedded CE Command Prompt within Platform Builder, type s tux–o –n –d usbtest –x9005-9007.

  9. Suspend and then resume the test device: at the Windows Embedded CE Command Prompt within Platform Builder, type s tux–o –n –d usbtest –x9003-9004.

  10. Run the basic and short USB tests: at the Windows Embedded CE Command Prompt within Platform Builder, type s tux–o –n –d usbtest –x1001-2013

See Also

Concepts

USB Host-Controller Driver Test