imx8mq-evk camer ov5640 on mipi1 probes, but doesnot work then after due to i2c read/write

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mq-evk camer ov5640 on mipi1 probes, but doesnot work then after due to i2c read/write

2,125 Views
rutvij_trivedi
Contributor II

Hi, I m working with bring up of mipi-csi1 camera ov5640 using 5.4.47-zeus build.

I am facing issue that camera gets detected and probes but then it does not work ,
from the debug i found that i2c read/write fails with -6 and i2cdump also not working .

I have other 3 slave connected with same i2c with different address but they are working fine through out life cycle , issue persist only with 0x3c camera
Below are my logs in dmesg sorted with 5640

 

root@imx8mqevk:~# dmesg | grep -i 5640
[    2.551577] ov5640_mipi 1-003c: 1-003c supply DOVDD not found, using dummy regulator
[    2.559406] ov5640_mipi 1-003c: 1-003c supply DVDD not found, using dummy regulator
[    2.567128] ov5640_mipi 1-003c: 1-003c supply AVDD not found, using dummy regulator
[    2.633596] ov5640_mipi 1-003c: ov5640_power_down
[    3.135533] ov5640_mipi 1-003c: ov5640 sysclk 2800
[    3.773934] mxc-mipi-csi2_yav 30b60000.mipi_csi: Registered sensor subdevice: ov5640_mipi 1-003c
[    3.787515] ov5640_mipi 1-003c: Camera is found

 

And below are while capturing jpg image with g-streamer

root@imx8mqevk:~# gst-launch-1.0 v4l2src  device=/dev/video1 num-buffers=1 ! jpegenc ! filesink location=/home/root/test.jpg                                            
Setting pipeline to PAUSED ...
Pipeline is live and does not nee[   32.755830] ov5640_mipi 1-003c: Read reg error: reg=3503
d PREROLL ...
Setting pipeline t[   32.763526] ov5640_mipi 1-003c: Write reg error: reg=3503, val=ff
o PLAYING ...
New clock: GstSyst[   32.772597] ov5640_mipi 1-003c: Write reg error: reg=4202, val=f
emClock
[   32.781665] ov5640_mipi 1-003c: Write reg error: reg=3008, val=42
[   32.788522] ov5640_mipi 1-003c: Write reg error: reg=3008, val=42
[   32.849232] ov5640_mipi 1-003c: s_stream: 1
[   32.854210] ov5640_mipi 1-003c: Write reg error: reg=4202, val=0

 

This same camera works in mipi0 connection and provides jpg image.

So,what could be missing here ?

Any leads will be appreciable.

Thanks

0 Kudos
10 Replies

2,096 Views
rutvij_trivedi
Contributor II

Hi,
Any update ?


Thanks

0 Kudos

2,121 Views
jimmychan
NXP TechSupport
NXP TechSupport

Please double check if you select the proper driver of OV5640.

Please check the Chapter 6.1.2 in i.MX Reference Manual.

https://www.nxp.com.cn/docs/en/reference-manual/IMX_REFERENCE_MANUAL.pdf

0 Kudos

2,109 Views
rutvij_trivedi
Contributor II

HI,

Thanks for the replay.

Below is my compatible string

compatible = "ovti,ov5640_mipi";

 which will endup probing "drivers/media/platform/mxc/capture/ov5640_mipi_v2.c" driver.

Also if the driver is wrong , then how come it works with csi0 ?
why in probe it detected camera by reading vendor id register csi1 but does stops working afterwards ?


Thanks

0 Kudos

2,073 Views
jimmychan
NXP TechSupport
NXP TechSupport

There are different version of OV5640 driver. So, I want to double check you have selected the right driver.

Seems you have selected the correct driver and it can be found when the driver probe.

Please check the gpio pins of reset and power up/down are setting correct.

0 Kudos

2,068 Views
rutvij_trivedi
Contributor II

Hi,
I have checked the reset and power down signals for both working and now working mipi_csi.(i.e csi0 and csi1)

In both the case, power down stays low after driver prob and reset stays high and power down stays low.
I have attached dts file , where one can refer even driver strength and slew rate values to identify proper current ratings. however it dose not seems problematic as csi0 also has the same configurations.

Any leads in troubleshooting will be appreciated.

Thanks

0 Kudos

2,058 Views
jimmychan
NXP TechSupport
NXP TechSupport

I found that you set both csi_id = 0. One should set to 1, the other is set to 0.

0 Kudos

2,042 Views
rutvij_trivedi
Contributor II

Hi,
After your reply i changed csi_id to 1 but unfortunately, getting same non working result.

 

Thanks

0 Kudos

2,031 Views
jimmychan
NXP TechSupport
NXP TechSupport

You use gpio3_13 as the reset. I cannot find the GPIO3_IO13 define in your dts file.

You may take the imx8mq-evk.dts for reference.

 

For your reference,

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mq-evk.d...

0 Kudos

2,003 Views
darsh_dev
Contributor V

@jimmychan,

After changing the clock source

 

-               clocks = <&clk IMX8MQ_CLK_CLKO2>;
+               clocks = <&clk IMX8MQ_CLK_CLKO1>;
                clock-names = "csi_mclk";
-               assigned-clocks = <&clk IMX8MQ_CLK_CLKO2>;
+               assigned-clocks = <&clk IMX8MQ_CLK_CLKO1>;

 

 

and pin configuration of pwn

 

        pinctrl_csi1_pwn: csi1_pwn_grp {
                fsl,pins = <
                        MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3               0x19
                        MX8MQ_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2      0x59
                >;
        };
        pinctrl_csi2_pwn: csi2_pwn_grp {
                fsl,pins = <
                        MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5               0x19
                        MX8MQ_IOMUXC_GPIO1_IO14_CCMSRCGPCMIX_CLKO1      0x59
                        MX8MQ_IOMUXC_NAND_DATA07_GPIO3_IO13             0x19
                >;
        };

 

 

Camera is working on CSI1 port now (Trial & test case, its working)

Can you please share the Clock source diagram of each interface? From where, we can identify the clock source details of each interfaces?

0 Kudos

1,978 Views
jimmychan
NXP TechSupport
NXP TechSupport

For the details of Clock, please read the Chapter 5 " Clocks and Power Management" in the Reference Manual.

0 Kudos