Device Tree Overlay for BeagleBone-AI

738 views
Skip to first unread message

debian

unread,
Sep 11, 2020, 1:30:17 PM9/11/20
to BeagleBoard
Could i use overlay (Device Tree) in BeagleBone AI?
Could i know how to use overlay (DT) in BeagleBone AI?

First, I dont know to modify uEnv.txt ?
I don't know what to edit in uEnv.txt.

Can I know which part I need to fix?

Robert Nelson

unread,
Sep 11, 2020, 2:15:16 PM9/11/20
to Beagle Board

어지수

unread,
Sep 16, 2020, 12:11:09 PM9/16/20
to Robert Nelson, beagl...@googlegroups.com
What is the difference between kenel overlay (device tree) and u-boot overlay?
Are they the same thing?

I have succeeded with u-boot overlay.
How do I get the kernel overlay (dtb_overlay) to load successfully?

I add my uEnv.txt for loading kernel overlay(dtb_overlay).

2020년 9월 14일 (월) 오후 6:26, 어지수 <jis...@gmail.com>님이 작성:
I send uEnv.txt to you. 
I success but i have a question 

  Are uboot_overlay and dtb_overlay the same?


2020년 9월 14일 (월) 오후 6:16, 어지수 <jis...@gmail.com>님이 작성:
I have some questions.
Are dtb_overlay and uboot_overlay_addr4 the same thing?
Are uboot_overlay and dtb_overlay the same?

thank you for a lot help 
regards
jisu 

2020년 9월 12일 (토) 오전 3:15, Robert Nelson <robert...@gmail.com>님이 작성:
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/-7xASl-oqic/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYi9NwNJNOQbkZLCJk_-LApGN-VRTVPQuuzTtuTX10sNew%40mail.gmail.com.
uEnv.txt

Robert Nelson

unread,
Sep 16, 2020, 12:38:39 PM9/16/20
to 어지수, Beagle Board
On Wed, Sep 16, 2020 at 11:10 AM 어지수 <jis...@gmail.com> wrote:
>
> What is the difference between kenel overlay (device tree) and u-boot overlay?
> Are they the same thing?
>
> I have succeeded with u-boot overlay.
> How do I get the kernel overlay (dtb_overlay) to load successfully?
>
> I add my uEnv.txt for loading kernel overlay(dtb_overlay).

I'm sorry, v4.14.x-ti in your /boot/uEnv.txt is NOT compatible with
overlays for BBAI, this is brand new for the BBAI..

YOU much start with:

https://rcn-ee.net/rootfs/bb.org/testing/2020-09-07/buster-iot/am57xx-debian-10.5-iot-armhf-2020-09-07-4gb.img.xz

(v4.19.x-ti based kernel..)

Robert Nelson

