How can I enable the 5 UARTs of the beaglebone AI-64?

How can I enable 5 UART ports, I tried adding the line “fdtoverlays /overlays/BONE-UART1.dtbo” in extlinux.conf but what it does is block the card and I have to load the firmware again.

You would have to make your own device tree, I am not aware of 5 port tree. Believe the one you selected is only for 1 uart port. More than likely you will have to disable some other features to get that many, if it is even possible to have 5. @benedict.hewson any suggestions?


In the Beaglebone document it tells me that it can be done and to create the tree I need to “pinctrl register” the card, I don’t know where I can see that data.

Looks like if you add bone-uart4,5,6,7 to your start up file you should be working.

Ok as far as I can see, you can get 5 UARTS on top of the debug UART, Assuming there are no clashes.

These are the AI64 uarts and the header pins they are on. There are a few different options for some of these.

uart6 P9.14 (rx) P9.16 (tx)
uart2 P9.24 (tx) P9.26 (rx)
uart4 P9.37 (rx) P9.38 (tx)
uart8 P8.28 (rx) P8.29 (tx)
uart5 P8.38 (rx) P8.37 (tx)

Not sure why in the above table for the AI64 MAIN_UART0 and MAIN_UART2 are listed twice.

Some of the above uarts are on header pins connected to 2 MCU pins. These are usually labelled as ‘a’ and ‘b’ in the devicetree. You must make the alternate option for these pins as a GPIO input or you with get a clash and the function probably won’t work correctly.

1 Like

Ok had trouble getting UART5 RX working, so ended up using an alternative pin.

So the below dts file enables 5 uarts and sets up the symlinks

/dev/bone/uart/2
/dev/bone/uart/4
/dev/bone/uart/5
/dev/bone/uart/6
/dev/bone/uart/8

I have tested this on my AI64, with only this overlay loaded and they are all working.

dts file

/dts-v1/;
/plugin/;

#include <dt-bindings/pinctrl/k3.h>
#include <dt-bindings/board/k3-j721e-bone-pins.h>

&{/chosen} {
	overlays {
		BONE-UART_X5 = __TIMESTAMP__;
	};
};

&main_pmx0 {

	uartx5_2_pins_default:uartx5_2-pins-default {
		pinctrl-single,pins = <
		P9_24A(PIN_OUTPUT, 3) /* UART2 TX */
		P9_26A(PIN_INPUT, 3)  /* UART2 RX */
		P9_24B(PIN_INPUT, 7)
		P9_26B(PIN_INPUT, 7)
		>;
	};
	uartx5_4_pins_default:uartx5_4-pins-default {
		pinctrl-single,pins = <
		P9_37B(PIN_INPUT, 8)   /* UART4 RX */
		P9_38B(PIN_OUTPUT, 8)  /* UART4 TX */
		P9_37A(PIN_INPUT, 7)
		P9_38A(PIN_INPUT, 7)
		>;
	};
	uartx5_5_pins_default:uartx5_5-pins-default {
		pinctrl-single,pins = <
		P8_31B(PIN_INPUT, 14)  /* UART5 RX */
		P8_37A(PIN_OUTPUT, 3) /* UART5 TX */
		P8_31A(PIN_INPUT, 7)
		P8_37B(PIN_INPUT, 7)
		>;
	};
	uartx5_6_pins_default:uartx5_6-pins-default {
		pinctrl-single,pins = <
		P9_16(PIN_OUTPUT, 3)  /* UART6 TX */
		P9_14(PIN_INPUT, 3)   /* UART6 RX */
		>;
	};
	uartx5_8_pins_default:uartx5_8-pins-default {
		pinctrl-single,pins = <
		P8_29(PIN_OUTPUT, 14)  /* UART8 TX */
		P8_28(PIN_INPUT, 14)   /* UART8 RX */
		>;
	};

};

&main_uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&uartx5_2_pins_default>;
	symlink = "bone/uart/2";
	status = "okay";
};

