mirror of https://github.com/ARMmbed/mbed-os.git
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. |
||
---|---|---|
.. | ||
README.md | ||
main.cpp |
README.md
udev
rules for Mbed USB CDC device
Before running tests-usb_device-serial
test suite on Debian-based Linux
distros, make sure to update the udev
rules as follows:
sudo tee /etc/udev/rules.d/99-ttyacms.rules >/dev/null <<EOF
ATTRS{idVendor}=="1f00" ATTRS{idProduct}=="2013", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="1f00" ATTRS{idProduct}=="2012", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF
sudo udevadm control --reload-rules
This will prevent the ModemManager
daemon from automatically opening the port
and sending the AT commands
, which it does for every new /dev/ttyACM
device
registered in system.