unread,
Sep 16, 2020, 8:43:56 PM9/16/20
to Beagle Board, 어지수
On Wed, Sep 16, 2020 at 7:15 PM 어지수 <jis...@gmail.com> wrote:
>
> https://rcn-ee.net/rootfs/bb.org/testing/2020-09-07/buster-iot/am57xx-debian-10.5-iot-armhf-2020-09-07-4gb.img.xz
>
> (v4.19.x-ti based kernel..)
>
> Does the dbt_overlay (kernel overlay) work properly on this kernel(v4.19.x-ti based kernel)?
> I succeeded in u-boot overlay. However, dtb_overlay was not successful. (kernel overlay on 4.19-x version.
>
> I don't know the difference between kernel overlay and uoot overlay.
> Are these two the same thing?
>
> My uEnv.txt is the following list.
> ###Custom Cape
> dtb_overlay=/lib/firmware/BBORG_SERVO-00A2.dtbo -> kernel overlay ( i said it as kernel overlay)
>
> uboot_overlay_addr4=/lib/firmware/BBORG_SERVO-00A2.dtbo -> uboot overlay ( i mean it as uboot-overlay)
>
> #Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
>
> uname_r=4.19.94-ti-r50
> #uuid=
> #dtb=
>
> ###U-Boot Overlays###
> ###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
> ###Master Enable
> enable_uboot_overlays=1
> ###
> ###Overide capes with eeprom
> #uboot_overlay_addr0=<file0>.dtbo
> #uboot_overlay_addr1=<file1>.dtbo
> #uboot_overlay_addr2=<file2>.dtbo
> #uboot_overlay_addr3=<file3>.dtbo
> ###
> ###Additional custom capes
> uboot_overlay_addr4=/lib/firmware/BBORG_SERVO-00A2.dtbo

Use:

uboot_overlay_addr4=BBORG_SERVO-00A2.dtbo

Douglas Conover

unread,
Oct 7, 2020, 12:40:45 PM10/7/20
to BeagleBoard
Hi! Thanks for this update! I've been playing around in the device trees for a little while in the AI, basing myself on the  ``am5729-beagleboneai-roboticscape.dts`` and the v4.14 kernel iot image. I have a hardware application that requires me to use two ENC28J60 ethernet adapters and the SPI 2 pins (I need two chip selects and due to potential pin conflicts I need to use SPI2). After struggling with the v4.14 kernel/image, I decided to try upgrading to the 4.19 kernel/image provided in this discussion. I was wondering if this was possible by modifying some of the overlay files provided in:


Inspecting ``BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/bbai-bone-buses.dtsi``, I could only find the bone_spi_0 and bone_spi_1 groups. Does anyone have any pointers on enabling spi2?

Thanks,

Doug

Robert Nelson

unread,
Oct 7, 2020, 2:51:22 PM10/7/20
to Beagle Board
On Wed, Oct 7, 2020 at 11:40 AM Douglas Conover
<douglas...@vention.cc> wrote:
>
> Hi! Thanks for this update! I've been playing around in the device trees for a little while in the AI, basing myself on the ``am5729-beagleboneai-roboticscape.dts`` and the v4.14 kernel iot image. I have a hardware application that requires me to use two ENC28J60 ethernet adapters and the SPI 2 pins (I need two chip selects and due to potential pin conflicts I need to use SPI2). After struggling with the v4.14 kernel/image, I decided to try upgrading to the 4.19 kernel/image provided in this discussion. I was wondering if this was possible by modifying some of the overlay files provided in:
>
> https://github.com/beagleboard/BeagleBoard-DeviceTrees/tree/v4.19.x-ti-overlays/src/arm/overlays
>
> Inspecting ``BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/bbai-bone-buses.dtsi``, I could only find the bone_spi_0 and bone_spi_1 groups. Does anyone have any pointers on enabling spi2?

Here is the mapping:

https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v4.19.x-ti-overlays/src/arm/bbai-bone-buses.dtsi#L413-L420

Douglas Conover

unread,
Oct 8, 2020, 7:41:05 PM10/8/20
to BeagleBoard


Thanks for the reply Robert! Just a quick update, today I was able to configure some spi2 pins to interface with an ENC28J60-H development board (SPI to Ethernet) with the following dts file:

/dts-v1/;
/plugin/;

#include <dt-bindings/interrupt-controller/irq.h>
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
    overlays {
        BONE-SPI2_0 = __TIMESTAMP__;
    };
};

/*
 * Update the default pinmux of the pins.
 * See these files for the phandles (&P9_* & &P8_*)
 * BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/am335x-bone-common-univ.dtsi
 * BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/am572x-bone-common-univ.dtsi
 */
&ocp {
    P9_17_pinmux { pinctrl-0 = <&P9_17_spi_cs_pin>; }; /* CS0 */
    //P9_23_pinmux { pinctrl-0 = <&P9_23_spi_cs_pin>; }; /* CS1 */
    P9_21_pinmux { pinctrl-0 = <&P9_21_spi_pin>; }; /* MOSI */
    P9_18_pinmux { pinctrl-0 = <&P9_18_spi_pin>; };    /* MISO */
    P9_22_pinmux { pinctrl-0 = <&P9_22_spi_sclk_pin>; }; /* CLK */
    P8_07_pinmux {status = "disabled";}; /* gpios reserved for RESET and INTERRUPT pins */
    P8_09_pinmux {status = "disabled";};
    P8_08_pinmux {status = "disabled";};
    P8_10_pinmux {status = "disabled";};
};

/*
 * See these files for the phandles (&bone_*) and other bone bus nodes
 * BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/bbai-bone-buses.dtsi
 * BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/bbb-bone-buses.dtsi
 */
&bone_spi_0{
    status = "okay";
    #address-cells = <1>;
    #size-cells = <0>;
    
    channel@0 {
        reg = <0>;
        compatible = "microchip,enc28j60";
        pinctrl-names = "default";
        pinctrl-0 = <&P8_09_default_pin>, <&P8_07_gpio_pin> ;
        //reg = <0x0>;                            /* Use chip select 0 */
        interrupt-parent = <&gpio6>;            /* Interrupt on GPIO6[18] */
        interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
        symlink = "bone/spi/2.0";
        spi-max-frequency = <16000000>;
        //spi-cpha;
    };
};

