Enable UART1 in Beaglebone Black Yocto Kirkstone (meta-ti layer)

I am doing yocto project (kirkstone) on Beaglebone Black board using meta-ti layer.
I want to enable UART1 in my BBB. I tried different tutorials, but still it is not working.
In some tutorials, I saw to add the BB-UART1-00A0.dtbo file in the uEnv.txt file but I could’nt find uEnv.txt file in my yocto image.

So, how can I enable UART1 in my yocto build?

Thanks in advance.

at beginning of boot, dose it say it’s loading uEnv.txt or extlinux.conf
if, extlinux.conf, then add your dtbo to extlinux.conf
fdtoverlays /overlays/.dtbo
make sure to remove the ‘#’ that may be in front of fdtoverlays

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf

here is what i have in my extlinux.conf

	KERNEL ../zImage
	FDTDIR ../
	fdtoverlays /../BB-I2C1-RTC-DS3231.dtbo /../BB-UART1-00A0.dtbo 
	APPEND root=PARTUUID=${uuid} rootwait rw earlycon console=${console},${baudrate}

for the sdcard
nano /media/user/boot/extlinux/extlinux.conf

Thank you for your reply. I was able to find the extlinux.conf file in my boot folder. I added the .dtbo file as you mentioned. But still when I try to transfer data from PC to BBB using the uart1 pins of my beaglebone black, I am not able to recieve any data.

When I run

dmesg | grep tty

I am getting the following output:

root@beaglebone:~# dmesg | grep tty
[ 0.000000] Kernel command line: root=PARTUUID=1d02a282-02 rootwait rw earlycon console=ttyO0,115200n8,115200
[ 0.033989] WARNING: Your ‘console=ttyO0’ has been replaced by ‘ttyS0’
[ 3.438654] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 41, base_baud = 3000000) is a 8250
[ 3.447922] printk: console [ttyS0] enabled
root@beaglebone:~#

Also do I have to make any changes in the yocto/poly/meta-ti/meta-ti-bsp/conf/machine/beaglebone.conf file

#@TYPE: Machine
#@NAME: BeagleBone machine
#@DESCRIPTION: Machine configuration for the http://beagleboard.org/bone board

require conf/machine/include/ti33x.inc

PREFERRED_PROVIDER_virtual/kernel = “linux-bb.org

KERNEL_DEVICETREE_PREFIX = “am335x-bone”

KERNEL_DEVICETREE = "
am335x-bone.dtb
am335x-boneblack.dtb
am335x-boneblack-pps.dtb
am335x-boneblack-uboot.dtb
am335x-boneblack-uboot-univ.dtb
am335x-boneblack-wireless.dtb
am335x-boneblue.dtb
am335x-bonegreen.dtb
am335x-bonegreen-gateway.dtb
am335x-bonegreen-wireless.dtb
am335x-bonegreen-wireless-uboot-univ.dtb
am335x-pocketbeagle.dtb
am335x-sancloud-bbe.dtb
am335x-sancloud-bbe-extended-wifi.dtb
am335x-sancloud-bbe-lite.dtb
"

#Extra DT overlays/capes
KERNEL_DEVICETREE += "
AM335X-PRU-UIO-00A0.dtbo
BB-ADC-00A0.dtbo
BB-BBBW-WL1835-00A0.dtbo
BB-BBGG-WL1835-00A0.dtbo
BB-BBGW-WL1835-00A0.dtbo
BB-BONE-4D5R-01-00A1.dtbo
BB-BONE-eMMC1-01-00A0.dtbo
BB-BONE-LCD4-01-00A1.dtbo
BB-BONE-NH7C-01-A0.dtbo
BB-CAPE-DISP-CT4-00A0.dtbo
BB-HDMI-TDA998x-00A0.dtbo
BB-I2C1-MCP7940X-00A0.dtbo
BB-I2C1-RTC-DS3231.dtbo
BB-I2C1-RTC-PCF8563.dtbo
BB-I2C2-BME680.dtbo
BB-I2C2-MPU6050.dtbo
BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo
BB-NHDMI-TDA998x-00A0.dtbo
BBORG_COMMS-00A2.dtbo
BBORG_FAN-A000.dtbo
BBORG_RELAY-00A2.dtbo
BB-SPIDEV0-00A0.dtbo
BB-SPIDEV1-00A0.dtbo
BB-UART1-00A0.dtbo
BB-UART2-00A0.dtbo
BB-UART4-00A0.dtbo
BB-W1-P9.12-00A0.dtbo
BONE-ADC.dtbo
M-BB-BBG-00A0.dtbo
M-BB-BBGG-00A0.dtbo
PB-MIKROBUS-0.dtbo
PB-MIKROBUS-1.dtbo
"

