Serial console
The Qualcomm® Linux kernel uses the Qualcomm Generic Interface (GENI) serial driver to support the UART console on Qualcomm SoCs.Required kernel configuration
Verify that the following Kconfig options are enabled:.cfg fragment
and rebuild.
Add the serial console to the kernel command line
Add theconsole= parameter to KERNEL_CMDLINE_EXTRA in
meta-qcom/conf/machine/include/qcom-<SoC>.conf:
Connect hardware
Connect a USB-to-UART cable between the device and the host:Early boot messages (earlycon)
Theearlycon kernel parameter enables a minimal early console before the full
UART driver is initialised. It provides kernel messages from the very start of
the boot sequence, including the unpack of the initramfs and early device tree
processing, that would otherwise be invisible.
Add to the kernel command line:
ttyMSM0 UART. Messages
appear immediately from the first line of start_kernel().
earlycon and console=ttyMSM0,... are independent. Use both together
to get uninterrupted output from early boot through the login prompt.printk log levels
printk is the kernel’s logging function. Every message carries a log level
that controls whether it appears on the console.
Table: printk log levels
Messages with a level numerically lower than the current console log level are
printed to the console. The default console log level on Qualcomm Linux is 7
(all messages printed). With the default console log level of 7, messages at
levels 0–6 (Emergency through Info) reach the console. Set the level to 8 to
include debug output.
Runtime log level control
Read and set the console log level at runtime via/proc/sys/kernel/printk.
The file contains four space-separated values:
<current> <default> <minimum> <boot-time-default>.
Boot-time log level
Set the log level on the kernel command line to control verbosity before/proc is mounted:
Read the kernel log buffer
dmesg
The most common way to read the kernel ring buffer:/proc/kmsg
virtual proc file that provides a live stream of kernel messages. Each read returns new messages only:Persistent logs across reboots
On systems running systemd-journald, kernel messages are stored persistently and can be queried across boots:Disable console logging
To silence the console for production or performance testing:Debug builds
To include debug symbols and extra debug Kconfig in the Yocto image, passDEBUG_BUILD=1 to the bitbake invocation. This enables debug.config fragments
in the kernel build:
build/conf/local.conf:

