# Requesting guidance for beaglebone black

**URL:** <https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683>\
**Category:** Linux Discussions\
**Created:** [April 16, 2021, 12:17pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683 "2021-04-16T12:17:41Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [April 16, 2021, 12:17pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/1 "2021-04-16T12:17:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [April 16, 2021, 1:50pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/2 "2021-04-16T13:50:17Z")

</div>

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

```auto
		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:

```auto
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

```auto
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:

```auto
./tools/rebuild.sh

```

Regards,

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [April 21, 2021, 7:34am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/4 "2021-04-21T07:34:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [April 21, 2021, 11:08am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/5 "2021-04-21T11:08:23Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/digikey/original/3X/6/8/687ab3e0c41683e0bfbd6151d10befa2c9e731be.png)

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [April 21, 2021, 1:51pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/6 "2021-04-21T13:51:48Z")

</div>

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:

> <https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L508>

Configured here:

> <https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L799>

> <https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L406>

There is a patch for systemd:

> <https://github.com/rcn-ee/repos/blob/master/debian-10-systemd/suite/buster/debian/patches/0001-units-add-usb-gadget-target.patch>

This isn’t fully ready yet…

Regards,

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [June 21, 2021, 4:03am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/7 "2021-06-21T04:03:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 21, 2021, 8:31pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/8 "2021-06-21T20:31:20Z")

</div>

> [@kiranbv](#):
>
> Unfortunately, i do not see anything. In contrast, i can see the i2c signals on D17 and D18 (i2c2 module) pins with a oscilloscope.

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?

> <https://github.com/beagleboard/u-boot/commit/2f0af037fa8792c7dde567994e17bd168881ee8f#diff-575129e4829edd8793c6b71684598a88ca93c00ee832f0f099ab9ad84dbe9a5aR223>
>
> Signed-off-by: Robert Nelson \<robertcnelson@gmail.com\>

> <https://github.com/beagleboard/u-boot/commit/2f0af037fa8792c7dde567994e17bd168881ee8f#diff-50ad03fd332ada5d7bbeddcc0457629a0ca6c3022d357aa82a67ddfe7338ccbdR386>
>
> Signed-off-by: Robert Nelson \<robertcnelson@gmail.com\>

Regards,

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 22, 2021, 1:34pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/10 "2021-06-22T13:34:19Z")

</div>

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

Regards,

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [June 24, 2021, 6:46am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/11 "2021-06-24T06:46:37Z")

</div>

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](https://global.discourse-cdn.com/digikey/original/3X/a/e/aee7d33bf01c72c76d6510e6e88ea6e7718182fe.png)

Regards,  
Kiran B V

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [June 24, 2021, 7:56am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/12 "2021-06-24T07:56:52Z")

</div>

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](https://e2e.ti.com/support/processors-group/processors/f/processors-forum/449928/i2c1-controller-pin-mux-issue-on-beagleboneblack-am335x)

 ![image](https://global.discourse-cdn.com/digikey/original/3X/7/4/744a14c264f5b8dfaf312da16fa8ee1713f3fefd.png)

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

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 24, 2021, 3:54pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/13 "2021-06-24T15:54:21Z")

</div>

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

```auto
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)

```

```auto
=> 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,

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [June 25, 2021, 8:56am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/15 "2021-06-25T08:56:05Z")

</div>

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](https://e2e.ti.com/support/processors-group/processors/f/processors-forum/449928/i2c1-controller-pin-mux-issue-on-beagleboneblack-am335x)

 ![image](https://global.discourse-cdn.com/digikey/original/3X/7/4/744a14c264f5b8dfaf312da16fa8ee1713f3fefd.png)

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

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 25, 2021, 1:57pm UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/16 "2021-06-25T13:57:31Z")

</div>

> [@kiranbv](#):
>
> 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

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

> <https://github.com/beagleboard/u-boot/blob/v2019.04-bbb.io-am335x/board/ti/am335x/board.c#L71-L87>

board.h:

> <https://github.com/beagleboard/u-boot/blob/v2019.04-bbb.io-am335x/board/ti/am335x/board.h#L143-L144>

Then the mux:

> <https://github.com/beagleboard/u-boot/blob/v2019.04-bbb.io-am335x/board/ti/am335x/mux.c#L110-L132>

> <https://github.com/beagleboard/u-boot/blob/v2019.04-bbb.io-am335x/board/ti/am335x/mux.c#L313-L322>

> <https://github.com/beagleboard/u-boot/blob/v2019.04-bbb.io-am335x/board/ti/am335x/mux.c#L430>

Regards,

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [June 29, 2021, 9:05am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/17 "2021-06-29T09:05:43Z")

</div>

Hi,

I made the changes

1. In board.h

![image](https://global.discourse-cdn.com/digikey/original/3X/3/c/3c2f4d72f9ab321d517982ef74abe8dd8b8dec83.png)

1. In board.c

![image](https://global.discourse-cdn.com/digikey/original/3X/a/d/ad3ad439d89578b19e0f46b82406f54c4edce595.png)

1. In mux.c : Checking on P9.17 (SPI0\_CS0) and P9.18 (SPI0\_D1)

![image](https://global.discourse-cdn.com/digikey/original/3X/0/a/0a4e1b0f540f9dbe2a8b0de7bf2653158be1ebee.png)

![image](https://global.discourse-cdn.com/digikey/original/3X/2/5/250506ea3ff5b4ccace1410437ef562b8dc51f8b.png)

But having the same error  
 ![image](https://global.discourse-cdn.com/digikey/original/3X/c/c/cc15c405ca56479b3b74731f1f5a3615ed65ad61.png)

Regards,  
Kiran B V

---

<div class="post-metadata">

**Author:** ![kiranbv](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kiranbv](https://forum.digikey.com/u/kiranbv)\
**Post date:** [June 29, 2021, 9:08am UTC](https://forum.digikey.com/t/requesting-guidance-for-beaglebone-black/13683/18 "2021-06-29T09:08:54Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/digikey/original/3X/a/7/a71f57138e8adc1f2579192787a2db4f8ae32345.png)

Regards,  
Kiran B V
