GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Removing Kernel Warning

Fri Jan 12, 2018 12:44 am

I'm trying to eliminate all boot messages and I've succeeded except for 1 last message:

Code: Select all

bcm2835-aux-uart 3f215040.serial: could not get clk: -517 
I understand that this is only really a warning but I can't seem to stop it from displaying or having it not occur in the first place. What I have is a RPi 3 Model 3 V1.2 and running the following:

Code: Select all

[email protected]:~/build5.10/qt3d $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
[email protected]:~/build5.10/qt3d $ hostnamectl
   Static hostname: GI-Pi
         Icon name: computer
        Machine ID: 0af09f50a31249a69be1c2ec26ae5be4
           Boot ID: 3868cfc6e8734a4e92dcccdda7acf752
  Operating System: Raspbian GNU/Linux 9 (stretch)
            Kernel: Linux 4.9.70-v7+
      Architecture: arm
My /boot/cmdline.txt is:

Code: Select all

dwc_otg.lpm_enable=0 console=tty3 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait consoleblank=0 loglevel=3 logo.nolog quiet splash
in /boot/config.txt I have:

Code: Select all

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
enable_uart=1
dtoverlay=w1-gpio,gpiopin=26 #DSB1820 on pin header 37
gpu_mem=64

# GI Additions 20170831
disable_splash=1 #Disables color test

#Added 12/16/17
dtoverlay=gpio-poweroff,gpiopin=21,active_low="y"
dtoverlay=pi3-miniuart-bt
dtoverlay=gpio-shutdown,gpio_pin=20
I think that is all of the pertinent information.

Thanks in advance...

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Tue Jan 16, 2018 10:44 pm

Just checking in since it's been a while and nobody has had an answer for this. I would love even a clue as to what I can do to further research this.

User avatar
jojopi
Posts: 3088
Joined: Tue Oct 11, 2011 8:38 pm

Re: Removing Kernel Warning

Wed Jan 17, 2018 12:33 pm

That message is considered an error, not a warning, and you asked for loglevel=3. You can decrease that further if you do not even want errors to go to console:

Code: Select all

loglevel=       All Kernel Messages with a loglevel smaller than the
                console loglevel will be printed to the console. It can
                also be changed with klogd or other programs. The
                loglevels are defined as follows:

                0 (KERN_EMERG)          system is unusable
                1 (KERN_ALERT)          action must be taken immediately
                2 (KERN_CRIT)           critical conditions
                3 (KERN_ERR)            error conditions
                4 (KERN_WARNING)        warning conditions
                5 (KERN_NOTICE)         normal but significant condition
                6 (KERN_INFO)           informational
                7 (KERN_DEBUG)          debug-level messages
Alternatively it may be better to investigate the cause of the error. Or disable the uart if you are not using it.

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Wed Jan 17, 2018 2:54 pm

Thanks, I had tried changing the loglevel but perhaps that was before I was at this point. I am using the serial port to communicate with a device so added this overlay

Code: Select all

dtoverlay=pi3-miniuart-bt
Do you think the problem is before this overlay is applied. Once the system boots the UART is working as expected.

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Thu Jan 18, 2018 4:39 pm

If I comment out dtoverlay=pi3-miniuart-bt I still see that error but then that also breaks my serial port. I captured the complete kernel message with loglevel=1, here

Any ideas what is going on and could be causing this "temporary" error (temporary because the UART does work)

Code: Select all

bcm2835-aux-uart 3f215040.serial: could not get clk: -517

User avatar
HawaiianPi
Posts: 4878
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Removing Kernel Warning

Thu Jan 18, 2018 7:40 pm

The mini-UART can be problematic. It doesn't support parity, and it's baud rate is tied to the core clock, so doesn't have a stable baud rate unless you run with a fixed core frequency.

Have you tried dtoverlay=pi3-disable-bt instead.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Fri Jan 19, 2018 12:56 am

I just tried dtoverlay=pi3-disable-bt and that does appear to remove the message but of course this completely disables Bluetooth, right? In my case, this time, I don't need BT but I might in the future so are there any tricks to using the hardware UART for something else and still having BT?

User avatar
HawaiianPi
Posts: 4878
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Removing Kernel Warning

Fri Jan 19, 2018 1:08 am

I would be surprised if Bluetooth even worked with the mini-UART, but I haven't tried it myself.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Fri Jan 19, 2018 1:38 am

I found this site which adds the core_freq=250 option:

Code: Select all

dtoverlay=pi3-miniuart-bt
core_freq=250
I wonder if that's what I need to remove the error?

dgordon42
Posts: 764
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Removing Kernel Warning

Sat Jan 20, 2018 5:59 pm

Details of using 'dtoverlays' on the Pi are in the file:

Code: Select all

/boot/overlays/README
Here is what is says about the "pi3-miniuart-bt" overlay:
Name: pi3-miniuart-bt
Info: Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
usable baudrate.
N.B. It is also necessary to edit /lib/systemd/system/hciuart.service
and replace ttyAMA0 with ttyS0, unless you have a system with udev rules
that create /dev/serial0 and /dev/serial1, in which case use
/dev/serial1 instead because it will always be correct. Furthermore,
you must also set core_freq=250 in config.txt or the miniuart will not
work.
Load: dtoverlay=pi3-miniuart-bt
Params: <None>

Up to date Raspbian uses the 'serial0' and 'serial1' aliases for the UART's, so it should not be necessary for you to edit the '/lib/systemd/system/hciuart' file.
It also helps if you use '/dev/serial0' as the device name of the Serial Port on the GPIO's regardless of any dtoverlays in use.

Hope this helps,
Dave.

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Sat Jan 20, 2018 7:52 pm

Hi Dave,

Thanks, that does help! I should have thought of going back to the source of the information rather than just reply on internet searches. I just checked my /lib/systemd/system/hciuart.service file and I only see this:

Code: Select all

[Unit]
Description=Configure Bluetooth Modems connected by UART
ConditionPathIsDirectory=/proc/device-tree/soc/[email protected]/bt_pins
Before=bluetooth.service
Wants=dev-serial1.device
After=dev-serial1.device

[Service]
Type=forking
ExecStart=/usr/bin/btuart

[Install]
WantedBy=multi-user.target
So I think your assumption that the change to this service is not needed.
It also helps if you use '/dev/serial0' as the device name of the Serial Port on the GPIO's regardless of any dtoverlays in use.
Could you elaborate on this comment. In our Qt program that accesses the serial port we are using serial0 even though I found that ttyAMA0 worked just as well since I think the 2 names are just linked.

George

dgordon42
Posts: 764
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Removing Kernel Warning

Sat Jan 20, 2018 9:44 pm

Originally, RaspberryPis used '/dev/ttyAMA0' (the full UART) to generate the Serial Port on the GPIO pins. Then, along came the Pi 3B, and with it Bluetooth (and WiFi). The Bluetooth hardware interfaces with the Pi via a serial port, and the Foundation chose to use 'ttyAMA0' as that serial port, and '/dev/ttyS0' (the mini UART) as the GPIO's serial port.

This caused a lot of confusion, as software that used the Serial Port on older models would no longer work on the Pi 3B.

The Foundation's solution was to create the aliases '/dev/serial0' and '/dev/serial1'. As you have discovered, these are just sim-links to 'ttyAMA0' and 'ttyS0'. The clever bit is that at boot time 'serial0' is set up so that it always points to the UART on the GPIO pins, and 'serial1' always points to the UART that connects to Bluetooth. Normally, on a Pi 3B (or Zero W) 'serial0' points to 'ttyS0', which connects to the GPIO pins, and 'serial1' points to ttyAMA0, which connects to Bluetooth.

As you are running with the overlay "dtoverlay=pi3-miniuart-bt", the roles of the UARTs are reversed, so in your case 'serial0' points to ttyAMA0.
The point is that, regardless of Pi model or overlays used, 'serial0' always points to the UART on the GPIO pins, and code using 'serial0' will work on any Pi. The Foundation have also said that this naming convention will remain valid on any new models that may appear in the future.

The 'serial0' and 'serial1' aliases and naming convention were only introduced a few months after the Pi 3B launch, hence the note about checking the entries in the 'hciuart.services' file. When the 3B was launched first, that file was hard coded with '/dev/ttyAMA0', and if you used the 'pi3-miniuart-bt' overlay, you had to modify the file by hand. The 'serial1' alias makes this unnecessary.

Longer version here

Dave.

GeorgeIoak
Posts: 50
Joined: Thu Aug 30, 2012 1:50 am

Re: Removing Kernel Warning

Thu Jan 25, 2018 1:06 am

Clear as mud! Just kidding, I remember reading that somewhere along my research but I understand and agree that using serial0 is the way go.

I just changed my config.txt to this:

Code: Select all

#Added 12/16/17
dtoverlay=gpio-poweroff,gpiopin=21,active_low="y"
dtoverlay=pi3-miniuart-bt
cpu_freq=250
#dtoverlay=pi3-disable-bt
dtoverlay=gpio-shutdown,gpio_pin=20
and I still see that error message so the only way I have been able to remove that message is by completely disabling BT.

Return to “Troubleshooting”