Disable Linux Serial Console

Our custom carrier board was designed to use UART C as serial console for both uboot and Linux. Uboot was updated and rebuilt to accommodate this change. When serial console (at UART C) was enabled by default, kernel boots up just fine. However, when the console was disabled by the following commands at uboot prompt,the kernel seems not running properly as the Linux logo is hanging on screen for much longer time (like 4~5 minutes longer) before out application launches automatically.

Colibri iMX6 #setenv setup 'setenv setupargs fec_mac=${ethaddr} consoleblank=0  no_console_suspend=1 vt.global_cursor_default=0 console=null,${baudrate}n8' 
Colibri iMX6 #saveenv

This happened to the latest version (V1.1A) of the module. The older V1.0B version does not have this issue.
By checking PCN, I didn’t see any changes in the new version that may cause this issue. Can Toradex help with that?

Are you using the same Software versions on the two modules?

It could be that systemd waits for the console, what did you set in the OE variable SERIAL_CONSOLE?

You can disable systemd console service using systemctl, see here.

No sure how to check the OE variable SERIAL_CONSOLE.
I did use systemctl as described in that article. I didn’t see the command takes any effect as the serial console is still enabled after command issued or system reboot.

I assume you replaced ttyS0 with the device for UART_A ttymxc0?

Can you post the output of just systemctl status and systemctl --state=failed list-units?

The SERIAL_CONSOLE variable a variable you can set when you build the image using OpenEmbedded. In case you did not rebuild the image you are running the image with defaults (which is UART_A enabled).

I did rebuild the image, but didn’t change SERIAL_CONSOLE variable. We use UART_C for uboot serial console and want to be able to disable serial console on UART_C port when we need to. Below is the command output.

root@colibri-imx6:~# systemctl disable serial-getty@ttymxc2.service
root@colibri-imx6:~# systemctl disable serial-getty@ttymxc0.service
root@colibri-imx6:~# systemctl status
[[1;31mâÛ[0m colibri-imx6
    State: [[1;31mdegraded[[0m
     Jobs: 0 queued
   Failed: 1 units
    Since: Mon 2001-01-01 00:01:05 UTC; 16 years 7 months ago
   CGroup: /
           ââsystem.slice
           â ââpolkit.service
           â â ââ681 /usr/lib/polkit-1/polkitd --no-debug
           â ââwpa_supplicant.service
           â â ââ599 /usr/sbin/wpa_supplicant -u
           â ââlxdm.service
           â â ââ597 /usr/sbin/lxdm-binary
           â â ââ601 /usr/bin/X -s 0 -nocursor :0 vt07 -nolisten tcp -novtswitch
           â ââsystemd-resolved.service
           â â ââ594 /lib/systemd/systemd-resolved
           â ââsystemd-networkd.service
           â â ââ570 /lib/systemd/systemd-networkd
           â âârc.autohdmi.service
           â â ââ526 autohdmi
           â ââconnman.service
           â â ââ544 /usr/sbin/connmand -n
           â ââsystemd-logind.service
           â â ââ514 /lib/systemd/systemd-logind
           â ââdbus.service
           â â ââ494 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
           â ââavahi-daemon.service
           â â ââ491 avahi-daemon: running [colibri-imx6.local
           â â ââ578 avahi-daemon: chroot helpe
           â ââsystemd-timesyncd.service
           â â ââ362 /lib/systemd/systemd-timesyncd
           â ââsystemd-udevd.service
           â â ââ196 /lib/systemd/systemd-udevd
           â ââsystemd-journald.service
           â â ââ170 /lib/systemd/systemd-journald
           â ââsystem-serial\x2dgetty.slice
           â   ââserial-getty@ttymxc0.service
           â     ââ596 /sbin/agetty -8 -L ttymxc0 115200 xterm
           ââuser.slice
           â ââuser-0.slice
           â   ââsession-c2.scope
           â   â ââ595 /bin/login --
           â   â ââ670 -sh
           â   â ââ749 systemctl status
           â   â ââ750 less
           â   ââsession-c1.scope
           â     ââ610 /usr/lib/lxdm/lxdm-session
           â     ââ616 /home/root/PSA_ENTRY_BOOTH
           â     ââ626 /usr/bin/dbus-launch --auto-syntax --exit-with-session
           â     ââ627 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
           â     ââ650 /usr/lib/at-spi2-core/at-spi-bus-launcher
           â     ââ653 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
           â     ââ656 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
           â     ââ659 /usr/lib/gvfs/gvfsd
           ââinit.scope
             ââ1 /sbin/init rw,noatime
root@colibri-imx6:~# systemctl --state=failed list-units

UNIT LOAD ACTIVE SUB DESCRIPTION
[[1;31mâÛ[0m [[1;31msystemd-modules-load.service[[0m loaded [[1;31mfailed failed[[0m Load Kernel Modules

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

[[1;39m1 loaded units listed.[[0m Pass --all to see loaded but inactive units, too.

To show all installed unit files use ‘systemctl list-unit-files’.

This looks pretty good You seem to use a kernel which has been customized outside of OE or has some kernel modules not available?

So an after you disable this two serial consoles, then reboot, it still boots slow? And the only difference is whether you enable or disable serial console? How do you enable/disable the console?

To see what is slowing down the boot you can also enable just the framebuffer console (add console=tty1 to setupargs again).

This looks pretty good You seem to use a kernel which has been customized outside of OE or has some kernel modules not available?
Yes, the kernel was rebuilt from source code outside OE.
So an after you disable this two serial consoles, then reboot, it still boots slow? And the only difference is whether you enable or disable serial console? How do you enable/disable the console?
It looks me that the two disable serial console commands did not take effect as the linux console was still active after reboot.
Yes, the difference is whether serial console is disabled.
The way console is disabled is shown in my original post. To enable it, just replace “null” in the u-boot command with “ttymxc2” for UART_C port.

To see what is slowing down the boot you can also enable just the framebuffer console (add console=tty1 to setupargs again)
Just added framebuffer console as you suggested, I saw this message at bottom of the display when the boot was stuck:
“…retries left=0 opcode=xxout waiting for hardware interrupt.” (xx varying among 34,37,8e,5e,1e … ).
I am wondering how this message should be interpreted.

Hm, these error messages look like SD-card related (see also mmc error on just flashed board - Toradex Community).

I doubt that this messages are the cause of the issue.

But it should be fairly easy to test: Can you try without SD-card inserted?

FWIW, null seems not a valid option for console= as far as I can tell. To disable serial console I suggest to just remove the complete console= term.

I did not have any SD card inserted when I got that message on the display.On our custom carrier board, the 'WAKEUP/MMC_CD" pin of the SoM is always grounded meaning that SD card always appears inserted even though it is not present in the holder . Is this the problem?

I tried removed complete "console=’ term. But the log is shown on the display, which we don’t like to see. How can frame buffer console be removed with “console=” term removed from the command ?

The Framebuffer console should disappear when you remove the console=tty1 part, see also

http://developer.toradex.com/knowledge-base/framebuffer-(linux)#Disable_Framebuffer_Console

Below are the commands I used in order to remove framebuffer console:

setenv setup 'setenv setupargs ${memargs} consoleblank=0'
saveenv

Are these correct? The serial console is disabled with these commands. But kernel boot log still appears on the screen meaning framebuffer console did not get removed.

Yes, if you are using our regular bootcmd which calls run emmcboot this should be enough. You can try resetting the environment using env default -a and try again. Otherwise can you please share the kernel boot log (copy/paste or screenshot of the first part, where Booting Linux... is displayed or using dmesg > logfile and upload that file.

logfile

Hm, I see, the kernel falls back to the tty1 console if no console is specified. Adding console=null seems to really help to work around that.

I just tested using 2.7b3 release and a V1.1A module.

setenv setup 'setenv setupargs ${memargs} consoleblank=0 console=null'
saveenv

This worked fine here, the board booted in around 10 seconds.

I don’t think that this is hardware related… Which BSP version are you using exactly on the two modules?

Can you try again with this settings and provide the full journal log journalctl -b 0 > journal.log.

Adding “console=null” does fix the issue. Bootup time is around 10 seconds, which is good. Thank you so much for prompt help.