I still need to make use of the CS1 pin mode on P9_23. However, I see in BeagleBoard-DeviceTrees/v4.19.x-ti-overlays/src/arm/am572x-bone-common-univ.dtsi,
there is no entry for P9_23_spi_cs_pin. I tried adding the following lines to the bone-common-univ.dtsi:

        P9_23_spi_cs_pin: pinmux_P9_23_spi_cs_pin { pinctrl-single,pins = <
        P9_23( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE3)>; };    /* spi2_cs1.spi2_cs1, mcasp1_axr1.off */

But even after a make clean, make all, the resulting dtbo will brick my device..

I was wondering if you had any pointers/ideas as to how I could make this work? Eventually, I would like to run both channels with different interrupt,chip select and rest pins as defined above.

Thanks again,

Doug

Deepak Khatri

unread,
Oct 26, 2020, 3:28:11 PM10/26/20
to BeagleBoard
If anybody else stuck with a similar issue please follow the proper installation steps provided on the official site for compatibility Layer project -> https://deepaklorkhatri.me/GSoC2020_BeagleBoard.org/

Some updates might not be available directly and you have to install them with these additional steps,
  1. git clone https://github.com/beagleboard/BeagleBoard-DeviceTrees.git
  2. cd BeagleBoard-DeviceTrees
  3. sudo make install

Michele Xiloyannis

unread,
Nov 4, 2020, 8:38:15 PM11/4/20
to BeagleBoard

Thanks for the great project, Deepak! Made my life a lot easier. 

One small issue: The compatibility layer works beautifully but I consistently (tried three times) loose the "ad hoc" WLAN network of the BBBAI upon rebooting after the bootloader update. Funny thing is I can still log in the BBAI through the usbc port and connect to a wifi network. Any idea what might be wrong or how I could restore it? I have tried through connman, with no success. 

Hardware: BBAI REV A1
Image: am57xx-eMMC-debian-10.3-iot-tidl-armhf-2020-04-06-6gb.img
Kernel: Linux beaglebone 4.19.94-ti-r55 #1buster SMP PREEMPT Tue Oct 27 21:48:45 UTC 2020 armv7l GNU/Linux

sudo /opt/scripts/tools/version.sh

git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
model:[BeagleBoard.org_BeagleBone_AI]
dogtag:[BeagleBoard.org Debian Buster IoT TIDL Image 2020-04-06]
UBOOT: Booted Device-Tree:[am5729-beagleboneai.dts]
UBOOT: Loaded Overlay:[BONE-I2C3]
UBOOT: Loaded Overlay:[BONE-SPI1_0]
UBOOT: Loaded Overlay:[BONE-SPI1_1]
UBOOT: Loaded Overlay:[BONE-UART5]
kernel:[4.19.94-ti-r55]
nodejs:[v10.21.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BONE-SPI1_0.dtbo]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/BONE-SPI1_1.dtbo]
uboot_overlay_options:[uboot_overlay_addr2=/lib/firmware/BONE-I2C3.dtbo]
uboot_overlay_options:[uboot_overlay_addr3=/lib/firmware/BONE-UART5.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20201021.1-0buster+20201021]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0buster+20200813]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyS0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet]  

Matthew Rich

unread,
Nov 20, 2020, 6:35:42 AM11/20/20
to BeagleBoard
What should be done after step 3.

I am trying to implement the 4d CAPE overlay. Does anyone have a shell uEnv.txt file a beginner can work off of?  On the Black, the necessary cape was auto loaded. That is not what I am getting with the compatibility layer installed and these github cloned.

Thanks

Douglas Conover

unread,
Nov 20, 2020, 3:50:25 PM11/20/20
to BeagleBoard
Hey m.xilo...,

I had the same issue as well, turns out it was a bug in the image. It has been addressed here:


Run an apt update, apt upgrade, reboot and it should come back! Thanks to Robert C Nelson for the quick response!

Regards,

Doug

Michele Xiloyannis

unread,
Nov 21, 2020, 12:59:55 PM11/21/20
to beagl...@googlegroups.com
Thanks a lot, Doug! And thank you Robert Nelson for addressing the issue.
Have a great weekend. 

All the best, 
Michele 

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/49099a96-8a1a-42a5-bbca-a9262bbfdde2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages