How to configure kernel, config.txt and cmdline.txt to get all kernel logs (starting from boot) in serial console (UART) only?
To clarify:
- I don't want to see any kernel log on HDMI monitor
- I don't want to see any kernel log on any tty
- I want to see all log on UART console
- I want maximum log level
It is obvious that this is useful when working on embedded project with RPI.
There are some good references here.
--
I will try to answer this question myself when I investigate the issue. Tips would be appreciated.
2 Answers 2
To get the requested logging it's not enough configuring only the kernel, config.txt and cmdline.txt. You need to disable tty1 login in "init" config as well. My project Nard SDK does pretty much exactly what you want so you can copy the setup from there.
http://www.arbetsmyra.dyndns.org/nard/
Edit: If you need the syslog to forever output everything to the UART in realtime; login and execute command "logread -f" in the console.
-
Thanks Ronny your project helped me to find answer. BTW, do you experience same problem which I described in answer?10robinho– 10robinho2015年08月25日 13:41:23 +00:00Commented Aug 25, 2015 at 13:41
-
Glad you found it. I'm unsure of what you mean with tty1 output problem. tty1 is usually the local HDMI screen. Is this what you mean?Ronny Nilsson– Ronny Nilsson2015年08月26日 07:55:44 +00:00Commented Aug 26, 2015 at 7:55
-
yes, tty1 is HDMI. But what if I want to have HDMI for some fancy user interface and log everything on tty2 so when problem happens I can plug in keyboard and switch to tty2 and inspect log? That is impossible to do I guess10robinho– 10robinho2015年08月26日 11:38:37 +00:00Commented Aug 26, 2015 at 11:38
-
Nothing is impossible... :) As I said in my original answer, you need to disable tty1 login in the "init" config as well. Have a look at "/etc/inittab"Ronny Nilsson– Ronny Nilsson2015年08月27日 11:46:23 +00:00Commented Aug 27, 2015 at 11:46
-
Its about kernel space, logging starts in kernel space. Of course I've disabled login consoles, it's not about that.10robinho– 10robinho2015年08月27日 15:33:40 +00:00Commented Aug 27, 2015 at 15:33
Here is how to make it:
1) Make sure kernel supports UART for RPI. In default raspbian kernel that should already be enabled. It's under drivers, called BCM2708 console driver.
2) in cmdline.txt add console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
and remove console=tty1
or any other tty
.
BTW I think there is a bug in RPI kernel which otuputs log to tty1
if you specify any other tty
(like tty3
for console
param.
Explore related questions
See similar questions with these tags.