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

I think we are confusing you.
your tag branch, save this some where else, so you have all your changes
then do as @foxsquirrel indicated
clone the meta ti
checkout
git checkout remotes/origin/kirkstone -b my_kirkstone
do your build and test the uart,
if you need things from your tag branch before testing the uart, then merge the changes to the my_kirkstone checkout branch, only merge what is needed to test the uart.

1 Like

I just made a basic core image minimal on kirkstone and this is the boot. I need to see if you and I are on the same page. Please compare this to your boot.

U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
Trying to boot from MMC2


U-Boot 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core:  150 devices, 14 uclasses, devicetree: separate
WDT:   Started wdt@44e35000 with servicing (60s timeout)
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... 
** Unable to use mmc 0:1 for loading the env **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net:   eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] ...
board_rev=[000C] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Couldn't find partition 0:2 0x82000000
Can't set block device
Couldn't find partition 0:2 0x82000000
Can't set block device
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1:	Yocto
Retrieving file: /zImage
append: root=PARTUUID=6db76e85-02 rootwait console=ttyS0,115200
Retrieving file: /am335x-boneblack.dtb
Kernel image @ 0x82000000 [ 0x000000 - 0x784fb8 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ffec000, end 8ffff657 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 5.15.150-yocto-standard (oe-user@oe-host) (arm-poky-linux-gnueabi-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 PREEMPT Mon Mar 11 14:54:41 UTC 2024
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: TI AM335x BeagleBone Black
Memory policy: Data cache writeback
cma: Reserved 16 MiB at 0x9e800000
Zone ranges:
  Normal   [mem 0x0000000080000000-0x000000009fefffff]
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000080000000-0x000000009fefffff]
Initmem setup node 0 [mem 0x0000000080000000-0x000000009fefffff]
CPU: All CPU(s) started in SVC mode.
AM335X ES2.1 (sgx neon)
Built 1 zonelists, mobility grouping on.  Total pages: 129666
Kernel command line: root=PARTUUID=6db76e85-02 rootwait console=ttyS0,115200
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off

2 Likes

@foxsquirrel
can you add

fdtoverlays  /../BB-UART1-00A0.dtbo 

to your extlinux.conf
the issue @apm is having is that when he adds the dtbo to the conf file, he get

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

I donā€™t get this error when I use kirkstone branch of meta-ti
for both
MACHINE ?= ā€œbeagleboneā€
MACHINE ?= ā€œbeaglebone-yoctoā€

Iā€™m building the
tag: cicd.kirkstone.202311161200 branch now (clean build, so it will take a few hours)
building for MACHINE ?= ā€œbeagleboneā€ first,

Not sure what @apm is doing different,
the following is from the tag branch you showed above
i donā€™t get the errors that you have indicated.

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1: Poky (Yocto Project Reference Distro)
Retrieving file: /extlinux/ā€¦/zImage
append: root=PARTUUID=1856a583-02 rootwait rw earlycon console=ttyO0,115200n8,10
Retrieving file: /extlinux/ā€¦/am335x-boneblack.dtb
Retrieving file: /ā€¦/BB-I2C1-RTC-DS3231.dtbo
Retrieving file: /ā€¦/BB-UART1-00A0.dtbo
Retrieving file: /ā€¦/BB-UART2-00A0.dtbo
Kernel image @ 0x82000000 [ 0x000000 - 0xc01200 ]

this is my bblayers file
POKY_BBLAYERS_CONF_VERSION = ā€œ2ā€

BBPATH = ā€œ${TOPDIR}ā€
BBFILES ?= ā€œā€

BBLAYERS ?= "
/home/amf/data/yocto-kirkstone/poky/meta
/home/amf/data/yocto-kirkstone/poky/meta-poky
/home/amf/data/yocto-kirkstone/meta-openembedded/meta-oe \
/home/amf/data/yocto-kirkstone/meta-openembedded/meta-networking
/home/amf/data/yocto-kirkstone/meta-openembedded/meta-python
/home/amf/data/yocto-kirkstone/meta-ti/meta-ti-bsp
/home/amf/data/yocto-kirkstone/meta-ti/meta-ti-extras \
/home/amf/data/yocto-kirkstone/meta-arm/meta-arm
/home/amf/data/yocto-kirkstone/meta-arm/meta-arm-toolchain
"

my local.conf file only sets the machine and adds nano and pstree

For some reason my test image is not set up for overlays. I did put the path in extlinux and it does not load it. It seemed like that is what worked in the pastā€¦ Now I cannot get the u-boot config to update after changing settings in make menuconfig.

Have you had any luck updating u-boot. My notes have devtool finish u-boot, it runs and completes but when running core-image-minimal again the changes are not recognized and nothing happens.

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1:	Yocto
Retrieving file: /zImage
append: root=PARTUUID=5c159b43-02 rootwait console=ttyS0,115200
Retrieving file: /am335x-boneblack.dtb
Retrieving file: /BB-UART1-00A0.dtbo
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
Failed to apply overlay /BB-UART1-00A0.dtbo, skipping
Kernel image @ 0x82000000 [ 0x000000 - 0x784fb8 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree

Did you build your .dtbo with this option?

make sure you've compiled with -@

the UART dtbo files are all build as part of the yocto build
no kernel menuconfig changes
as indicated in my last post nothing special in local.conf
will do machine=beaglebone-yocto this weekend and test.

why are you compiling the dtbo ?? it should be part of the yocto build
BTW, iā€™m using the wic image on an sdcard, my emmc has been dd with zero

Only one I have is the base am33xx. The load-cape is a custom and the others were copied from the device tree build. Maybe the machine is different, I will try the other one from Ti. It will be a few hours, cleaned out the sscache and it is busy fetching. Also doing a scarthgap build and will see what happens with that one.

1 Like

i keep forgetting all the SBCs i have, those RPI0 for 10 bucks were a bargain and ESPs for 3 to 5 bucks.

anyway, an alternative is to enable UART1 and 2 and cross jumper wires between then. then ssh in on two different terminals. cat one uart and echo to the other.

1 Like

I followed your steps and cloned a fresh meta-ti layer. I had many things in my local.conf file and i disabled some of them and build fresh image. Now the overlays are getting loaded. Also able to sent the data from UART1 and UART4. Thanks a lot @amf99 @foxsquirrel

2 Likes

@apm
good to hear, yocto can be a bear to conquer.

Cool!! Glad you are up and running.

If you donā€™t mind please share your local.conf, bblayers, and extlinux.conf.

For some reason unknown to me my overlays are not loading. I did clean out sscache and back on kirkstone. So hopefully that will fix it up.

local.conf (12.2 KB)
bblayers.conf (691 Bytes)
extlinux.conf (305 Bytes)

2 Likes

Thank you very much for sharing that information.

I was able to solve one issue with a clue from your information.

Found out that meta-poky-bsp had to be removed from the bblayers. Even though local.conf was calling for ā€œbeagleboneā€, meta-poky-bsp was overriding everything. Now with it removed the image is dropped into a conf-ti and has all the bb device trees installed with it.

I can load the bb provided overlay just fine, my custom will not load. It looks like they are compiling them at build time and I was doing a cp from known working.

Issue that just came up is it will not recognize the rootfs, so it goes into kernel panic.

3.803888] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA
[    3.823356] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA
[    3.831445] VFS: PARTUUID= is invalid.
[    3.831445] Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%d]
[    3.841113] Disabling rootwait; root= is invalid.
[    3.847215] /dev/root: Can't open blockdev
[    3.851577] VFS: Cannot open root device "PARTUUID=" or unknown-block(0,0): error -6
[    3.859537] Please append a correct "root=" boot option; here are the available partitions:
[    3.868102] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    3.876414] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.69-ti #1
[    3.882628] Hardware name: Generic AM33XX (Flattened Device Tree)
[    3.888763]  unwind_backtrace from show_stack+0x18/0x1c
[    3.894049]  show_stack from dump_stack_lvl+0x40/0x4c
[    3.899143]  dump_stack_lvl from panic+0x114/0x364
[    3.903968]  panic from mount_block_root+0x140/0x1dc
[    3.908976]  mount_block_root from prepare_namespace+0x158/0x194
[    3.915022]  prepare_namespace from kernel_init_freeable+0x26c/0x280
[    3.921418]  kernel_init_freeable from kernel_init+0x20/0x13c
[    3.927203]  kernel_init from ret_from_fork+0x14/0x28
[    3.932287] Exception stack(0xe0009fb0 to 0xe0009ff8)
[    3.937365] 9fa0:                                     00000000 00000000 00000000 00000000
[    3.945581] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    3.953796] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    3.960459] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---


