This directory contains a test for USB peripheral role functionality in Zircon. It consists of two parts - a Zircon USB function driver and a Linux host test program. The host test (called usb-peripheral-test) tests control requests in both the IN and OUT direction with various payload sizes, receiving data on an interrupt endpoint and finally bulk transfers.
DEPRECATED: hikey960 no longer supported
First of all, this test only works with devices that implement USB peripheral role functionality. The hikey960 board is one of those devices, so here we assume you are using a hikey960 board. To run the test, follow these steps:
Connect the Hikey USB-C port to your Linux desktop
In the Hikey's shell, switch to USB peripheral mode and enable the test driver:
usbctl mode peripheral usbctl peripheral reset usbctl peripheral init-test
out/default.zircon/host-x64-linux-clang/obj/system/dev/usb/usb-peripheral-test/usb-peripheral-test
If the test succeeds, you should see something like:
CASE usb_peripheral_tests [STARTED] control_interrupt_test_8 [RUNNING] [PASSED] (36 ms) control_interrupt_test_64 [RUNNING] [PASSED] (31 ms) control_interrupt_test_100 [RUNNING] [PASSED] (31 ms) control_interrupt_test_256 [RUNNING] [PASSED] (31 ms) control_interrupt_test_1000 [RUNNING] [PASSED] (31 ms) bulk_test [RUNNING] [PASSED] (19 ms) CASE usb_peripheral_tests [PASSED]
Update these instructions to use a different device
Future versions of this test may include: