plankton_cc_flip_check¶
Source code: plankton_cc_flip_check.py
USB type-C CC line polarity check and operation flip test w/ Plankton-Raiden.
Description¶
This test flips the polarity bit of the USB type-C. Usually, the test will come
along with other USB type-C test, for example, CC1/CC2 USB performance
(removable_storage.py
).
Automated test is unstable, you may have to retry. The Plankton-Raiden board
guesses the polarity bit everytime SetDeviceEngaged()
. Then it tries to
flip the CC polarity to the another side. We have found that we need to charge
the DUT in order to flip, and because of the charge action, the Plankton-Raiden
board guesses the logical polarity bit again (you can find that the polarity is
switching between CC1 and CC2 back-and-forth) and thus the flipping is unstable.
Test Procedure¶
This test can be tested manualy with the help from operator or automatically.
For normal USB type-C cable, this is a manual test with the help from operator:
Check USB type-C cable connected direction is right by CC polarity
Show operation instruction for cable flipping to test another CC line.
For double CC cable, this is an automated test:
This test can flip CC automatically or you can set Arg
double_cc_flip_target
as ‘CC1’ or ‘CC2’ to indicate the final CC position.If test scheme can guarantee double CC cable connection is not twisted, that is, Plankton CC1 is connected to DUT CC1, then it can set Arg
double_cc_quick_check
as True to accelerate the test.
Dependency¶
For manual test, you need a normal USB type-C cable to connect with Plankton-Raiden board.
For automated test, you need a double CC cable to connection with Plankton-Raiden board.
Examples¶
To manual test with a dummy BFTFixture by asking operator to flip the cable, add this in test list:
{
"pytest_name": "plankton_cc_flip_check",
"args": {
"bft_fixture": {
"class_name":
"cros.factory.test.fixture.dummy_bft_fixture.DummyBFTFixture",
"params": {}
},
"ask_flip_operation": true,
"usb_c_index": 0,
"state_src_ready": "SNK_READY"
}
}
Automated test with a dolphin BFTFixture and flipping the polarity to CC1:
{
"pytest_name": "plankton_cc_flip_check",
"args": {
"bft_fixture": {
"class_name":
"cros.factory.test.fixture.dummy_bft_fixture.DummyBFTFixture",
"params": {}
},
"double_cc_flip_target": "CC1",
"usb_c_index": 1,
"state_src_ready": "SNK_READY"
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
bft_fixture |
dict |
A dictionary with the following items:
The default value of |
adb_remote_test |
bool |
(optional; default: |
usb_c_index |
int |
Index of DUT USB_C port |
original_enabled_cc |
str, None |
(optional; default: |
ask_flip_operation |
bool |
(optional; default: |
double_cc_flip_target |
str, None |
(optional; default: |
double_cc_quick_check |
bool |
(optional; default: |
timeout_secs |
int |
(optional; default: |
state_src_ready |
int, str |
(optional; default: |
wait_dut_reconnect_secs |
int |
(optional; default: |
init_cc_state_retry_times |
int |
(optional; default: |