iMx6, IMx132 MIPI camera ,mipi csi2 can not receive sensor clk! in linux

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

iMx6, IMx132 MIPI camera ,mipi csi2 can not receive sensor clk! in linux

5,424 Views
wsh1001
Contributor II

I use IMX6q as master cpu.

I have changed the driver ov5640_camera_mipi.c to adjust my camera IMx132, in linux 3.0.35.

The i2c write and read is ok, but after i send the i2c data to change the register of the Imx132 sensor and let it go,

the IMX6 can not receive the clk from sensor.

It tells me mipi csi2 can not receive sensor clk!

The register  MIPI_CSI_PHY_STATE is always 0x200!

MIPI_CSI_ERR1,MIPI_CSI_ERR2 is all 0x0.

I've change the lanes number to 1.

I've read the document Debug steps for customer MIPI sensor.

The sensor's input clk is 24Mhz, the differential clk  is 810Mhz.

I've looked through the mxc_mipi_csi2.c, the command

mipi_csi2_write(info, 0x00000014, CSI2_PHY_TST_CTRL1); is also fit my design in my point.

And also i patch linux 3.0.35 , when the hdmi clk is not used, i could have the mclk 24Mhz.

also i've tried the linux 3.10.17, which has patched the hdmi clk problem officially.

After i've tried the above, the problem is also unfixed. I don't know the reason.

Who can tell me what else should I try?

0 Kudos
Reply
10 Replies

2,775 Views
motting
Contributor I

I have a very similar problem.

My linux kernel is also 3.0.35 but the board I am using is SabreLite from Boundary Device.

I am adding another Sony IMX camera which also support MIPI.

Similar to Wang Wang, I received the error message MIPI_CSI_PHY_STATE = 0x200, MIPI_CSI_ERR1=0, MIPI_CSI_ERR2=0 and then mipi csi2 can not receive sensor clk!

I have verified that I2C communication is correct.

The hdmi clk issue is already fixed.

I followed the initialization sequence received from Sony.

However, I still get mipi csi2 can not receive sensor clk! error.

I checked the clock signals through oscilloscope and found that 24MHz mclk is present but there is no MIPI clk at all.

My camera is properly connected to my SabreLite and there did not seem to be any soldering issue.

Could you give me some advice?

Thanks,

Motti

0 Kudos
Reply

2,775 Views
igorpadykov
NXP Employee
NXP Employee

Hi wang

if there is no clock from camera, this means that it was not properly initialized,

suggest to contact camera vendor sony for full initialization sequence of this camera

http://www.sony.net/SonyInfo/SupportAll/

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

2,775 Views
wsh1001
Contributor II

Does it mean that i have configured the right IPU&CSI numbered channel??

0 Kudos
Reply

2,775 Views
igorpadykov
NXP Employee
NXP Employee

In SabreSD board, ov5642 is connected to CSI0 parallel port, ov5640_mipi is connected to MIPI CSI port.

In BSP default setting, ov5640_mipi is routed to IPU0, CSI1. According to the doc, the virtual channel in MX6x side is 1, so virtual channel 1 should be enabled in camera sensor side. In driver ov5640_mipi.c, the code is “ov5640_set_virtual_channel(ov5640_data.csi)”.

2,774 Views
wsh1001
Contributor II

The sensor side needn't set the virtual channel, but i don't know where to set the virtual channel and also the IPU0, CSI1,in the ARM side...

0 Kudos
Reply

2,774 Views
igorpadykov
NXP Employee
NXP Employee

The sensor side may need to set the virtual channel,

to be sure for that please read its datasheet.

0 Kudos
Reply

2,774 Views
wsh1001
Contributor II

By the way, the data is not the test pattern of sensor.

0 Kudos
Reply

2,774 Views
wsh1001
Contributor II

i fixed the setting of ipu&csi, by letting the GRP 1,bit 19 be 0.

and the setting about mipi camera and camera capture in the file"board-mx6q_sabresd.c"  , i also set the ipu.id =0, csi.id =0, virtual channel =0

the sensor side i also set the virtual channel 0.

now,when i run the mxc_v4l2_still.out, there's no error but the warning :

"imx-ipuv3 imx-ipuv3.0: IPU warning IPU_INT_STAT_10=0x00000001"

The data written into the file is wrong.  They alternated between a lot of 0x41 and a lot of 0x42.

I tried "cat /dev/video1", it printed a lot of A and a lot of B. just like AAAAAAA...AAAAAAABBBBB....BBBBBBBBAAAA...AAAABBBB...BBBBBB...

I don't why the data is still not right.

by the way, when using mxc_v4l2_capture.out, i also got the information:

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

0 Kudos
Reply

2,776 Views
wsh1001
Contributor II

Thanks a lot. But where is the code to set the virtual channel and also the IPU0, CSI1? I want to see if it is right.

0 Kudos
Reply

2,776 Views
wsh1001
Contributor II

Thank you very much. The result is that I fix the hardware (soldering) problem, after that the ERR1 is 0, ERR2 sometimes will alternate between 0 and 0x100. That means " Header error detected and corrected on Virtual Channel 0",

The status register is alternated between 0x300 and 0x310(my IMX132 is 1 lane ).

will that be a problem??Does it mean that i have configured the right IPU&CSI numbered channel??

Also the IMX132 's output type is RAW8 or RAW10. And use the demo test program in the unit_test folder( mxc_v4l2_overlay.out &mxc_v4l2_capture.out&mxc_v4l2_still.out ), the image can not display properly,

mxc_v4l2_capture.out:

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

mxc_v4l2_still.out :

ERROR: v4l2 capture: mxc_v4l_read timeout counter 0

imx-ipuv3 imx-ipuv3.0: Not a CSI channel

and how can I get the image directly?? i mean to read out as a file, even i don't need to display it , the only thing i want to get is the data.

0 Kudos
Reply