To debug boot-up issues we need to configure Serial port as console in Kernel . We can easily collect dmesg information with this.
Steps to enable Serial logging :
1) Make sure serial driver statically built with kernel image . If it built as a module , we can not get bootup logs as it will not loaded at that time. If it is built as modules , make sure module name is added to /etc/modules.conf. So that module will be loaded .
2) Need to add kernel boot parameters for enabling serial port as console
Edit /etc/default/grub file
Replace GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" with
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS4,115200n8 debug ignore_loglevel"
close the file and execute "sudo update-grub".
Make sure target system UART is connected to other system and configure UART.
Reboot the system and observe the logs will be displayed in both test system and Other system.
console=tty0 => the kernel to continue using the standard console device. Boot messges will be dispayed on target system monitor.
console=ttyS4 => the kernel to also use the first serial device as a console. ttySn , n will be the serial port device available. grep dmesg with "ttyS" to find available ports in your system.
115200n8 sets the serial speed to 115200 bits per second with no parity and 8 data bits per character. The other end of the serial line also must be configured to same settings.
debug ignore_loglevel allows you to see ALL kernel messages on the configured console.
drm.debug=14 => if we need to enable drm specifc logs other than all logs.
log_buf_len=16M => set the dmesg buffer size to get all required logs.
Steps to enable Serial logging :
1) Make sure serial driver statically built with kernel image . If it built as a module , we can not get bootup logs as it will not loaded at that time. If it is built as modules , make sure module name is added to /etc/modules.conf. So that module will be loaded .
2) Need to add kernel boot parameters for enabling serial port as console
Edit /etc/default/grub file
Replace GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" with
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS4,115200n8 debug ignore_loglevel"
close the file and execute "sudo update-grub".
Make sure target system UART is connected to other system and configure UART.
Reboot the system and observe the logs will be displayed in both test system and Other system.
console=tty0 => the kernel to continue using the standard console device. Boot messges will be dispayed on target system monitor.
console=ttyS4 => the kernel to also use the first serial device as a console. ttySn , n will be the serial port device available. grep dmesg with "ttyS" to find available ports in your system.
115200n8 sets the serial speed to 115200 bits per second with no parity and 8 data bits per character. The other end of the serial line also must be configured to same settings.
debug ignore_loglevel allows you to see ALL kernel messages on the configured console.
drm.debug=14 => if we need to enable drm specifc logs other than all logs.
log_buf_len=16M => set the dmesg buffer size to get all required logs.