serial-getty@ttyS0.service

I use USB serial cable for console.
I changed U-Boot setting “console”.
setenv console ttyUSB0

It works fine.
Forthermore I changed Chip Idea USB driver to kernel module.
The reason is for comsumption current.
Please refer to the following URL.
https://www.toradex.com/community/questions/62190/usb-power-off-during-suspend.html?childToView=62454#answer-62454

In kernel module case , ttyUSB0 is recognized normally, but serial-getty@ttyS0.service does not work properly.

If I change serial-getty@ttyS0 to serial-getty@ttyUSB0 , it works fine.

I wonder about serial-getty@ttyS0.
There is no ttyS0 in /dev/
Is ttyS0 special?

Best reagrds.

I seem to have misunderstood.

serial-getty @ ttyS0 is not working.

The following is output to the boot log.

[OK] Started Serial Getty on ttymxc0.

The result of “systemctl status serial-getty @ ttyS0” was inactive.

What is given to the kernel parameters may be systemd booting automatically.

It is possible that ttyUSB0 could not be started in a timely manner by making it a kernel module.

Either way, this method didn’t work with the USB plugging and unplugging.

The problem was solved by creating udev rules for ttyUSB0 while leaving the console as ttymxc0.

/etc/udev/rules.d/60-serial.rules

SUBSYSTEM == "usb-serial", KERNEL == "ttyUSB0", RUN + = "/ etc / udev / scripts / usb-serial.sh"
ACTION == "remove", GOTO = "serial_end"
SUBSYSTEM! = "tty", GOTO = "serial_end"

SUBSYSTEMS == "pci", ENV {ID_BUS} = "pci", ENV {ID_VENDOR_ID} = "$ attr {vendor}", ENV {ID_MODEL_ID} = "$ attr {device}"
SUBSYSTEMS == "pci", IMPORT {builtin} = "hwdb --subsystem = pci"
SUBSYSTEMS == "usb", IMPORT {builtin} = "usb_id", IMPORT {builtin} = "hwdb --subsystem = usb"

# / dev / serial / by-path /, / dev / serial / by-id / for USB devices
KERNEL! = "ttyUSB [0-9] * | ttyACM [0-9] *", GOTO = "serial_end"

SUBSYSTEMS == "usb-serial", ENV {.ID_PORT} = "$ attr {port_number}"

IMPORT {builtin} = "path_id"
ENV {ID_PATH} == "? *", ENV {.ID_PORT} == "", SYMLINK + = "serial / by-path / $ env {ID_PATH}"
ENV {ID_PATH} == "? *", ENV {.ID_PORT} == "? *", SYMLINK + = "serial / by-path / $ env {ID_PATH} -port $ env {.ID_PORT}"

IMPORT {builtin} = "usb_id"
ENV {ID_SERIAL} == "", GOTO = "serial_end"
SUBSYSTEMS == "usb", ENV {ID_USB_INTERFACE_NUM} = "$ attr {bInterfaceNumber}"
ENV {ID_USB_INTERFACE_NUM} == "", GOTO = "serial_end"
ENV {.ID_PORT} == "", SYMLINK + = "serial / by-id / $ env {ID_BUS}-$ env {ID_SERIAL} -if $ env {ID_USB_INTERFACE_NUM}"
ENV {.ID_PORT} == "? *", SYMLINK + = "serial / by-id / $ env {ID_BUS}-$ env {ID_SERIAL} -if $ env {ID_USB_INTERFACE_NUM} -port $ env {.ID_PORT}"

LABEL = "serial_end"

/etc/udev/scripts/usb-serial.sh

#! / bin / sh

if ["$ ACTION" = "bind"]; then
        systemctl start serial-getty @ ttyUSB0
fi

if ["$ ACTION" = "unbind"]; then
        systemctl stop serial-getty @ USB0
fi

Best regards.

OK.

Best regards.

Thanks for opening the question.