Getting an 'err_id_vc0' error on iMX6 MIPI-CSI

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Getting an 'err_id_vc0' error on iMX6 MIPI-CSI

跳至解决方案
16,580 次查看
erezsteinberg
Contributor IV

Hello experts,

I'm working on a device driver for a Sony IMX208 MIPI Image Sensor for the iMX6 on Linux 3.0.35.

My MIPI is set up as follows:

mipi_csi2_info:

   mipi_csi2_info.mipi_en   = 1

   mipi_csi2_info.ipu_id    = 0

   mipi_csi2_info.csi_id    = 0

   mipi_csi2_info.v_channel = 0

   mipi_csi2_info.lanes     = 1

   mipi_csi2_info.datatype  = 0x2b  (RAW10)

I am able to communicate with the sensor over I2C and everything seems to be working. However, starting the stream and waiting for buffers (using select()), no buffers are available. I have 'DEBUG' enabled for the drivers; the log I get is:

In MVC:mxc_streamon

YUYV

In MVC:mxc_poll

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445611

   case VIDIOC_DQBUF

In MVC:mxc_v4l_dqueue

ERROR: v4l2 capture: mxc_v4l_dqueue() interrupt received

fps=In MVC:mxc_v4l_ioctl

If I check the CSI-MIPI Error registers, I see an err_id_vc0 in MIPI_CSI_ERR2 ("Unrecognized or unimplemented data type detected in Virtual Channel 0"). I tried both RAW8 and RAW10 formats, and I get the same error. According to MIPI-CSI2 Specs, this would be an "Unrecognized ID, caused by the presence of an unimplemented or unrecognized ID in the header", and the proposed receiver behavior "to indicate that the data packet is unidentified and cannot be unpacked by the receiver".  So, my guess is that the MIPI-CSI2 hardware detects an error and doesn't forward any data, and that's why dqbuf fails.

But -- I don't understand why this error is happening!

Does anyone know of possible reasons for such an error to occur?

Any recommendations how to debug this issue?

Regards,

Erez

标签 (3)
0 项奖励
回复
1 解答
14,191 次查看
erezsteinberg
Contributor IV

Just to close the issue ---  the problem was due to a non-standard data-type generated by the Sony Sensor.

The error message from the iMX6 CSI2 was correct.

After disabling the generation of the datatype by the sensor, the error is now gone.

Thanks to everyone for all the help.

在原帖中查看解决方案

0 项奖励
回复
29 回复数
3,071 次查看
Yuri
NXP Employee
NXP Employee

  Looks like in L3.0.101 the mentioned patch was not applied, at least, I do not see

any comments about it. Have You tried the patch ?

~Yuri.

0 项奖励
回复
3,071 次查看
erezsteinberg
Contributor IV

Yes, I did.

The error is still there.

I also tried changing the MCLK to the sensor from 24Mhz to 27Mhz.  No change.

0 项奖励
回复
3,071 次查看
erezsteinberg
Contributor IV

Hi Yuri,

Thank you for the additional information.

If I look at the code, it looks like the values are the same for 24MHz and 27MHz.

I used a 24MHz MCLK for the IMX208 coming from CCM_CLKO1 (osc_clk from CCM_CLKO2);

Register CCM_CCOSR(Address 0x20c4060) is set to 0x010E0181.

Using a scope, I can see a 24MHz clock going to the sensor.

I tried to change the MCLK to 27MHz by using 'video_27M_clk_root' for CCM_CLKO1

Register CCM_CCOSR(Address 0x20c4060) is set to 0x00000084.

But -- the clock I see is ~21MHz....  This means PLL3_PFD1 is ~420MHz instead of 540MHz ... can that be?

I also checked pll3_sw_clk, and it looks to be running correctly at 480 MHz.

Regards,

Erez

0 项奖励
回复
3,071 次查看
allencao
NXP Employee
NXP Employee

Hi,

Q1:

You are using 2-lane, right?

If so, the MIPI_CSI_PHY_STATE register should jump between 0x300 & 0x330 !

Q2:

You are right!

B.R.

Allen Cao

0 项奖励
回复
3,071 次查看
erezsteinberg
Contributor IV

No...  I'm using 1-lane ...

0 项奖励
回复
3,071 次查看
erezsteinberg
Contributor IV

To add...

I tried with a 2-lane configuration, and I get the same err_id_vc0

With 2-lanes, I see MIPI_CSI_PHY_STATE register jump between 0x300, 0x330, and 0x630

0 项奖励
回复
3,071 次查看
allencao
NXP Employee
NXP Employee

Please measure the MIPI clock frequency when using 2-lane configuration!

0 项奖励
回复
3,071 次查看
erezsteinberg
Contributor IV

That would require special equipment that I don't have.

I was thinking--- could I write a program that initializes only the IMX208 Sensor and MIPI-CSI2 block and tries a many combinations of clock settings.

I mean:

loop

{

   shutdown sensor

   shutdown mipi-csi2

   initialize mipi-cs2 and sensor for Configuration N

   read status registers (err1, err2, d-phy stat)

}

Could something like this help me find the correct clock configuration?

Regards,

Erez

0 项奖励
回复
3,071 次查看
Yuri
NXP Employee
NXP Employee

You may try to adapt and run the mipi test from the Platform SDK

imx6_platform_sdk_v1.1.0.tar\iMX6_Platform_SDK\sdk\drivers\mipi\

https://www.freescale.com/webapp/Download?colCode=i.MX6_PLATFORM_SDK&location=null&Parent_nodeId=&Pa...

~Yuri.

0 项奖励
回复