Commit Graph

13 Commits (feature-hal-spec-usb-device)

Author SHA1 Message Date
Filip Jagodzinski aab52fc2a6 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-01-29 12:27:32 -06:00
Russ Butler 23f43ecd58 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-01-29 12:27:32 -06:00
Russ Butler 869003ccab 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-01-29 12:27:32 -06:00
Filip Jagodzinski 13ab89337e Tests: USB: Increas the size of RX CDC test data
This ensures the flow control is tested.
2019-01-29 12:27:32 -06:00
Filip Jagodzinski 9387165f8c Tests: USB: Update code comments 2019-01-29 12:27:32 -06:00
Filip Jagodzinski 7684ffd8b9 Tests: USB: Use SN generated by the host machine 2019-01-29 12:27:32 -06:00
Filip Jagodzinski 8801d20fde 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-01-29 12:27:32 -06:00
Filip Jagodzinski ffaa050a89 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-01-29 12:27:31 -06:00
Filip Jagodzinski 0f5c285182 Tests: USB: Add Serial test for line coding change 2019-01-29 12:27:31 -06:00
Filip Jagodzinski 30af468d86 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-01-29 12:27:31 -06:00
Filip Jagodzinski 9bbbe28796 Tests: USB: Fix USB reconnect tests for Win hosts 2019-01-29 12:27:31 -06:00
Filip Jagodzinski 776167a55f Tests: USB: Add tests for Serial class. 2019-01-29 12:27:31 -06:00
Filip Jagodzinski ba44260fe7 Tests: USB: Add tests for CDC class. 2019-01-29 12:27:31 -06:00