Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Trying to read a second I2C bus gives "controller timed out"

$
0
0

Hi All,

I am using Beaglebone black board, I'm trying to add a device(i2c slave ) to my board on I2C-1.(currently I only have devices on I2C-0). When I run a check for devices on I2C-1 I get errors in u-boot

=> i2c dev 1
Setting bus to 1
=> i2c probe
Valid chip addresses:Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured
Timed out in wait_for_event: status=0000

And in kernel I am getting below messages:

2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          [ 1188.831062] omap_i2c 4802a000.i2c: controller timed out
-- [ 1189.831029] omap_i2c 4802a000.i2c: controller timed out
-- [ 1190.851032] omap_i2c 4802a000.i2c: controller timed out
...
...
70: [ 1299.991028] omap_i2c 4802a000.i2c: controller timed out
-- [ 1301.011026] omap_i2c 4802a000.i2c: controller timed out
-- [ 1302.031024] omap_i2c 4802a000.i2c: controller timed out
-- [ 1303.051030] omap_i2c 4802a000.i2c: controller timed out
-- [ 1304.071025] omap_i2c 4802a000.i2c: controller timed out
-- [ 1305.091028] omap_i2c 4802a000.i2c: controller timed out
-- [ 1306.111024] omap_i2c 4802a000.i2c: controller timed out
-- [ 1307.131027] omap_i2c 4802a000.i2c: controller timed out

I did below changes in .dts and .dtsi files to enable i2c1:

In am335x-bone-common.dtsi file :

        i2c1_pins: pinmux_i2c1_pins {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2)       /* spi0_d1.i2c1_sda */
                        AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2)       /* spi0_cs0.i2c1_scl */
                >;
        };

&i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins>;

        status = "okay";
        clock-frequency = <100000>;
};


and in am335x-boneblack.dts file

&i2c1 {
        nunchuk: nunchuck@52 {

                compatible = "nunchuk";
                reg = <0x52>;
        };
};


And in u-boot i have did below changes.

board/ti/am335x/board.c file

void do_board_detect(void)
{
       


        enable_i2c1_pin_mux();
        i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED1, CONFIG_SYS_OMAP24_I2C_SLAVE1);

}
#endif

include/configs/ti_armv7_omap.h file

#define CONFIG_SYS_OMAP24_I2C_SPEED1    100000
#define CONFIG_SYS_OMAP24_I2C_SLAVE1    1

I guess I'm missing something when it comes to enabling a second I2C bus.please help me to solve this issue

Thanks

Madhu


Viewing all articles
Browse latest Browse all 17527

Trending Articles