Overlays as with BeagleBone Black

498 views
Skip to first unread message

Bert Buchholz

unread,
Sep 26, 2019, 5:30:05 AM9/26/19
to BeagleBoard
On the BeagleBone Black, I used the overlays defined in /boot/uEnv.txt to enable CAN and some UARTs and to disable several things like HDMI etc. Now I received my BBAI a few days ago where the whole overlay setup has been removed from uEnv.txt.

I then went ahead and tried to use the config-pin tool but for any pin I tried (I even tried to set some to GPIO) it errored out (I can't look up the error right now but could tomorrow, if it matters).

My question: How do I enable peripherals like CAN and UART (with or without overlays, it doesn't matter to me)?

jks

unread,
Sep 26, 2019, 5:53:27 AM9/26/19
to BeagleBoard
On Thursday, 26 September 2019 21:30:05 UTC+12, Bert Buchholz wrote:
My question: How do I enable peripherals like CAN and UART (with or without overlays, it doesn't matter to me)?

I'm in the middle of trying this to get spidev/spi2 to work: https://www.elinux.org/EBC_Exercise_41_Pin_Muxing_for_the_AI

Bert Buchholz

unread,
Sep 26, 2019, 5:01:27 PM9/26/19
to BeagleBoard
On Thursday, 26 September 2019 11:53:27 UTC+2, jks wrote:
I'm in the middle of trying this to get spidev/spi2 to work: https://www.elinux.org/EBC_Exercise_41_Pin_Muxing_for_the_AI

Thanks, that looks like it might work. I am a bit surprised though, that after the relative ease of use of config-pin and overlays, we should now be back at having to compile DTBs ourselves. I assume (hope) this is just temporary and in the future, there will be simpler solutions again.

Robert Nelson

unread,
Sep 26, 2019, 5:04:49 PM9/26/19
to Beagle Board, bert.b....@gmail.com
Sadly, with the AM5, we can't do the pinmux from userspace.. (hardware
bugs)... Everything must be done early..

Regards,

--
Robert Nelson
https://rcn-ee.com/
Message has been deleted

fhou...@gmail.com

unread,
Oct 2, 2019, 7:22:44 AM10/2/19
to BeagleBoard
Hallo Robert,

i need to activate the /dev/i2c-2 on the beaglebone AI. When i got that right i have to add a node in the device tree in order to activate it.

Can you tell me what i have to add there?

Kind Regards

On Thursday, September 26, 2019 at 11:04:49 PM UTC+2, RobertCNelson wrote:

jks

unread,
Oct 2, 2019, 4:40:02 PM10/2/19
to BeagleBoard

i need to activate the /dev/i2c-2 on the beaglebone AI. When i got that right i have to add a node in the device tree in order to activate it.
Can you tell me what i have to add there?

Don't know if this will help you, but to get access to the eeprom on my cape I added:

&i2c4 {
 eeprom
: eeprom@54 {
 compatible
= "atmel,24c32";
 reg
= <0x54>;
 
};
};


to the .dts  After that /sys/bus/i2c/devices/3-0054/eeprom appeared and I could do e.g. "hexdump -C ...".

Be sure to set the iopads accordingly. I used this:

DRA7XX_CORE_IOPAD(0x3440, PIN_INPUT_PULLUP | MUX_MODE7)     // R6   P9.19a  i2c4_scl
DRA7XX_CORE_IOPAD
(0x357C, PULL_DIS | MUX_MODE15)            // F4   P9.19b
DRA7XX_CORE_IOPAD
(0x3444, PIN_INPUT_PULLUP | MUX_MODE7)     // T9   P9.20a  i2c4_sda
DRA7XX_CORE_IOPAD
(0x3578, PULL_DIS | MUX_MODE15)            // D2   P9.20b  


/opt/scripts/device/bone/show-pins.pl shows:


P9.19a                    16   R6 7 fast rx  up  i2c4_scl         kiwisdr (cape_pins_kiwi)

P9.20a                    17   T9 7 fast rx  up  i2c4_sda         kiwisdr (cape_pins_kiwi)

P9.20b                    94   D2 f fast         Driver off       kiwisdr (cape_pins_kiwi)

P9.19b                    95   F4 f fast         Driver off       kiwisdr (cape_pins_kiwi)


b.buc...@kitepower.nl

unread,
Feb 5, 2020, 10:03:26 AM2/5/20
to BeagleBoard
To reply to myself: After looking at it again and reading through other people's pages, I managed to get the CAN device working with this DTS (after cloning the `BeagleBoard-DeviceTrees` repo):

#include "am5729-beagleboneai.dts"

/ {
chosen {
base_dtb = "am5729-beagleboneai-kitepower.dts";
base_dtb_timestamp = __TIMESTAMP__;
};
};

// The second name (pinmux_dcan2_pins) seems not used
&dra7_pmx_core {
dcan2_pins: pinmux_dcan2_pins {
pinctrl-single,pins = <
/* P9_24: uart1_txd.d_can2_rx */
DRA7XX_CORE_IOPAD(0x368C, PIN_INPUT_PULLUP | MUX_MODE2)
/* P9_26: uart1_rxd.d_can2_tx */
DRA7XX_CORE_IOPAD(0x3688, PIN_OUTPUT_PULLUP | MUX_MODE2)
>;
};
};

// Initially defined in dra7 (which is included through multiple layers) as disabled
&dcan2 {
pinctrl-names = "default"; // Not sure what this is used for
pinctrl-0 = <&dcan2_pins>;
status = "okay";
};


This muxes the 2 pins with the CAN peripheral to CAN.

After compiling this into a DTB, putting it on the beagle and setting it up in the `uEnv.txt`, I only need to bring up the CAN device:

sudo ip link set can0 up type can bitrate ${bitrate}

and CAN works (I use a bit rate of 125000).

Thanks for the people who took time to document their efforts and I hope this helps others.

Stephan Böck

unread,
Mar 2, 2020, 10:07:12 AM3/2/20
to BeagleBoard


Am Mittwoch, 5. Februar 2020 16:03:26 UTC+1 schrieb b.bu...@kitepower.nl:
To reply to myself: After looking at it again and reading through other people's pages, I managed to get the CAN device working with this DTS (after cloning the `BeagleBoard-DeviceTrees` repo):

#include "am5729-beagleboneai.dts"

/ {
chosen {
base_dtb = "am5729-beagleboneai-kitepower.dts";
base_dtb_timestamp = __TIMESTAMP__;
};
};

// The second name (pinmux_dcan2_pins) seems not used
&dra7_pmx_core {
dcan2_pins: pinmux_dcan2_pins {
pinctrl-single,pins = <
/* P9_24: uart1_txd.d_can2_rx */
DRA7XX_CORE_IOPAD(0x368C, PIN_INPUT_PULLUP | MUX_MODE2)
/* P9_26: uart1_rxd.d_can2_tx */
DRA7XX_CORE_IOPAD(0x3688, PIN_OUTPUT_PULLUP | MUX_MODE2)
>;
};
};

// Initially defined in dra7 (which is included through multiple layers) as disabled
&dcan2 {
pinctrl-names = "default"; // Not sure what this is used for
pinctrl-0 = <&dcan2_pins>;
status = "okay";
};

Did you do any further changes on your BBAI to make this device tree run?

I just want to do a simple pinmux to give PRU1_0 some gpio's, but everytime I edit my uEnv.txt, the kernel does not load after reboot. So I was looking around and found this thread. 
I tried to copy your .dts, compiled it and copied it to /boot/dtbs/4.14xxxx. However, the kernel does not load. (Btw. I am using the 4.14.108-ti-xenomai-r127 kernel, didn't test with normal ti kernel yet)

Still no success.


The only other device tree that worked for me, is the am5729-beagleboneai-roboticscape.dtb
 Any any ideas on this?

Bert Buchholz

unread,
Mar 3, 2020, 5:35:42 PM3/3/20
to beagl...@googlegroups.com
On Mon, 2 Mar 2020 at 16:07, Stephan Böck <boeckh...@gmail.com> wrote:
> Did you do any further changes on your BBAI to make this device tree run?

Yes, this is the exact DTB I am using, everything else is stock (I
think I was using the Debian 9.10 IoT image).

> I just want to do a simple pinmux to give PRU1_0 some gpio's, but everytime I edit my uEnv.txt, the kernel does not load after reboot. So I was looking around and found this thread.
> I tried to copy your .dts, compiled it and copied it to /boot/dtbs/4.14xxxx. However, the kernel does not load. (Btw. I am using the 4.14.108-ti-xenomai-r127 kernel, didn't test with normal ti kernel yet)

I am using 4.19.x-ti, so this could certainly be an important difference.

Bert
Reply all
Reply to author
Forward
0 new messages