0

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

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 Aug 25 '15 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 Aug 26 '15 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 guess – 10robinho Aug 26 '15 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 Aug 27 '15 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 Aug 27 '15 at 15:33
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.