How to suppress a kernel message about meson_uart

Post Reply
paulcrawford
Posts: 144
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 18 times
Been thanked: 1 time
Contact:

How to suppress a kernel message about meson_uart

Unread post by paulcrawford » Thu Sep 19, 2019 10:51 pm

I have written "c" code to change the baud rate on ttyS1 to the appropriate value for each of three serial input lines which alternate in sequence to my N2. One input is at 9600 while the other two are at 38400. Everything works fine with this arrangement but the kernel puts a message in the syslog for each change made:

Code: Select all

Sep 19 09:37:36 no kernel: [404910.228108@0] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 38400 to 9600
Sep 19 09:37:36 no kernel: [404910.543774@0] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 9600 to 38400
This is taking up room in the syslog unnecessarily so I would like to suppress this message.

Does anyone know how to do this explicitly? I have tried setting different log levels but the message still seems to persist.

Thanks.

User avatar
odroid
Site Admin
Posts: 32360
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 147 times
Been thanked: 325 times
Contact:

Re: How to suppress a kernel message about meson_uart

Unread post by odroid » Fri Sep 20, 2019 9:38 am

I couldn't find which Kernel driver makes that message.
https://github.com/hardkernel/linux/blo ... #L294-L311
I hope other people can help you.
These users thanked the author odroid for the post:
paulcrawford (Fri Sep 20, 2019 10:39 am)

User avatar
tobetter
Posts: 4038
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 43 times
Been thanked: 189 times
Contact:

Re: How to suppress a kernel message about meson_uart

Unread post by tobetter » Fri Sep 20, 2019 12:11 pm

The actual code where prints the log is here.
https://github.com/hardkernel/linux/blo ... art.c#L556

Since the log prints with dev_info(...), you would be able to suppress it by changing the log level. Please check the log level if it's higher than 6 which is KERN_INFO. But what I am wondering is that you change the baud rate on ttyS1, I suppose if you open the port as a terminal or a regular TTY port. If it's opened as a TTY port for serial communication, it shouldn't be opened as a terminal.
These users thanked the author tobetter for the post:
paulcrawford (Fri Sep 20, 2019 11:04 pm)

paulcrawford
Posts: 144
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 18 times
Been thanked: 1 time
Contact:

Re: How to suppress a kernel message about meson_uart

Unread post by paulcrawford » Fri Sep 20, 2019 11:04 pm

I did try already to change the log levels and could not suppress the message in syslog. While I do not fully understand how the log levels work, one article I read indicated that the log level really defines what gets printed to the screen only and anything else goes into the log. I could perhaps make my own log that only included messages from my program rather than using syslog to view them but that could be a lot of effort. Another thought I had was to change the baud rate in the one serial line to match the other two so that there was no change in baud rate. As it turns out that is very easy to do as the serial transmit line comes from an ATmega328p which I am running with a crystal at 11.0592MHz. The present baud rate is 9600 but that could easily be changed to 38400 by changing a define in the c code and recompiling. Which brings me to why I am changing the baud rate at all.

I have three devices that produce serial data that must be read by the N2. Two of the devices are commercial products with maximum baud rates of 38400 so I chose that rate to run the serial port on ttyS1. They also require a transmit from the N2 to start receive on the N2. The third device is the ATmega328p which I can control because I wrote the c program that it runs. Also that device is in transmit only mode and continuously sends that data which needs to be read by the N2. Originally I had used the 9600 baud rate because the code that I based my code on used that value. At the time I developed the code, I did not realize that I could easily change the baud rate with 0% error in the serial line because of use of the 11.0592MHz crystal. Now that I know that, that will be the solution: make all three baud rates the same so there will be no change in baud rate.

As to why I am doing my serial reads this way, each device can only be read separately so I decided to use only one serial port to minimize the use of GPIO pins. When I was running everything on a C2 I did actually use two serial ports, one for the 38400 devices and one for the 9600 device. When I ported everything to the N2, I wanted access to the new PWM pins, but could not do that and have access to two serial ports, so I combined all of the serial input lines to one serial port. Obviously all three serial lines are not connected to the N2 serial port, ttyS1, at the same time. I have solid state relays to switch the serial lines along with a MAX3232 chip to convert the RS232 level signals from the commercial devices down to 3.3V for the N2 and a voltage divider bridge to reduce the 5V level signal from the ATmega328p down to 3.3V for the N2. The solid state relays are controlled by GPIO pins via BJT transistors to connect the appropriate serial line to the serial port.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests