I’m working through a problem trying the enable uart1 on my Compute Module 3 board. While doing so, I’ve been checking the device tree and am a little confused as to which device tree is used by u-boot.
From what I can tell, U-Boot should be using the bcm2836_rpi_2_b.dts file. However, looking at the U-Boot yocto build log, I can see mender has some tasks which are also interacting with the device trees (I think it’s selecting bcm2710-rpi-cm3.dtb).
So, what is the actual device tree which is used by U-Boot in this case?
Have you seen the " Problem using ‘dtoverlay=pi3-disable-bt’" section in “Known Issues” @ Raspberry Pi Compute Module 3?
Also it is the boot firmware that chooses which device tree to load, and the boot scripts in meta-mender re-use that.
what is the actual device tree which is used by U-Boot in this case
This question can lead to confusion, U-boot has a built-in (part of its source code) device tree which it is used so none of the mentioned dtb files are used by U-boot.
The dtb files that you are referring to are something that is passed along to the Linux kernel and parsed by Linux kernel only.
Yes, I had seen the pi3-disable-bt issue. Currently I have UART0 working correctly on GPIO 14 & 15. I just can’t get uart1 to register a device entry in /dev - tried on GPIO 31&32 and 40&41, but no luck.
At the risk of going off-topic from this forum, this is my issue:
The following error is reported at start-up:
[ 1.671967] bcm2835-aux-uart 3f215040.serial: unable to register 8250 port - -28 [ 1.679389] bcm2835-aux-uart: probe of 3f215040.serial failed with error -28
I’m using Yocto built Kernel version 4.14.68.
The following are the changes in my config.txt
core_freq=250 dtoverlay=pi3-disable-bt dtparam=uart1=on dtoverlay=uart1,txd1_pin=40,rxd1_pin=41 enable_uart=1
I had thought that maybe there was some issue with how U-Boot was enabling uart1 incorrectly, before the kernel kicked in.
EDIT - Solution:
Currently an overlay is required to get UART1 working on the CM3 with Yocto, see: github
Sorry, not much. I didn’t even know that you could have two uarts enabled at the same time on the Raspberry Pi 3.
Does this work with a stock image, e.g Raspbian?
I believe they should both work simultaneously;
“UART1 is the mini-UART of the Pi3, a.k.a. ttyS0, while UART0 is ttyAMA0. Be aware that the core (VPU) clock frequency must not change while UART1 is in use, so you need to add core_freq=250 to config.txt.”
Will test out a stock image now.
Just tested my CM3 with a stock Raspbian Image and the uart1 enabled on pins 41 and 42, with ttyAMA0 on pins 14 and 15.
I can verify that uart1 works simultaneously with uart0. So maybe it’s either a U-Boot and/or Yocto sumo issue. Will also disable mender from the build to confirm 100% that its not causing any issues.
Then it is probably U-boot that is messing things up.
I would suggest to scrape out anything uart related from U-boot source code dtb,
I’ve reverted to a sumo yocto build without mender or my platform layers. Testing on the CM3 with and without U-Boot enabled results in the same error as before.
root@raspberrypi-cm3:~# dmesg | grep uart
[ 0.655113] uart-pl011 3f201000.serial: cts_event_workaround enabled
[ 1.670428] bcm2835-aux-uart 3f215040.serial: unable to register 8250 port - -28
[ 1.677877] bcm2835-aux-uart: probe of 3f215040.serial failed with error -28
[ 1.783401] uart-pl011 3f201000.serial: no DMA platform data
I’ll try a thud and main branchs, then move to the meta-raspberrypi mailing list.
Thanks for your help