MIPI

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

MIPI

5,210 Views
sumosumo
Contributor I

hi

I connected my eCAM50IMX6 to Nitrogen6x board but I cant see its frames on the screen...

I get the following errors:

***************

mxc_v4l_open: Mxc Camera no sensor ipu0/csi0

mxc_v4l_open: Mxc Camera no sensor ipu0/csi1

mxc_v4l_open: Mxc Camera no sensor ipu1/csi1

DISP3 BG ():mxc_v4l_open: Mxc Camera no sensor ipu0/csi0

        /dev/video16

        /dev/video17

Failed to open /dev/video0: Resource temporarily unavailable

*****************

during the boot it also written that the ov5640 is not found

but I also get the following lines during boot:

mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 driver probed

mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x3130302a

MIPI CSI2 driver module loaded

MIPI DSI driver module loaded

can anyone please explain me what is the problem.. I mean I have the hardware plugged in and also the kernel loaded the driver so what else I need?

Regards

Labels (1)
0 Kudos
Reply
9 Replies

2,398 Views
kruglikov_dmt
Contributor III

I have same issue for my ov5645 camera and additional timings in ov5645_mipi.c doesn't help :smileysad:

0 Kudos
Reply

2,398 Views
sumosumo
Contributor I

hi Omar & Yuri

first thank you guys for the help!!

I will not be next to my board for few days but I promise to follow up your steps and update you...
BTW  Omar, I do using this kernel version and  I am quiet sure that my i2c is disabled. if this is indeed the case, how do I make i2c work?

Regards

0 Kudos
Reply

2,398 Views
sumosumo
Contributor I

root@nitrogen:~# dmesg | grep V4L2

mxc_v4l2_output v4l2_out.36: V4L2 device registered as video16

mxc_v4l2_output v4l2_out.36: V4L2 device registered as video17

root@nitrogen:~# dmesg | grep MIPI

mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 driver probed

mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x3130302a

MIPI CSI2 driver module loaded

MIPI DSI driver module loaded

root@nitrogen:~# dmesg | grep ov56

ov5640_read_reg:write reg error:reg=300a

camera ov5640 is not found

ov5640_mipi 1-003e: found pwm2, period=45

update_device_addr: ov5640_mipi ret=-110

ov5640_read_reg(mipi):reg=300a ret=-110

camera ov5640_mipi is not found

update_device_addr: ov5642 ret=-110

ov5642_read_reg:write reg error:reg=300a

camera ov5642 is not found

root@nitrogen:~#

root@nitrogen:~# dmesg | grep i2c

i2c i2c-0: IMX I2C adapter registered

i2c i2c-1: IMX I2C adapter registered

i2c i2c-2: IMX I2C adapter registered

ili210x_i2c 2-0041: No platform data!

ili210x_i2c 2-0041: i2c transfer failed

ili210x_i2c 2-0041: Failed to get firmware version, err: -5

ili210x_i2c: probe of 2-0041 failed with error -5

i2c /dev entries driver

i2c-core: driver [mag3110] using legacy suspend method

i2c-core: driver [mag3110] using legacy resume method

cant still fix & understand the problem....

Regards

0 Kudos
Reply

2,398 Views
santhanakumars
Contributor I

Hi sumo,

Are you solved this issue, please give the solution for me, I m also in same issue.

Regards,

SanthanaKumarS

0 Kudos
Reply

2,398 Views
sumosumo
Contributor I

DTS

&i2c2 {

    clock-frequency = <100000>;

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_i2c2_2>;

    status = "okay";

    hdmi: edid@50 {

        compatible = "fsl,imx6-hdmi-i2c";

        reg = <0x50>;

    };

    ov5642: ov5642@3d {

        compatible = "ovti,ov5642";

        reg = <0x3d>;

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_ipu1_2>;

        clocks = <&clks 200>;

        clock-names = "csi_mclk";

        DOVDD-supply = <&reg_1p8v>;

        AVDD-supply = <&reg_2p5v>;

        DVDD-supply = <&reg_1p8v>;

        pwn-gpios = <&gpio1 6 1>;

        rst-gpios = <&gpio1 8 0>;

        ipu_id = <0>;

        csi_id = <0>;

        mclk = <24000000>;

        mclk_source = <0>;

    };

    ov5640_mipi: ov5640_mipi@3e {

        compatible = "ovti,ov5640_mipi";

        reg = <0x3e>;

        clocks = <&clks 147>;

        clock-names = "csi_mclk";

        DOVDD-supply = <&reg_1p8v>;

        AVDD-supply = <&reg_2p5v>;

        DVDD-supply = <&reg_1p8v>;

        pwn-gpios = <&gpio6 9 1>;

        rst-gpios = <&gpio2 5 0>;

        ipu_id = <0>;

        csi_id = <1>;

        mclk = <22000000>;

        mclk_source = <0>;

        pwms = <&pwm3 0 45>;

    };

0 Kudos
Reply

2,398 Views
vsv
Contributor III

Hi,

There is a function called ov5640_read_reg in ov5640_mipi.c file.

Due to some timing issues, this function returns an error when it tries to read some registers in the camera. The problem that you are facing is similar to the one that we had and we changed the function to do the following (by replacing the existing loop):

retval = i2c_master_send(ov5640_data.i2c_client, au8RegBuf, 2);

    while (2 != retval) {

        // pr_err("%s:write reg error:reg=%x **********************************************\n", __func__, reg);

        // pr_err("Retrying...\n");

        msleep(200);

        retval = i2c_master_send(ov5640_data.i2c_client, au8RegBuf, 2);

        //return -1;

    }

    retval = i2c_master_recv(ov5640_data.i2c_client, &u8RdVal, 1);

    while (1 != retval) {

        // pr_err("%s:read reg error:reg=%x,val=%x **********************************************\n", __func__, reg, u8RdVal);

        // pr_err("Retrying...\n");

        msleep(200);

        retval = i2c_master_recv(ov5640_data.i2c_client, &u8RdVal, 1);

        //return -1;

    }

The main change as compared to the existing loop is the introduction of msleep and putting this read/write into a while loop till it is successful.

You may try the same change and see if it is useful for you to overcome the error.

Best Wishes

0 Kudos
Reply

2,397 Views
Yuri
NXP Employee
NXP Employee

The following may be helpful :

ov5642-mx6qsdp-stream.pdf

Re: Some Experience When Enable MIPI Camera

Debug steps for customer MIPI sensor.docx


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,398 Views
Selea
Senior Contributor I

if it says OV5640 not found, this is the first item to solve.

please check the coherence of the connector.

1) power supply: about that check if your ov5640 board has the core supply regulator or if you nedd to modify the driver to activate the internal one.

2) clk: check if your boad nedd an extetrnal oscillator (so check if the clk from pwm is routed to the correct pin )

3) I2C address, OV5640 has 2 possible I2C address, pelase check how you r board is configured and check if it is coherent with the DTS file.

Omar

0 Kudos
Reply

2,398 Views
Selea
Senior Contributor I

Hi,

which kernel are you using?

if you ar using the 3.10.17 please check the DTS,

can you please post the DTS where you enable an load video capture device and sensor.

and also the dmesg. about V4L2 capture device and sensor.

Thanks

Omar

0 Kudos
Reply