Quantcast
Channel: Microsoft Windows USB Core Team Blog
Viewing all articles
Browse latest Browse all 54

Setting up an environment to run USB Type-C system HLK tests

$
0
0

Authored by Michelle Bergeron [MSFT] and Makarand Sonare [MSFT]

There are new tests in the Hardware Lab Kit (HLK) that target systems with USB Type-C. Some of the tests require extra configuration – here is a guide to help you set up your test environment for them.

USB Type-C UCSI Data and Power Role Swap tests

Applicable tests

Hardware Requirements

  1. Two UCSI 1.0 compliant Windows desktop systems.
  2. UcmUcsi.sys must be loaded as the UCSI controller driver.
  3. USB Type-C cable.

Note: If your Type-C system does not use UCSI, the test will detect this and allow your system to pass.

Test Setup

  1. Designate one system as the System Under Test (SUT) and the other as the “Partner” system.
  2. Install HLK client on the SUT.
  3. Connect the UCSI Type-C connector on the SUT to the UCSI Type-C connector on the Partner via the Type-C cable.
  4. Enable the UCSI test interface on the SUT by following steps 1-7 in the “How to Test UCSI” section of USB Type-C Connector System Software Interface (UCSI) driver.

Test Parameters

Parameter Name Parameter Description
SwapsToPerform Number of data role swaps to perform. The minimum is 2 so that both host and function mode are tested.
ValidateUsbFn If ValidateUsbFn = true, the test will validate function stack behavior.

USB Type-C UCM Data and Power Role Swap tests

Applicable tests

  • USB Type-C UCM Data Role Swap
  • USB Type-C UCM Power Role Swap

Hardware Requirements

  1. Two Windows systems, each with a USB Type-C connector.
  2. The Type-C connector on the SUT must have a UcmCx client driver. For information about developing a UcmCx client driver, visit USB Type-C connector driver programming reference.
  3. USB Type-C cable.

Note: If your Type-C system implements UCSI, this test is still applicable because UcmUcsi.sys is a UcmCx client driver.

Test Setup

  1. Designate one system as the System Under Test (SUT) and the other as the “Partner” system.
  2. Install HLK client on the SUT.
  3. Connect the Type-C connector on the SUT to the Type-C connector on the Partner via the Type-C cable.

Test Parameters

Parameter Name Parameter Description
SwapsToPerform Number of data role swaps to perform. The minimum is 2 so that both host and function mode are tested.
ValidateUsbFn If ValidateUsbFn = true, the test will validate function stack behavior.

UCSI Compliance tests

Applicable tests

This category of tests refers to all tests in the HLK with a name that begins with “UCSI”. UCSI Compliance Tests are meant to test the UCSI-capable Type C system’s compliance to UCSI Specification V1.0. These tests are marked as “manual” in the HLK. The test binaries are included in the HLK; however, you will need to run them yourself using the instructions below.

Broad Categories of UCSI Compliance Tests
  • UCSI Command Interface tests.
    • Tests all of the UCSI commands that are claimed to be supported by the SUT.
  • USB Operation Mode tests.
    • Tests all of the USB Operation Modes that are claimed to be supported by the SUT on the given Connector.
  • USB Operation Role tests.
    • Tests all of the USB Operation Roles and role swaps that are claimed to be supported by the SUT on the given Connector.
  • Power Direction Mode tests.
    • Tests all of the Power Direction Modes that are claimed to be supported by the SUT on the given Connector.
  • Power Direction Role tests.
    • Tests all of the Power Direction Roles that are claimed to be supported by the SUT on the given Connector. Performs role swaps.
  • UCSI Notification tests.
    • Tests all of the UCSI notifications that are claimed to be supported by the System Under Test on the given Connector.

Hardware Requirements

  1. Two UCSI 1.0 compliant Windows desktop systems.
  2. Connection Exerciser hardware (optional)
  3. USB Type-C PD capable cable.
  4. USB 2.0 and USB 3.0 device
  5. Debug accessory (if supported)
  6. Analog audio accessory (if supported)

How to Identify Connector 1

All of the UCSI compliance tests assume Partner system or Devices are connected on Connector 1. To identify Connector 1, perform the following steps:

  1. On the SUT, open an elevated command prompt.
  2. From the elevated command prompt on the SUT, run the following test to identify Connector 1:
    Te.exe UcsiComplianceTest.dll /name:TestUcsi::UcsiCommandInterfaceTests::TestIdentifyConnectorOne
  3. Repeat Step 2 on the Partner system to identify Connector 1.

Test Setup

  1. Designate one system as the System Under Test (SUT) and the other as the “Partner” system.
  2. Install HLK client on the SUT.
  3. Connect the Type-B port on the Connection Exerciser Arduino to the SUT on any port other than Connector 1
  4. Connect Connector 1 of the SUT to J1 connector on the Connection Exerciser directly.
  5. Connect Connector 1 of the Partner to J2 or J3 connector on Connection Exerciser via Type-C cable.
  6. Install TAEF on both systems
    1. For information about installing TAEF, refer to the TAEF Getting Started page.
  7. Install the TestUcsi.sys driver on both systems.
    1. In Device Manager, find the device “UCSI USB Connector Manager”. This device will have the driver UcmUcsi.sys installed.
    2. Right click the device and select “Update Driver Software”
      1. Enter the path to TestUcsi.inf
        1. TestUcsi.inf and TestUcsi.sys are located in \TestUcsi\<ARCHITECTURE>\
      2. Follow the prompts to complete the driver installation. This will replace UcmUcsi.sys with TestUcsi.sys.