1 Like

I had the same issue for loading overlay as @apm. When my overlays get loaded I was getting kernel panic. But while booting if kernel panic doesnā€™t occur, then my overlays were not getting loaded. I was getting the Invalid fdtoverlay_addr_r for loading overlays.

1 Like

Not sure why I even had the meta-poky-bsp layer in mine, but it was interacting with the meta-ti-bsp. Now, I can load the BB supplied overlays that are built as part of the build.

My custom will not work when copied over. Technically that should not happen, I am wasting too much time trying to track down the location to place my dts file so it can be compiled at build time.

Also, had to delete some mmc to get it to boot.

=> mmc dev 1
=> mmc erase 0 1000

or yocto-kirkstone/poky/meta-yocto-bsp
this one is the default when doing a new build, before modifying the bblayers.config

Pretty sure you are correct on that, started over with a few notes and fresh build directory.

I had to make room and went on a rm -r craze, next time my plan will be to put local configs and layers into a folder and rm the rest. That should work,

What are others doing with their yocto builds, after a few different platforms and build configurations my drives are loaded.

to keep drive usage down:
make sure each build dir points to same download dir
if i just want to keep the build, iā€™ll delete the tmp and shared states directories
donā€™t recall the correct name, but in local.conf adding ā€œremove-workā€ or something like that will delete the build directories after needed modules are added to the rootfs, if your trying to debug a module, you will loose your changes, so be careful
for hard drive space, i add another drive to the virtual machine, dedicated to yocto builds only. SSD is preferred for speed

I will look that one up.
Mine is setup for one ā€œmasterā€ download directory, the manual says its okay to dip from it. Do have a sscache setup for armhf, arch64 and x86 then repoint to the correct sscache and the main download directory.

Have you had any luck injecting a custom .dts ā†’ .dtbo overlay into the yocto build. Been chasing my tail on that oneā€¦

did it for BBB and BeagleV, just create a patch of the .dts file and add it to a .bbappend file.
this would have been on kirkstone and nanbield branch for BBB and xuantie for BeagleV
what branch of yocto are you working with ??

kirkstone, bbb.