Issue with UART Disappearing When Using I2C on BeagleBone AI-64

Hello everyone,

I am encountering an issue with my BeagleBone AI-64 board. When I enable both UART and I2C simultaneously, my UART ports seem to disappear. I suspect this might be due to pin multiplexing conflicts or incorrect device tree configurations.


image

Pin No for I2C

  • P9_17 /* I2C2_SCL */
  • P9_18 /* I2C2_SDA */

Current Configuration

1. UART Device Tree Overlay (BONE-UART.dts)

/dts-v1/;
 /plugin/;

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

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

 &main_pmx0 {
     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_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";
 };

2. I2C Device Tree Overlay (BONE-I2C12.dts)

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2022 BeagleBoard.org - https://beagleboard.org/
 *
 * https://docs.beagleboard.io/latest/boards/capes/cape-interface-spec.html#i2c
 */
/dts-v1/;
/plugin/;
/*
 * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
 */
&{/chosen} {
	overlays {
		BONE-I2C12.kernel = __TIMESTAMP__;
	};
};

&bone_i2c_1 {
	status = "okay";
	imu@69{
		compatible="invensense,icm20948";
		reg=<0x69>;
		
		mag@0c{
			compatible="invensense,icm20948-mag";
			reg=<0x0c>;
		};
	};
};
	
&bone_i2c_2 {
	status = "okay";
	imu@68{
		compatible="invensense,iam20680hp";
		reg=<0x68>;
		

	};
};

3. Applying Overlays via extlinux.conf

fdtoverlays /overlays/BONE-UART.dtbo /overlays/BONE-I2C12.dtbo

Steps Taken to Troubleshoot

  • Checked for Pin Conflicts: Ensured that UART and I2C pins do not overlap.
  • Reviewed Device Tree Overlays: Verified that the device tree overlays are correctly applied.

Commands Used to Check for UART and I2C Devices:

ls /dev/ttyS*
i2cdetect -y -r 2

Question

Despite these steps, the UART ports are still missing when both overlays are applied. Could anyone provide guidance on what might be causing this issue or suggest further troubleshooting steps?

Thank you for your help!

I would check what I2C peripheral bone_i2c_2 is actually using.
P9.17 and P9.18 uses I2C6 and only potential conflicts with UART3 TX pin depending on how it is muxed.

I created a spreadsheet with all pin muxs for the AI-64 here pinmux spreadsheet


Thank you for the response.

I am not using UART3, and I have confirmed that P9_17 (I2C2_SCL) and P9_18 (I2C2_SDA) work well when tested independently. However, I am still experiencing issues when enabling both UART and I2C. Could you please advise on how to correctly configure the device tree to allocate I2C without conflicts?

Is that a typo ? or do you have your own overlay.

The default I2C2 overlay uses P9.19 (SCL) and P9.20 (SDA) (see spreadsheet in link), but either way should not conflict with the UART. If you have wired up your device to pins 17 and 18 it will not work.

Have you got a serial console cable attached ? Would be good to see what u-boot is loading.
Also are there any pinctrl errors in the kernel log.

Thank you for pointing that out.

It is not a typo. I created my own overlay to test two IMUs on a single I2C bus. However, I will only be using one IMU in the future. I will test again tomorrow using the standard overlay that utilizes P9_17 (SCL) and P9_18 (SDA) as recommended.

I appreciate your assistance.

Thank you!

image

OK!

1 Like