Requesting guidance for beaglebone black

Hi,

We have made a custom board from beagle bone black. We have a requirement to use I2C1 on E17 and E18 pins of MPU. However, we see that all pins are reference w.r.t port 8 or port 9 in dts files.

I am using kernel_version of “4.14.108-ti-r140”, Debian 10 Root File System. The MPU is am3358bzcz100

I also have following questions :

  1. The device tree files that is used by beagle bone black is taken from “ti-linux-kernel-dev/KERNEL/arch/arm/boot/dts”?
  2. How can i modify the device tree so that i2c1 is enabled and available on E17 and E18 pins of MPU?

@RobertCNelson : Please help

Regards,
Kiran B V

Using TI’s pinmux tool with the AM335x and ZCZ package we can configure E17/E18 as:

		pinctrl-single,pins = <
			AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3) /* (E17) uart0_rtsn.I2C1_SCL */
			AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3) /* (E18) uart0_ctsn.I2C1_SDA */
		>;

Clone repo:

git clone -b ti-linux-4.14.y https://github.com/RobertCNelson/ti-linux-kernel-dev.git
cd ./ti-linux-kernel-dev/
./build_kernel.sh

Hit ESC, ESC, and Ctrl-C after menuconfig loads, then patch this file, under the KERNEL directory

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 6e5b6ae03b59..ee4ba20d08a2 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -79,6 +79,13 @@
                >;
        };
 
+       i2c1_pins: pinmux_i2c1_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3) /* (E17) uart0_rtsn.I2C1_SCL */
+                       AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3) /* (E18) uart0_ctsn.I2C1_SDA */
+               >;
+       };
+
 //     i2c2_pins: pinmux_i2c2_pins {
 //             pinctrl-single,pins = <
 //                     AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLUP, MUX_MODE3)      /* uart1_ctsn.i2c2_sda */
@@ -283,6 +290,14 @@
        };
 };
 
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+
+       status = "okay";
+       clock-frequency = <100000>;
+};
+
 &i2c2 {
        pinctrl-names = "default";
        //pinctrl-0 = <&i2c2_pins>;

Then finish the build:

./tools/rebuild.sh

Regards,

2 Likes

Thanks a lot for the specific inputs. I used the TI’s pinmux tool to verify this on P9 of beagle-bone black since E17 and E18 are not accessible. And it is working as expected.

@RobertCNelson : However, in my last kernel build a virtual COM port was showing up when i booted the BBB (USB used for powering the BBB). Is there some specific kernel module that i need to select for this feature? Actually we require a COM port through USB for testing purposes.

I think there is some problem. The older image used “4.14.108-ti-r127” and i could see “[ OK ] Found device /dev/ttyGS0.” message. But its timing out in “4.14.108-ti-r140”. Please check the screenshot below.

Hi @kiranbv i have not completely fixed the /dev/ttyGS0 issue… It’s a USB gadget driver we load at boot time, to provide a connection point between your pc and the board. systemd see’s it’s enabled, but is waiting for it to load…

loaded here:

Configured here:

There is a patch for systemd:

This isn’t fully ready yet…

Regards,

1 Like

Hi Robert,

I used the pins A16 and B16 to verify this in beaglebone black since one of the pins (E18) is left open. And it worked as expected. However, our custom boards have come and when i used the code with A16 and B16 code modification, the i2c signals are not coming. Also, i have tried to probe TP9 test point to see if any i2c1 signals are coming on beaglebone black. Unfortunately, i do not see anything. In contrast, i can see the i2c signals on D17 and D18 (i2c2 module) pins with a oscilloscope.

Regards,
Kiran B V

We make sure the i2c’s clocks are running in u-boot. Does your board share the BBB eeprom values or did you use something else?

Regards,

Hi @kiranbv , looks fine, can you talk i2c from u-boot?

Regards,

Hi @RobertCNelson ,

When i try to use it from u-boot, i get the error : " pads on bus probably not configured (status=0x10)". Please check below for details

image

Regards,
Kiran B V

Also, i found this information from this link : https://e2e.ti.com/support/processors-group/processors/f/processors-forum/449928/i2c1-controller-pin-mux-issue-on-beagleboneblack-am335x

I think this could be the cause since i2c1 was working on the other pin. Please guide me to resolve this

I can confirm the default version of u-boot we use on teh BBB show’s that same info…

Press SPACE to abort autoboot in 0 seconds
=> i2c dev 2
Setting bus to 2
=> i2c md.0 0x68 1
i2c_read: error waiting for addr ACK (status=0x116)
Error reading the chip: 1
=> i2c dev 1
Setting bus to 1
=> i2c md.0 0x68 1
i2c_read (addr phase): pads on bus probably not configured (status=0x10)
Error reading the chip: 2
=> i2c dev 0      
Setting bus to 0
=> i2c md.0 0x68 1
i2c_read: error waiting for addr ACK (status=0x116)
Error reading the chip: 1
=> version
U-Boot 2019.04-00004-g72e2ec7 (Jun 23 2021 - 14:54:50 -0500)
=> i2c bus
Bus 0:	omap24_0
Bus 1:	omap24_1
Bus 2:	omap24_2
=> i2c probe
Valid chip addresses: 24 34 50
=> i2c dev 1
Setting bus to 1
=> i2c probe
Valid chip addresses:i2c_probe: pads on bus probably not configured (status=0x10)
i2c_probe: pads on bus probably not configured (status=0x10)
i2c_probe: pads on bus probably not configured (status=0x10)

So, you’ll need to actually configure the bus…

Regards,

Hi @RobertCNelson,

I think the i2c1 module is configured since its usable on A16 and B16 pins. Also, i confirm that i2c1 module still works with A16 and B16 even E17 and E18 is used. I think this is similar to the problem reported here : https://e2e.ti.com/support/processors-group/processors/f/processors-forum/449928/i2c1-controller-pin-mux-issue-on-beagleboneblack-am335x

I think if we configure pinmux for i2c1 in u-boot, the conflict will get resolved. I am trying to find where this config is done, but not successful so far. Please help

Regards,
Kiran B V

It is done in the board.c/.h and mux.c file’s:

board.h:

Then the mux:

Regards,

Hi,

I made the changes

  1. In board.h

image

  1. In board.c

image

  1. In mux.c : Checking on P9.17 (SPI0_CS0) and P9.18 (SPI0_D1)

image

image

But having the same error
image

Regards,
Kiran B V

Hi,

I found some fix. Posting here so that its useful for others. I am not sure if its the right way of doing it. Please suggest improvements.

Following changes in am335x-bone-common-univ.dtsi fixed the issue. Also, “sudo config-pin p9.17 i2cMod” and “config-pin p9.18 i2cMod” must be given before using the pins as i2c1.

Regards,
Kiran B V