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