0

I have compiled an image with buildroot. I want to work with I2C2 which is located in P9.19 and P9.20 ( SCL and SDA). I have connected the BBB I2C2 to a kw40z - NXP controller. I have added pull up to SDA and SCL, shared ground and connected both SCL and SDA to each other. I do see /dev/i2c-2

I2C2 does not work. I tried i2cdetect -r 2 and also a C program but I am getting timeout.

My questions are:

  1. Does I2C2 is enabled or should I add the I2C2 device tree overlay from here:

  2. If so, I compile the above dts fragment into dtbo ( using the dtc compiler) How do i tell buildroot in beagle bone to load that dtbo?

I read that buildroot and even Debian does not support cape manager. So it should be static.

Does any one managed to work with I2C2 without overlay? or is it a must? Thanks!

JRG
  • 4,037
  • 3
  • 23
  • 34
user1820451
  • 153
  • 2
  • 14

1 Answers1

0

Problem solved for i2c1 and i2c2 I added the two fragments into the bone-common.dtsi for both I2C1 and I2C2 ( this is I2C1 for example) under the pin mux

&am33xx_pinmux {   
i2c1_pins: pinmux_i2c1_pins {  
      pinctrl-single,pins = <     
         0x158 (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE2)   /*    i2c1_sda */   
         0x15c (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE2) /*i2c1_scl */>;  
   };  

And the node itself in am335x-boneblack.dts

&i2c1 {  
   status = "okay";   
   pinctrl-names = "default";   
   pinctrl-0 = <&i2c1_pins>;   
   /* this is the configuration part */   
   clock-frequency = <100000>;   
   #address-cells = <1>;  
   #size-cells = <0>;  
};

Also , no need for external pull-up when its is internally of course. The pins are 17 - scl and 18 sda

user1820451
  • 153
  • 2
  • 14