MACHINE_GUI_CLASS = “bigscreen”
MACHINE_FEATURES += “screen touchscreen”
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"

SERIAL_CONSOLES = “115200;ttyS0”

i verified that BBB could receive data from an ESP module, /dev/ttyS1
P9 pins 24 and 26, make sure you cross rx/tx between serial ports (3.3 volts only)
did not try TX, but i’m sure it would works
did not make any changes to the yocto build meta files

when the BBB start to boot, are there any errors retrieving the file ??
Retrieving file: /extlinux/…/am335x-boneblack.dtb
Retrieving file: /…/BB-I2C1-RTC-DS3231.dtbo
Retrieving file: /…/BB-UART1-00A0.dtbo
Kernel image @ 0x82000000 [ 0x000000 - 0xbf8200 ]

Linux beaglebone 6.1.69-ti #1 SMP PREEMPT Mon Jan 29 18:20:26 UTC 2024 armv7l

are using a custom program to read the date or using cat /dev/ttyS1 ??
maybe add ‘screen’ to your build, in local.conf file
screen /dev/ttyS1 speed
warning: screen is a bit of a pain to exit.

IMAGE_INSTALL:append = "
i2c-tools
openssh
screen
"

Yes, while booting I am getting the following error.

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1:	Poky (Yocto Project Reference Distro)
Retrieving file: /extlinux/../zImage
append: root=PARTUUID=1e651458-02 rootwait rw earlycon console=ttyO0,115200n8,115200
Retrieving file: /extlinux/../am335x-boneblack.dtb
Invalid fdtoverlay_addr_r for loading overlays
Kernel image @ 0x82000000 [ 0x000000 - 0xc01200 ]
##Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ffe4000, end 8ffff305 ... OK
Starting kernel ...

These are the contents of my /boot folder and extlinux.conf file

root@beaglebone:~# cd /boot
root@beaglebone:/boot# ls
AM335X-PRU-UIO-00A0.dtbo
BB-I2C1-RTC-PCF8563.dtbo                  
BBORG_RELAY-00A2.dtbo                     
BB-ADC-00A0.dtbo                         
BB-I2C2-BME680.dtbo                      
BONE-ADC.dtbo                             
BB-BBBW-WL1835-00A0.dtbo                  
BB-I2C2-MPU6050.dtbo                                        
BB-BBGG-WL1835-00A0.dtbo                  
BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo                            
BB-BBGW-WL1835-00A0.dtbo                 
 BB-NHDMI-TDA998x-00A0.dtbo                                                    
