Device tree overlay on BBAI-64

Hello,
I am trying to write a devicetree-overlay for BBAI-64. The Hardware is self designed and the issue burns down to getting a led to blink. As an Example I tried to write a overlay just for one of the abot 20 pins I need as a gpio (mode 7);

/dts-v1/;
/plugin/;

/ {
    compatible = "ti,am62x";

    fragment@0 {
        target = <&main_pinctrl>;
        __overlay__ {
            bbai64_gpio_pins: pinmux_bbai64_gpio_pins {
                pinctrl-single,pins = <
                    0x54 0x07  /* P8.03 GPIO0_20*/
                >;
            };
        };
    };

    fragment@1 {
        target = <&main_gpio0>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&bbai64_gpio_pins>;
            status = "okay";
        };
    };
};

then with dtc to .dtbo an the dtbo-file I moved to
/boot/firmware/overlays

After editing extlinux.conf with the “fdtoverlays”-line reboot and nothing happens.

when I try to modify the pin-state with gpioset 0 20 = 1, bb tells me there is a wrong mapping.

Is there a better way to make pins gpio again?
Thanks

If you check, most of the GPIO have an LED class in the devicetree. You just need an overlay to enable it. It will then appear in /sys/class/led

Check k3-j721e-beagleboneai64-bone-buses.dtsi

You need an overlay to do somting like this (change the label to something you would like) -

&bone_led_P8_40 {
	label = "P8_40";
	status = "okay";
};

what kernel version? uname -r ? what pin number? we’ve patched our device-tree so every ‘header’ pin is automatically a gpio input… so you can use libgpiod to change anything to be an led without ‘any’ overlays.

Regards,

1 Like

Kernel is 5.10.168-Ti-arm64-r118

Now I removed the „overlay-stuff“
With gpioset i can write, but without effect on board. (Voltage stays the same) and on some Pins there is even in sw no effect but no error. I tried various pin numbers, e.g. P8-03, as gpio1 20

The whole thing is for Smart Home, so on the hw there is some Logic to decode the pin State to some ssd relays for different thgings. To get it done, i Need to be able to toggle the gpio-Pins as for leds from cli/python. In the gpioinfo all of my used Pins are „unused - Input - active high“

What do i miss?

Thanks, regards

What commands are you using. Post a snippet of your pin toggle.

this is work i did with the BeagleY-AI with 6.1.x-ti, these change were not backported to the 5.10.x branch… i really recommend 6.6.x-ti for the bbai64 at this point.

Regards,

Thanks for advice.
After updating the Kernel to 6.6. everything works Fine, i am now able to use libgpiod with effect in the hw from cli.

Thank you

I am not seeing my header pins automatically set as gpio input with 6.12 dt.

Snip of what I am seeing with showpins.pl

P8.40                     71 AA24 @11c11c 08214007  nom       st      m7  gpio0_70
P8.27                     72 AA28 @11c120 08214007  nom       st      m7  gpio0_71
P8.28                     73  Y24 @11c124 08214007  nom       st      m7  gpio0_72
P8.29                     74 AA25 @11c128 08214007  nom       st      m7  gpio0_73
P8.30                     75 AG26 @11c12c 08214007  nom       st      m7  gpio0_74
P8.14                     76 AF27 @11c130 08214007  nom       st      m7  gpio0_75
P8.20                     77 AF26 @11c134 08214007  nom       st      m7  gpio0_76

Could you summarize what you’re doing to make things work?

Actually nothing but flashing the latest stable bookworm-Image with Kernel 6.6.
Unfortunately i fried the setup of openhab and the other components, but that was my own mistake.

With that Release and the correct number from header-documentation gpio-lib worked fine

No overlays or anything, your stuff just worked!? Was gpio-lib maybe controlling pin direction settings?

I am trying things the old way, muxed all the pins I want to use for GPIO with an overlay. I am going to be controlling the pins from a R5 core. With gpiod I should be able to control them from Linux. https://github.com/kevinacahalan/BeagleBoneAI64_Heterogeneous_App_Example/blob/8448369b7cdda9eab9a74b02fd2e58f94febb4c9/custom_overlays/our-custom-bbai64-overlay.dtso#L38

No overlay or anything. Just gpiod.
Of about 50 Pins i use only one does Not reply 3.3v on „Output 1“, because of Double use. But i just left this one.

1 Like