Redirect Console to USB

I’m trying to redirect the console output to a USB port (specifically the OTG micro usb port) because I don’t have access to the UART pins on the J21 header.

I tried to add “console=ttyUSB0” in the /boot/extlinux/extlinux.conf file. After a reboot, I confirmed that this new entry appeared in /proc/cmdline however, I’m not receiving any console output from the FTDI usb-to-serial adapter that I have plugged into my TX2.

When I grep dmesg for “console” I get the following-

[ 0.000000] earlycon: Early serial console at MMIO32 0x3100000 (options ‘’)
[ 0.000000] bootconsole [uart0] enabled
[ 0.000000] Kernel command line: … console=ttyUSB0,115200n8 …
[ 0.013886] console [tty0] enabled
[ 0.017437] bootconsole [uart0] diabled
[ 0.150557] console [pstore-1] enabled

I have also verified that CONFIG_USB_SERIAL_CONSOLE is enabled in the kernel and my USB-to-serial device is available at /dev/ttyUSB0. Any suggestions on how to redirect the console over USB would be greatly appreciated. Thanks!

We don’t try it and other users may share their experience.

If you used “ttyUSB0” and not “/dev/ttyUSB0”, then I’d try with that full path. Also make sure that if a module is required for that serial UART then perhaps you need to build the module into the kernel instead of using as a module (a module won’t be loaded as the kernel starts…I don’t know if this would stop all attempts to send data to serial console).

In general, USB will enumerate later than the kernel starting. You may be able to get later console output/input onto that device, but if you have trouble during the initial boot, USB won’t be there for you.

Also, what USB adapter are you using for the console? Is it even a ttyUSB device, or is it a ttyACM or some other kind of device?

A $2 CP2103 UART-to-USB adapter plugged into the ttyS0 port would be the simplest and most robust solution. I don’t quite see how you could be connecting to some TTY device on the USB port, but not be able to connect to a USB TTY converter on the hardware UART?

I tried using both ttyUSB0 and /dev/ttyUSB0. Also, I built CONFIG_USB_SERIAL_CONSOLE into the kernel, not loaded as a module.

I have a TX2 carrier board which doesn’t have any extra GPIO pins broken out- I only have USB available for console output. I’m using an FTDI board from Sparkfun which shows up at /dev/ttyUSB0.

The CONFIG_USB_SERIAL_CONSOLE is only one driver involved…this is a somewhat generic protocol driver. The driver which talks to the actual serial UART (such as FTDI or CP2103) is a separate driver and must also be integrated in to the kernel. Quite possibly it is already integrated since you use FTDI, but you should check to be sure. Example:

zcat /proc/config.gz | egrep '(CONFIG_USB_SERIAL_FTDI_SIO|USB_SERIAL_CONSOLE)'

You might also want to check to be sure nothing else is grabbing the USB port.

1 Like

Thanks, so much for the help. I totally forgot to enable the FTDI driver.