&main_uart4 {
	pinctrl-names = "default";
	pinctrl-0 = <&uartx5_4_pins_default>;
	symlink = "bone/uart/4";
	status = "okay";
};

&main_uart5 {
	pinctrl-names = "default";
	pinctrl-0 = <&uartx5_5_pins_default>;
	symlink = "bone/uart/5";
	status = "okay";
};

&main_uart6 {
	pinctrl-names = "default";
	pinctrl-0 = <&uartx5_6_pins_default>;
	symlink = "bone/uart/6";
	status = "okay";
};

&main_uart8 {
	pinctrl-names = "default";
	pinctrl-0 = <&uartx5_8_pins_default>;
	symlink = "bone/uart/8";
	status = "okay";
};


Copy this file to your AI64. The extact path will depend on your kernel version.
On mine it is

/opt/source/dtb-5.10-ti/src/arm64/overlays/

Then from /opt/source/dtb-5.10-ti/ - ( sudo only needed if not root)

make && sudo make install

Add the overlay to your extlinux.conf file

fdtoverlays /overlays/uartx5.dtbo

Reboot and you should be up and running

1 Like

I already did all the steps and it worked wonderfully, thank you very much for your help.

Q. How to check the port is open?
→ I saw somewhere the command below is just checking the symlinks.

tree /dev/bone

.
.
.
+It’ll be very thankful if you point out the process that we need to change the files for enabling uart.

  • k3-j721e-beagleboneai64-bone-buses.dtsi
BONE_PIN(P8_37, uart,      P8_37A(PIN_OUTPUT, 3) P8_37B(PIN_INPUT, 7))	/* uart5_txd */
BONE_PIN(P8_38, uart,      P8_38A(PIN_INPUT, 7) P8_38B(PIN_INPUT, 3))	/* uart5_rxd */
.
.
.
bone_uart_5: &main_uart5 {
	symlink = "bone/uart/5";
	status = "disabled";
	pinctrl-names = "default";
	pinctrl-0 = <
		&P8_37_uart_pin /* uart5_txd */
		&P8_38_uart_pin /* uart5_rxd */
	>;
};
  • BONE-UART1.dts
&bone_uart_5 {
	status = "okay";
};

Of course I did ‘make && sudo make install’ + reboot
and added “/overlays/BONE-UART1.dtbo” on extlinux.conf

For more information, I’m using the bbai64-debian-11.8-minimal-arm64-2023-10-07-4gb.img downloaded from BB’s website released a year ago and have run

sudo /opt/u-boot/bb-u-boot-beagleboneai64/install-emmc.sh
sudo /opt/u-boot/bb-u-boot-beagleboneai64/install-microsd.sh

to update uboot

@benedict.hewson thank you for the info it has been very helpful.

I got things mostly working, however unfortunately only the RX pins of each port work. I.e., each of AI64’s uart ports can receive data from a serial but they can’t send anything back. I’ve tried several different serial programs (minicom, agetty) as well as just catting data directly to the bone/uart/ device to no avail. I tested the RX pin of my serial device (a USB to FTDI converter) and it works. I’ve also connected a logic analyzer to each UART’s TX pin and it is just stuck in a high state at 3.3V. I double-checked in the pin mux setting (number from 0-14) in the bone-buses.dtsi file and against the datsheet here https://www.ti.com/lit/ds/symlink/tda4vm.pdf and this spreadsheet Beagle bone AI64 pin mux - Google Sheets with no luck. I must be configuring all the device tree stuff correctly because otherwise the ports wouldn’t load under /dev/bone/uart (sudo beagle-version | grep UART shows all my uarts loading correctly), so there must be some mux or flag not being set correctly. Any thoughts on why this is? (edited)

Let me download that image and give it a go. I would guess as you mentioned in your other post it is a pinmux issue.
Just to speed things up which UARTs are you using and which header pins ?

Ok download the image and loaded the uartx5 overlay and I have all 5 UARTs working ok. Fully tested.

Out of curiosity when using minicom did you make sure that hardware flow control is off. I think by default it is enabled. That will stop transmits from working.