i.MX6Q MIPI CSI2: Capturing RAW12 generic data

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX6Q MIPI CSI2: Capturing RAW12 generic data

Jump to solution
7,379 Views
agust
Contributor II

Hi,

Has anyone succeeded to capture RAW12 data from some MIPI CSI-2 sensor on i.MX6Q/D ?

According to the reference manual this format is supported: "Figure 19-19. RAW-12 data reception"

explains how the data is input to the IPU 16-bit data bus. How are the IPU IDMAC CPMEM parameters

BPP, NPB and FPS supposed to be configured to read RAW12 data from the 16-bit data bus?

What is the resulting pixel format in system memory?

Thanks!

Tags (4)
0 Kudos
1 Solution
1,652 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For the corruption pattern, I think you can set your sensor to output test pattern, in this case you can check if the issue was caused by sensor capture or data capture in MIPI->CSI.

For clock mode, I think it depends on camera sensor, on Freescale SabreSD reference board with ov5640 mipi camera, gated clock mode was used.

View solution in original post

0 Kudos
8 Replies
1,652 Views
YixingKong
Senior Contributor IV

Agust

We have not got your response yet and will close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 Kudos
1,652 Views
YixingKong
Senior Contributor IV

Agust

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 Kudos
1,652 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For RAW12 format capture, the CSI need use generic mode to capture, so in system memory, the data format is same as "Data in receiver's buffer" of Figure 40-27.


In IDMAC CPMEM, it shold be generic mode setting, PFS must be 0x6 Generic data, BPP can be 8, 16, or 32, the only thing should be cared is that (BPP/8) * FW * FH should be same the RAW12 frame size. For NPB setting, it sepends on BPP settting, and needs be aligned with SMFC burst size setting.


To support generic 16 mode capture, the attached pacth was needed.

1,652 Views
agust
Contributor II

In my setup with a sensor delivering 352x288 images I tried with PFS=0x6 and BPP=16 and configured FW=264 and FH=288.

The stride parameter SL is set to 527 bytes (352 * 12 / 8 - 1). Additionally NPB=3 setting was needed to get a whole frame in an

image. Unfortunately it didn't work, I got images like below (after converting the V4L2 buffer data to a grey-scale bitmap) :

csi2-test-NON-GATED-NPB3.bmp

As you can see, the half of the columns is missing and many pixels are corrupted. I always tried in Non-Gated mode since the

reference manual states that with MIPI sensors the Non-Gated mode should be used.

Then I did some experiments and also configured Gated mode in the CSI2IPU_SW_RST register (CLK_SEL bit cleared).

In Gated mode and with BPP=16, NPB=15, FW=264 and FH=288 the image data looks a little better, but the vertical sync

doesn't work and I get two image halves in a single frame:

csi2-test-GATED-NPB15_sync_issue.bmp

After many experiments and configuring CSI0_SENS_FRM_WIDTH=351, CSI0_SENS_FRM_HEIGHT=575,

CSI0_ACT_FRM_WIDTH=351, CSI0_ACT_FRM_HEIGHT=575 I get a whole frame, but there are still some

corrupted lines in the resulting image:

csi2-test-GATED-NPB15.bmp

What could be the reason for this corruption pattern?

Must Non-Gated mode really be used when capturing from MIPI sensor (as stated in the manual)?

0 Kudos
1,652 Views
kennywang
Contributor III

Dear  Agust, 

Did you capture RAW12 data correctly? I use I.MX6Q, I can capture RAW10 data correctly, but I can't capture RAW12 data. Could you tell me how did you modify the bsp and what about the RAW12 layout in memory?

0 Kudos
1,653 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For the corruption pattern, I think you can set your sensor to output test pattern, in this case you can check if the issue was caused by sensor capture or data capture in MIPI->CSI.

For clock mode, I think it depends on camera sensor, on Freescale SabreSD reference board with ov5640 mipi camera, gated clock mode was used.

0 Kudos
1,652 Views
suncxun
Contributor I

Hi ,

We working on sabre ai board for capturing video from MIPI CSI2 port using adv7180 driver , it show only blue screen when run mxc_v4l2_tvin.out test.

I have device connected on Mipi connector.

How can i see video from my device using mxc_v4l2_tvin.out.

i using 3.10.17 kernel from freescale.

0 Kudos
1,652 Views
Wlodek_D_
Senior Contributor II

Dear agust,

Thank you for your post, however please consider moving it to the right community place for better visibility.

For details please see general advice https://community.freescale.com/docs/DOC-99909

Thank you for using Freescale Community.

Regards,

Wlodek_D.