Commit Graph

63 Commits (6a535d10db22141544c4327de23643de8a288809)

Author SHA1 Message Date
George Psimenos df5baf6031 USB public APIs cleanup (#11034)
The contents of the usb directory were moved to appropriate locations and the usb directory removed.

* Public USB headers moved under drivers/
* Internal USB headers moved under drivers/internal/
* USB Source code moved under drivers/source/usb/
* Moved usb/device/hal/ under hal/usb/
* Moved usb/device/USBPhy/ under hal/usb/
* Merged usb/device/targets/ into targets/
* Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api.
2019-08-02 12:23:47 +01:00
Evelyne Donnaes 8013af2f1e Fixing include files due to latest rebase 2019-08-02 12:23:47 +01:00
int_szyk ae6f8be146 Newline at the end of files 2019-08-01 08:44:58 +02:00
int_szyk 8b68a1ea58 Updated testcases 2019-07-31 10:46:38 +02:00
Maciej Bocianski b4138d1102 usb_device-msd test: OS type detection fix 2019-06-24 22:12:20 +02:00
Maciej Bocianski 60ef4a0854 usb_device-msd test: astyle fix 2019-06-19 15:37:09 +02:00
Maciej Bocianski 855a6ddbfd usb_device-msd test: docs update 2019-06-19 15:10:33 +02:00
Maciej Bocianski 4378c141df usb_device-msd test: disable host side unmount on windows machines 2019-06-19 14:32:21 +02:00
Maciej Bocianski f6d6863c1f usb_device-msd test: improve error handling 2019-06-19 14:32:21 +02:00
Filip Jagodzinski 0ae1be0e65 Add a top level README file for USB tests
Add setup instructions and aggregate all the info from README files
related to USB testing.
2019-05-28 15:53:28 +02:00
Filip Jagodzinski 852390fcdc Tests: USBHID: Make report test optional on Linux
This test case uses `hidapi` -- a cross-platform Python module.
To keep the initial Mbed setup as simple as possible, the `hidapi`
module is skipped on Linux hosts because of its external dependancies
for this platform.

The module can be easily installed following instructions from the
README file.
The test case is skipped if the host machine lacks `hidapi` module.
2019-04-09 17:03:22 +02:00
Filip Jagodzinski 111f485cbe Tests: USBHID: Remove unnecessary wait_ready call
Every test case waits at greentea_parse_kv() anyway.
2019-04-09 17:03:22 +02:00
Filip Jagodzinski 36eb700ede Tests: USBHID: Handle variable driver setup time
Wait for the host driver to finish setup before sending any HID reports
from the device.

USBHID::wait_ready() blocks until the device reaches 'configured' state,
but the state of the host HID driver remains unknown to the device.
2019-04-09 17:03:22 +02:00
Filip Jagodzinski 4f880691fb Tests: USBHID: Reuse VID & PID from basic test
To successfully use pyusb on Windows hosts, a Zadig configuration has to
be performed. Since config for basic tests has already been provided,
use it again.
2019-04-09 17:03:22 +02:00
Filip Jagodzinski 572beb6731 Tests: USBHID: Add tests 2019-04-09 17:03:21 +02:00
Maciej Bocianski 7ff689be20 Add USB mass storage test 2019-02-27 17:18:41 +01:00
Russ Butler 9f116d9f33 Applied more astyle fixes 2019-02-22 10:53:24 -06:00
Russ Butler 005df3559c Applied suggested astyle fixes 2019-02-22 10:53:23 -06:00
Russ Butler 8d731561cf Remove inclusion of mbed.h from USB
Remove mbed.h from USB files and fix the build errors this causes.
This is required to pass CI.
2019-02-22 10:53:23 -06:00
Filip Jagodzinski 4a4dcdb5b8 Tests: USB: Use astyle to format the test class 2019-02-22 10:53:23 -06:00
Filip Jagodzinski 38032453a5 Tests: USB: Fix 'endpoint halt' test
Abort all endpoint transfers before running the test again.
Use an updated vendor request to explicitly restart device reads.
2019-02-22 10:53:23 -06:00
Filip Jagodzinski 1ec448dbd0 Tests: USB: Add a README for Linux users
Explain how to overcome xHCI limitations in kernels prior to v4.17 and
successfully run USB tests.
2019-02-22 10:53:22 -06:00
Filip Jagodzinski 7db3a8a34a Tests: USB: DTR fix for Linux hosts
A DTR line is used to signal that the host has configured a terminal and
is ready to transmit and receive data from the USB CDC/Serial device.
When this test suite is run with the use of a Linux host, a workaround has
to be used to overcome some platform specific DTR line behavior.
Every time the serial port file descriptor is opened, the DTR line is
asserted until the terminal attributes are set.
As a consequence, the device receives a premature DTR signal with a
duration of 200-500 us before the correct, long-lasting DTR signal set by
the host-side test script. (tested on the Linux kernel 4.15.0)

The solution is to wait for the first DTR spike, ignore it, and wait for
the correct DTR signal again.
2019-02-22 10:53:21 -06:00
Russ Butler a4a3b3d429 Remove USB disconnect delay from Serial test
Remove the USB disconnect delay since there is no reason this is
needed. Failures which occur without this indicate a device or host
problem.
2019-02-22 10:53:21 -06:00
Russ Butler 96154b577a Tests: USB: Remove TX_DELAY_MS from serial test
Remove TX_DELAY_MS and all the places it was called since it is not
needed when DTR flow control is used.
2019-02-22 10:53:21 -06:00
Filip Jagodzinski 31fe3ee11e Tests: USB: Increas the size of RX CDC test data
This ensures the flow control is tested.
2019-02-22 10:53:21 -06:00
Filip Jagodzinski 3d4d10191c Tests: USB: Update code comments 2019-02-22 10:53:21 -06:00
Filip Jagodzinski edf360d2fc Tests: USB: Use SN generated by the host machine 2019-02-22 10:53:21 -06:00
Filip Jagodzinski fc366291a2 Tests: USB: Correct reconnect delay
Setting to 1 ms to be on the safe side. The USB spec defines this delay
to be at least 200 us.
2019-02-22 10:53:21 -06:00
Filip Jagodzinski 2d4d111445 Tests: USB: Wait before transmitting data to host
Despite having ECHO and ECHOCTL POSIX lflags disabled by default by
pyserial, a delay is needed for host to properly handle data received
from USB serial/CDC device.
With no delay host would echo 0x00-0x31 characters prefixed with '^'.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski 7b80cb6586 Tests: USB: Add Serial test for line coding change 2019-02-22 10:53:20 -06:00
Filip Jagodzinski bf3aa29e0b Tests: USB: Use the serial number to find device
Use the USB device SN instead of VID & PID to find the device port name
on the host system.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski 07ffcb4269 Tests: USB: Fix USB reconnect tests for Win hosts 2019-02-22 10:53:20 -06:00
Filip Jagodzinski 7a4b36c37f Tests: USB: Add tests for Serial class. 2019-02-22 10:53:20 -06:00
Filip Jagodzinski 3ed7d8139b Tests: USB: Add tests for CDC class. 2019-02-22 10:53:20 -06:00
Filip Jagodzinski 1f8bf46f2e Tests: USB: Check ep buffer is released by abort
Validate that endpoint buffer is not used after a transfer has been
aborted.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski c677bf7426 Tests: USB: Decrease the max data size for iso ep
Although the USB spec sets the upper limit on FS isochronous endpoint
payloads to 1023 B, this value is hard to test in practice. Moreover,
not all the targets Mbed OS supports (like NUCLEO_F207ZG) are able to
handle all the endpoints set to max.
2019-02-22 10:53:19 -06:00
Russ Butler 7563a0f03f Update test to restart reads after unstall
After an endpoint is unstalled any pending transfers are terminated.
This patch re-starts any reads that were ongoing.
2019-02-22 10:53:19 -06:00
Filip Jagodzinski 27bd1656b1 Tests: USB: Update ep callbacks
Endpoint callbacks no longer have endpoint as a param. This update was
introduced in #7267.
2019-02-22 10:53:19 -06:00
Filip Jagodzinski c12e2d15f5 Tests: USB: Add data toggle test 2019-02-22 10:53:19 -06:00
Filip Jagodzinski ff8a9b6ae8 Tests: USB: Update endpoint tests
Fix the host script issues present on Windows machines.
Add 0 B payload size to bulk endpoints test.
Update halt and abort tests according to PR comments.
Add an explicit request to start reading on OUT endpoints.
2019-02-22 10:53:19 -06:00
Filip Jagodzinski 62dc95f60a Tests: USB: Generic: Update documentation 2019-02-22 10:53:19 -06:00
Filip Jagodzinski 686126b8ea Tests: USB: Generic: Add basic endpoint tests 2019-02-22 10:53:19 -06:00
Filip Jagodzinski 79376c6f00 Tests: USB: Add device config files for Zadig
Zadig is a tool used to install generic USB drivers on Windows machines.
These drivers are necessary to run USB device test suite on Windows
hosts.
2019-02-22 10:53:18 -06:00
Russ Butler 799cde0fc3 Remove endpoint parameter from USB callbacks
Remove the endpoint parameter from endpoint callbacks. This
information is redundant because endpoints are known at
construction time because they must be in the configuration
descriptor.
2019-02-22 10:53:18 -06:00
Russ Butler 793044eb26 Fix various USB warnings
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
2019-02-22 10:53:17 -06:00
Maciej Bocianski d66e576227 USB basic test documentation update 2019-02-22 10:53:15 -06:00
Maciej Bocianski fee14771e9 USB basic test update
disable suspend/resume test
disable sync frame test
improve reset test
2019-02-22 10:53:15 -06:00
Maciej Bocianski bcfe96b83c Update usb test to connect and block itself
Update the basic usb test so it does blocking itself since blocking
connect was removed from USBDevice.
2019-02-22 10:53:15 -06:00
Russ Butler 9f94a5fc56 Fix typo in USBTester.h
Fix the spelling of product_release.
2019-02-22 10:53:15 -06:00