Test Parameters

Parameter Name Parameter Description
IsRunningOnSystemUnderTest Identifies whether the test is running on the System Under Test or Partner machine.

Values:

true – If test is executed on SUT.

false – If test is executed on Partner.

PartnerMachineName Machine name of the partner machine that is connected to the SUT using a USB C-to-C cable. The test performs TAEF network remote execution to execute code on this partner machine.
WaitTimeInMinutes For tests that require manual intervention, this is the amount of time in minutes the test will wait to see the event that is expected to occur in response to the requested manual action.

Test Execution with Connection Exerciser

  1. Connect the SUT and Partner system via a Connection Exerciser and Type-C Cable on Connector 1.
  2. Refer to the Test Setup section for more information.
  3. On the SUT, run UcsiCommandInterfaceTests.
    te.exe UcsiComplianceTest.dll /name:TestUcsi::UcsiCommandInterfaceTests::*
  4. On the SUT, run UcsiTests.
    te.exe UcsiComplianceTest.dll /name:TestUcsi::UcsiTest::* /p: IsRunningOnSystemUnderTest=true /p:waittimeinminutes=1 /p:partnerMachine=<MACHINE_NAME>

Test Execution without Connection Exerciser

  1. Connect the SUT and Partner system via a Connection Exerciser and Type-C Cable on Connector 1.
  2. On the SUT, run UcsiCommandInterfaceTests.
    te.exe UcsiComplianceTest.dll /name:TestUcsi::UcsiCommandInterfaceTests::*
  3. On the SUT, run UcsiTestsManual.
    te.exe UcsiComplianceTest.dll /name:TestUcsi::UcsiTest::* /p: IsRunningOnSystemUnderTest=true /p:waittimeinminutes=1 /p:partnerMachine=<MACHINE_NAME>
  4. Each test requires executing some TAEF tests on the Partner system as per the instructions given on the command prompt.

Example: When running UcsiTestsManual::TestDFPModeToUFP on the System Under Test:

CMD> te.exe UcsiComplianceTest.dll /name:TestUcsi::UcsiTestsManual::TestDFPModeToUFP /p:IsRunningOnSystemUnderTest=true /p:waittimeinminutes=1 /p:partnermachine=<MACHINE_NAME>
 Test Authoring and Execution Framework v5.6 for x64
 Resetting the PPM
 Enabling All Notifications
 
 StartGroup: TestUcsi::UcsiTestsManual::TestDFPModeToUFP
 Setting USB Operation Mode to Dfp on Connector 1
1. On Partner Machine 
Run: CMD Prompt>Te.exe UcsicomplianceTest.dll /p:IsRunningOnSystemUnderTest=false /p:waitTimeInMinutes=<timeInMinutes> /name:TestUcsi::UcsiTestsManual::TestUFPModeOnPartner
 2. Connect the Partner
 3. Waiting for 1 minutes
 
           Waiting for:                   ConnectChange

The above test sets Connector 1’s USB Operation Mode to DFP on the SUT. It then requires you to run the following command on the Partner system:

Te.exe UcsicomplianceTest.dll /p:IsRunningOnSystemUnderTest=false /p:waitTimeInMinutes=<timeInMinutes> /name:TestUcsi::UcsiTestsManual::TestUFPModeOnPartner

Tracing Instructions

Test failures for the UCSI compliance tests can be investigated by collecting logs as per the below instructions.

  1. Start WPP tracing before executing tests. Add the following commands to a .cmd file and run from an elevated command prompt:
    logman start -ets testucsi -ct perf -p {C9ED7F4E-286B-4054-B74F-7DE43EFBCA2A} 0xffffffff 0xff -o c:\testucsi\testucsi.etl
    logman start -ets testucsicontroller -ct perf -p {EBFD4AED-ED11-4F0C-8F37-9C93084D1530} 0xffffffff 0xff -o c:\testucsi\TestUcsiController.etl
    logman start -ets ucsitest -ct perf -p {F8BADD54-3B0F-4B79-8389-D0ABB7AE242B} 0xffffffff 0xff -o c:\testucsi\ucsitest.etl
  2. Stop WPP tracing after running the tests. Add the following commands to a .cmd file and run from an elevated command prompt once the test completes.
     logman stop testucsi -ets
     logman stop ucsitest -ets
     logman stop testucsicontroller -ets
  3. You will be able to view the resulting logs in UcsiTest.etl, TestUcsi.etl, and TestUcsiController.etl.

Test Cleanup

The UCSI Data and Power role swap tests require ucmucsi.sys rather than TestUcsi.sys. If you plan to run the UCSI Data Role Swap or UCSI Power Role Swap tests in the HLK after this test, be sure to clean up your test environment after running the UCSI compliance tests. You can do this by replacing TestUcsi.sys with the original UcmUcsi.sys or by reinstalling Windows on both systems.


Viewing all articles
Browse latest Browse all 54

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>