Use picocom to read serial in misc/xhcidbg-log
authorReto Buerki <reet@codelabs.ch>
Mon, 19 Aug 2019 09:47:05 +0000 (11:47 +0200)
committerReto Buerki <reet@codelabs.ch>
Mon, 19 Aug 2019 09:52:55 +0000 (11:52 +0200)
Separate configuration via stty and cat did not work very well, as
initial characters could get lost. Use a simple terminal emulation
program instead.

README.md
misc/xhcidbg-log

index 719c2a4972e4aa83fd04c5d41da42b5738d6c9a9..a38b2b25b8cddcfea39a06808d25f24b314549a9 100644 (file)
--- a/README.md
+++ b/README.md
@@ -34,17 +34,9 @@ The debug capability should be visible as:
 For convenience, the `xhcidbc-log` shell script in the `misc/` directory
 can be used to gather debug output from the device. It uses the
 `inotifywait` utility (part of [*inotify-tools*][2]) to wait for the
-device to be created and then display the output using `cat`. Either
-execute the script as root or make sure the user has the necessary
-access rights, e.g. is member of the `dialout` group.
-
-If there is no visible console output despite the serial device being present,
-the tty setting may be incorrect. Issue the following command to adjust the
-parameters:
-
-    $ stty -F /dev/serial/by-id/usb-secunet_HW.DbC_1-if00-port0 raw -echo
-
-`stty` is part of the [*coreutils* software collection][3].
+device to be created and then displays the output using `picocom`.
+Either execute the script as root or make sure the user has the
+necessary access rights, e.g. is member of the `dialout` group.
 
 ## BIOS considerations
 
@@ -66,4 +58,3 @@ debugging capability. To avoid any interference, the service should be stopped:
 
 [1]: https://www-ssl.intel.com/content/www/us/en/io/universal-serial-bus/extensible-host-controler-interface-usb-xhci.html
 [2]: https://github.com/rvoicilas/inotify-tools/wiki
-[3]: https://www.gnu.org/software/coreutils/
index 6f1e5742275593ebbc60963e2bc397e908baa9a2..3c96eb505135192b796f38b0b0142f3f4fa81ed4 100755 (executable)
@@ -28,7 +28,7 @@ while true;
 do
        for f in "/dev/serial/by-id/usb-secunet_HW.DbC"*; do
                if [ -e "$f" ] ; then
-                       cat "$f"
+                       picocom -b 115200 -r -l "$f"
                        break 2;
                else
                        inotifywait -qe create /dev/serial/by-id 2>&1