BB-BONE-4D5R-01-00A1.dtbo                 
BB-SPIDEV0-00A0.dtbo                                            
BB-BONE-LCD4-01-00A1.dtbo                 
BB-SPIDEV1-00A0.dtbo                                   
BB-BONE-NH7C-01-A0.dtbo                   
BB-UART1-00A0.dtbo    
BB-UART2-00A0.dtbo        
BB-UART4-00A0.dtbo                                            
BB-BONE-eMMC1-01-00A0.dtbo                                 
BB-CAPE-DISP-CT4-00A0.dtbo                                   
BB-HDMI-TDA998x-00A0.dtbo                 
BB-W1-P9.12-00A0.dtbo                     
BB-I2C1-MCP7940X-00A0.dtbo                
BBORG_COMMS-00A2.dtbo                            
BB-I2C1-RTC-DS3231.dtbo                   
BBORG_FAN-A000.dtbo     
M-BB-BBG-00A0.dtbo    
M-BB-BBGG-00A0.dtbo  
MLO   
PB-MIKROBUS-0.dtbo       
PB-MIKROBUS-1.dtbo                     
am335x-boneblack.dtb
am335x-boneblue.dtb
am335x-bonegreen-gateway.dtb
am335x-bonegreen-wireless-uboot-univ.dtb
am335x-bonegreen-wireless.dtbam335x-bonegreen.dtb
am335x-pocketbeagle.dtb
am335x-sancloud-bbe-extended-wifi.dtb
am335x-bone.dtb   am335x-sancloud-bbe-lite.dtb
am335x-boneblack-pps.dtb                  
am335x-sancloud-bbe.dtb
am335x-boneblack-uboot-univ.dtb 
am335x-boneblack-uboot.dtb     
am335x-boneblack-wireless.dtb     
extlinux
u-boot.img
zImage

extlinux.conf file

root@beaglebone:/boot# cat extlinux/extlinux.conf 
#Generic Distro Configuration file generated by OpenEmbedded
LABEL Poky (Yocto Project Reference Distro)
	KERNEL ../zImage
	FDTDIR ../
	fdtoverlays /../BB-I2C1-RTC-DS3231.dtbo /../BB-UART1-00A0.dtbo 
	APPEND root=PARTUUID=${uuid} rootwait rw earlycon console=${console},${baudrate}

looks like you have modified the am335x-boneblack.dts file or one of it’s included files (if not, then)
do you get the same invalid fdtoverlay_addr_r error if you remove the fdtoverlays line from the extlinux.config file ??

