rhoki wrote: ↑2024-04-16 0:10
Hello, I wanted to use i2c4 pins on Pico Pro Max board. I connected the device and ran i2cdetect. It finished fast and only shown some reserved address at 0x30. Detect on i2c3 ran normally. After checking board configuration I discovered, that only i2c3 is enabled in rv1106g-luckfox-pico-pro-max.dts file.
Code: Select all
/**********I2C**********/
// &i2c1 {
// status = "okay";
// pinctrl-0 = <&i2c1m1_xfer>;
// clock-frequency = <100000>;
// };
&i2c3 {
status = "okay";
pinctrl-0 = <&i2c3m1_xfer>;
clock-frequency = <100000>;
};
After some more checking, I have found that in file rv1106-luckfox-pico-pro-max-ipc.dtsi in lines 120-188 i2c4 is configured to work with camera sensor.
Code: Select all
&i2c4 {
status = "okay";
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c4m2_xfer>;
sc3336: sc3336@30 {
compatible = "smartsens,sc3336";
status = "okay";
reg = <0x30>;
clocks = <&cru MCLK_REF_MIPI0>;
clock-names = "xvclk";
pwdn-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&mipi_refclk_out0>;
...
};
};
...
};
Can I configure i2c4 pins for my use without worry? Can I just copy the configuration from i2c3, or should I do some additional configuration?
Hello, if you need to configure the i2c4 pin, you'll have to add the relevant i2c4 configuration in the corresponding dts file.
Code: Select all
&i2c4 {
status = "okay";
pinctrl-0 = <&i2c4m0_xfer>;
clock-frequency = <100000>;
};
The specific settings for the i2c4 peripheral are located in rv1106.dtsi under the dts path. The content added in the dts file is equivalent to overriding the settings in the dtsi file. Based on your requirements, you can refer to rv1106.dtsi for more configurations.
Please note that only one i2c interface (i2c4_m0, i2c4_m1, i2c4_m2) can be enabled for a given set of configurations. Therefore, you'll need to comment out the relevant i2c4 configurations. By default, i2c4_m2 is used for the CSI camera. Since the CSI configuration includes protocol layer, physical layer, and ISP, many nodes are interconnected. If you only comment out the i2c4 node, it will cause the CSI configuration to lose nodes and fail to compile successfully. So, please note that the content you need to comment out includes (
csi2_dphy_hw csi2_dphy0 i2c4 mipi0_csi2 rkcif rkcif_mipi_lvds rkcif_mipi_lvds_sditf rkisp rkisp_vir0).
I hope this helps you.