Configuring CSI to generate test pattern for i.MX6

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

Configuring CSI to generate test pattern for i.MX6

1,310 Views
isaacnickaein
Contributor III

Hi,

 

I am trying to setup CSI to generate test image (the checkboard pattern) and capture it using Gstreamer.

I am using Kernel 3.10.17 on i.MX6DL. The reference document I am using is Freescale's "i.MX 6 BSP Porting Guide"  section "7.1.3 Configuring the CSI Unit in Test Mode".

 

What I have done so far in kernel (mostly based on the reference document):

 

    1. Enabled CSI related modules in kernel menuconfig under Device Drivers > Multimedia > V4L2

    2. Modified ov5640.c driver to remove codes related to I2C and regulators

    3. Modified ov5640.c to set the sensor format from YUYV to RGB565 (ov5640_data.pix.pixelformat = V4L2_PIX_FMT_RGB565)

    4. Modified ipu_capture.c to setup CSI in CST_TEST mode. The diff is attached.

    5. Changed all IPU_PIX_FMT_UYVY to IPU_PIX_FMT_RGB565 in ipu_bg_overlay_sdc.c (didn't have any effect though)

    6. Changed "CSI IC MEM" to "CSI MEM" in struct mxc_capture_inputs inside mxc_v4l2_capture.c

 

After these modifications, I can capture the checkboard pattern using GStreamer:

 

gst-launch mfw_v4lsrc num-buffers=1 !  jpegenc ! filesink location=sample.jpg

 

The color format of captured images is not correct. I have attached some samples for different RGB value settings.

Is there anything I am missing in the settings that causes this issue?

 

 

RGB=(0,0,0)RGB=(255,0,0)RGB=(0,255,0)
RGB=(0,0,255)RGB=(255,255,255)
35563_35563.jpg0,0,0.jpg35750_35750.jpg255,0,0.jpg35751_35751.jpg0,255,0.jpg35752_35752.jpg0,0,255.jpg35753_35753.jpeg255,255,255.jpeg

Original Attachment has been moved to: ipu_capture.c.diff.zip

Labels (4)
0 Kudos
1 Reply

556 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Issac,

    For RGB565 data, you should capture it by GENERIC mode .

    please refter to this link !

https://community.freescale.com/docs/DOC-97981

Regards,

weidong

0 Kudos