No. I am not getting any errors when I remove fdtoverlays from extlinux.

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1:	Poky (Yocto Project Reference Distro)
Retrieving file: /extlinux/../zImage
append: root=PARTUUID=d26485ef-02 rootwait rw earlycon console=ttyO0,115200n8,115200
Retrieving file: /extlinux/../am335x-boneblack.dtb
Kernel image @ 0x82000000 [ 0x000000 - 0xc01200 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ffe4000, end 8ffff305 ... OK

Actually I haven’t modified any such files. But to make sure I cleared my deploy-ti directory and built a fresh image and added the .dtbo files. Still I am getting the same error while booting.

I have added my BB-UART1-00A0.dtbo file and am335x-boneblack.dtb file for reference.

BB-UART1-00A0.txt (1.5 KB)
am335x-boneblack.txt (204.0 KB)

a few things,
your am335x-boneblack.txt is totally different than my dts
the BB-UART1-00A0.txt does not exist as a dts file in my build, a search only returns dtbo files
are you sure all your meta data is kirkstone branch ?? have you done a “git pull” on each meta data ??

bitbake -e virtual/kernel | grep “^PV”
PV=“6.1.69+gitAUTOINC+a1f26a1958”

doing a reflog on meta-ti, how close is yours to mine ??
git reflog
78e26823 (HEAD → kirkstone, origin/kirkstone-wip, origin/kirkstone) HEAD@{0}: pull: Fast-forward
63dd9c4e (tag: cicd.kirkstone.202311161200, tag: 09.01.00.005) HEAD@{1}: checkout: moving from master to kirkstone
d29501f8 (tag: cicd.master.202311160100, master) HEAD@{2}: clone: from https://git.yoctoproject.org/meta-ti.git

i set my build up back in Nov 2023,

I think my all meta data is in krikstone branch.

$ bitbake -e virtual/kernel | grep "^PV"
PV="6.1.69+gitAUTOINC+a1f26a1958"
PV:aarch64="6.1.69+gitAUTOINC+a1f26a1958"
PV:armv7a="6.1.69+gitAUTOINC+a1f26a1958"
PVR_DISPLAY_CONTROLLER_ALIAS="tilcdc"

$ git reflog
8dac9b02 (HEAD -> kirkstone, tag: cicd.kirkstone.202403280400, origin/kirkstone-wip, origin/kirkstone) HEAD@{0}: clone: from git://git.yoctoproject.org/meta-ti

[quote="amf99, post:9, topic:38390"]
reflog on meta-ti,


vs
78e26823 (HEAD → kirkstone, origin/kirkstone-wip, origin/kirkstone
seems your meta-ti is checkout on a tag ??
i just cloned the " https://git.yoctoproject.org/meta-ti.git"
and checked out kirkstone and it is the same as what i built with.
as a test, maybe check out a clean meta-ti and use the kirkstone branch. just to verify things
make sure you back up your copy of meta-ti first.
unless we are working with apples to apples it will be difficult to debug your issue.

Yes, that is very true with yocto. Adding one package can mess up everything and it will build with out any errors.

1 Like

I used this same link to clone the meta-ti layer.

$ git reflog
c57b6314 (HEAD -> kirkstone, tag: cicd.kirkstone.202405141220, origin/kirkstone-next, origin/kirkstone) HEAD@{0}: clone: from https://git.yoctoproject.org/meta-ti.git

I added the .dtbo file for UART1 in extlinux.conf and booted, But got the same error again.

You might have to go into kernel config and turn on overlays.

did you not checkout kirkstone branch ??

can you do
git checkout remotes/origin/kirkstone -b kirkstone
and test that

the tag “cicd.kirkstone.202405141220” your using is in what i cloned, i’ll try to test that tomorrow.
is there a reason your using this tag ??

How to do that ? I add this 2 lines in my local.conf

IMAGE_INSTALL_append = " kernel-modules"
KERNEL_MODULE_AUTOLOAD += "overlay"

But the same Invalid error will be occurring. Also i checked if overlays are turned on using menuconfig

bitbake -c menuconfig virtual/kernel

But the Device tree overlays are already enabled.

If i run this command

$ git checkout remotes/origin/kirkstone -b kirkstone
fatal: A branch named 'kirkstone' already exists.

Leave out the -b OR

$git checkout remotes/origin/kirkstone -b my_kirkstone
$git checkout kirkstone

-b created a new branch and you all ready have an existing kirkstone branch

You should do the latter and do an out of tree build, this keeps your “good” tree clean and work out of the my_kirkstone.

To see what branch you are on:

$git status

To see all all available branches

$git branch -a
1 Like
$ git checkout remotes/origin/kirkstone -b my_kirkstone
M	meta-ti-bsp/conf/machine/beaglebone.conf
M	meta-ti-bsp/conf/machine/include/ti33x.inc
Branch 'my_kirkstone' set up to track remote branch 'kirkstone' from 'origin'.
Switched to a new branch 'my_kirkstone'
$ git checkout kirkstone
M	meta-ti-bsp/conf/machine/beaglebone.conf
M	meta-ti-bsp/conf/machine/include/ti33x.inc
Switched to branch 'kirkstone'
Your branch is up to date with 'origin/kirkstone'.
$ git status
On branch kirkstone
Your branch is up to date with 'origin/kirkstone'.
$ git reflog
c57b6314 (HEAD -> kirkstone, tag: cicd.kirkstone.202405141220, origin/kirkstone-next, origin/kirkstone, my_kirkstone) HEAD@{0}: checkout: moving from my_kirkstone to kirkstone
c57b6314 (HEAD -> kirkstone, tag: cicd.kirkstone.202405141220, origin/kirkstone-next, origin/kirkstone, my_kirkstone) HEAD@{1}: checkout: moving from kirkstone to my_kirkstone
c57b6314 (HEAD -> kirkstone, tag: cicd.kirkstone.202405141220, origin/kirkstone-next, origin/kirkstone, my_kirkstone) HEAD@{2}: clone: from https://git.yoctoproject.org/meta-ti.git

Now that you are on your own my_kirkstone, the changes made in kirkstone might not be present.

Since the kernel is configured for overlays, not sure what is wrong.
Make sure the file you modified has an absolute file path to the overlay. The abbreviate path is only applicable to the the official bb images.

Might have to use the linux debug port to see what is going on during boot.

Use gtkterm and capture the entire boot and then go over it.