This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C1 controller pin-mux issue on BeagleBoneBlack/ (AM335x)

Hi All,

We are planing to use AM335x in one of our projects.


I have the following observation or issue with I2C1 controller on BeagleBoneBlack.

Note: I have a slave device that is having pull-up resistor on the bus.


From the BeagleBoneBlack software user-manual I understand we can use Header-P9  for using the I2C1 controller and it can be used in the following two ways

I have did this modification in the file arch/arm/boot/dts/am335x-bone-common.dtsi

1) using P9-18 (B16) & P9-17 (A16) pins of Header, for this I have added the following pin-mux, and enabled the device as shown below

i2c1_pins: pinmux_i2c1_pins {
    pinctrl-single,pins = <
        0x158 0x72     /* P9-18 (B16) spi0_d1.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
        0x15c 0x72    /* P9-17 (A16) spi0_cs0.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
    >;
};

&i2c1 {
    status = "okay";
    clock-frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&i2c1_pins>;

    myslave: myslave@38 {
        compatible = "gvk,myslave";
        reg = <0x38>;
    };

};


With this I am able to access the slave device and I have verified it is working fine with i2cdetect -r 1

# i2cdetect -r 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- 14 -- -- -- -- -- -- 1b -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: 50 -- UU 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
70: -- -- -- -- -- -- -- --                         
#

2) using P9-24 (D16) & P9-26 (D15) pins of Header, for this I have added the following pin-mux,

i2c1_pins: pinmux_i2c1_pins {
    pinctrl-single,pins = <
        0x180 0x73     /* P9-24 (D16) uart1_rxd.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
        0x184 0x73    /* P9-26 (D15) uart1_txd.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
    >;
};

&i2c1 {
    status = "okay";
    clock-frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&i2c1_pins>;

    myslave: myslave@38 {
        compatible = "gvk,myslave";
        reg = <0x38>;
    };

};

With this I am failing to access my slave and i2cdectect is throwing the below output

# i2cdetect -r 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          [  298.922093] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [  299.931852] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [  300.941619] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [  301.951383] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [  302.961148] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [  303.970914] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- ^C[  304.980684] omap_i2c 4802a000.i2c: timeout waiting for bus ready

Please help me If I am missing any configurations.

I have observed the following behaviour

I have done configuration as scenario-2 explained above.

i2c1_pins: pinmux_i2c1_pins {
    pinctrl-single,pins = <
        0x180 0x73     /* P9-24 (D16) uart1_rxd.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
        0x184 0x73    /* P9-26 (D15) uart1_txd.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
    >;
};

With this mux configuration I should use P9header 24& 26 pins, which is failing to work, but with the same configuration
I am able to access the slave device from the P9 Header 17 & 18 pins, does this mean mux configurations are over-written?

Please give inputs/pointer for debugging this.

Need help at the earliest,


Thanks & Regards,

Vamshi G.

 

 

  • Hi,

    Which linux SDK is this?

    Have you verified that device pads D15 -> 0x184 and D16 -> 0x180 are not used by some other DTS node?

    Best Regards,
    Yordan
  • Hi Yordan,

    I am using the following kernel code base:

    git clone git://github.com/beagleboard/kernel.git
    cd kernel
    git checkout 3.8
    ./patch.sh
    cp configs/beaglebone kernel/arch/arm/configs/beaglebone_defconfig

    I am checking if the pin mux is getting override to the below configuration

    i2c1_pins: pinmux_i2c1_pins {
        pinctrl-single,pins = <
            0x158 0x72     /* P9-18 (B16) spi0_d1.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
            0x15c 0x72    /* P9-17 (A16) spi0_cs0.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
        >;
    };

    I will also check if 0x180, 0x184 are being used by any other mux.

    Thanks & Regards,

    Vamshi G.

  • Hi Yordan,

    I have figured out the issue, I did pin-mux to pad control register 0x158 & 0x15C to use I2C1 mode in u-boot, and later I was trying to configure the pin-mux for I2C1 in dtsi file to different pad register @ 0x180 & 0x184, which is a conflicting issue, hence I could not able to get the I2C1 functionality on new pins, It remained with the configurations I made in u-boot.

    Thanks & Regards,
    Vamshi G.
  • Hi,

    Thanks for sharing the details, this may be quite useful to others on the forum.

    Best Regards,
    Yordan