IMX8MM mipi csi-2 serdes camera integration

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

IMX8MM mipi csi-2 serdes camera integration

Jump to solution
2,337 Views
jfontain88
Contributor II

HI,

let me explain the problems encountered

  • I wish to get image from my OV10650 camera on my IMX8MM processor through a ser/des interface from texas instrument (UB953/UB960 FPD Link III ser/des).
  • I successfully get image at the CSI-2 output of my deserializer: 4 CSI-2 lanes at 800MHz each

First of all, I am a bit confused on which drivers i need to use. I developped my own i2c driver for the sensor (based on ov5640_mipi_v2.c). For the moment, I use my own driver, mxc_mipi-csi and mx6s_capture drivers to set up communication between sensor and v4l2. But i see that other drivers exist such as mxc_mipi_csi2_yav or mxc_v4l2_capture...

I updated the dts files to add my devices and i added the remote point connections and mxc_mipi_csi successfully recognize my device when i look at "dmesg".

Then i try to get image with gstreamer but the pipeline get stucked on PLAYING mode and the /dev/video0 seems to send no frames... The oscilloscope shows me that csi2 is transmitted to the IMX8MM but it seems that nothing happen when i try to get those frames.

Here is my problem! I don't know where does the problem comes from. 4 lanes config? clk configuration of csi-2 d-phy? Have you any documentation about csi-2 camera porting/tutorial/exemple? I checked a lot of other topics before but nothing that helped me for this problem!

Thanks a lot!

0 Kudos
1 Solution
2,254 Views
jfontain88
Contributor II

If anyone have the same problem: here is the solution i found!

The problem was coming from the bandwidth I was using. I was trying to transfer camera flow 1824*940, 60fps on only 2 lanes at 400Mbps. I t was too much data at very low datarate. When I set datarate from 400Mbps to 1600Mbps, everything worked fine!

Hope this will help some of you

View solution in original post

0 Kudos
4 Replies
2,255 Views
jfontain88
Contributor II

If anyone have the same problem: here is the solution i found!

The problem was coming from the bandwidth I was using. I was trying to transfer camera flow 1824*940, 60fps on only 2 lanes at 400Mbps. I t was too much data at very low datarate. When I set datarate from 400Mbps to 1600Mbps, everything worked fine!

Hope this will help some of you

0 Kudos
2,272 Views
jfontain88
Contributor II

(Sorry for repost, something failed)

0 Kudos
2,314 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jean

 

for drivers one can look at sect.6.1.8 Source Code Structure, sect.6.5 Video for Linux 2 (V4L2)

i.MX Linux Reference Manual​

gstreamer examples in  https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8-GStreamer-User-Guide/ta-p/1098942

Also may be useful to check HSSETTLE parameter as described in

https://community.nxp.com/t5/i-MX-Processors/Explenation-for-HS-SETTLE-parameter-in-MIPI-CSI-D-PHY-r...

 

Best regards
igor

2,273 Views
jfontain88
Contributor II

Thanks a lot! I am a bit confused about some settings... The output is YUV uncompressed format, 1824x940 at 60fps. I can program the CSI-2 settings such as number of lanes working (1 to 4) and datarate on each lane (400Mbps to 1600Mbps).

Everything works fine for the moment: my own driver (based on ov5640-mipi-v2) recognize well the sensor, mxc-mipi-csi works well with mipi-csi imx8mm's interface and mx6s_capture with the csi-bridge (don't know if this one is needed but i activated it anyway:

 

[ .... ] mx6s-csi 32e20000.csi1_bridge: initialiasing
[ .... ] mxc_mipi-csi 32e30000.mipi_cs: mipi csi v4l2 device registered
[ .... ] CSI: Registered sensor subdevice: mxc_mipi-csi.0
[ .... ] mxc_mipi-csi 32e30000.mipi_cs: lanes: 2, hs-settle: 17, clk_settle: 0, wclk: 1, freq: 333000000
[ .... ] mxc_mipi-csi 32e30000.mipi_cs: Registered sensor subdevice: ov10650 1-0024
[ .... ] ov10650 1-0024: Camera is found

 

When i try to get frames with gstreamer (through v4l2), the debug interface of mxc-mipi-csi get me some errors (here on a test with 400Mbps, 2 lanes):

 

Command: gst-launch-1.0 v4l2src num-buffers=1 ! video/x-raw ! jpegenc ! filesink location=test.jpg
Output: Setting pipeline to PAUSED ...
Pipeline is live and noes not need PREROLL ...
Setting pipeline to PLAYING ...
[ .... ] ov10650 1-0024: set-stream: enabled <- stuck here and am forced to abort with ctrl+c
^C handling interrupt
[ .... ] mxc_mipi-csi.0: Frame End events: 0
[ .... ] mxc_mipi-csi.0: Frame Start events: 664
[ .... ] mxc_mipi-csi.0: Non-image data after odd frame events: 0
...
[ .... ] mxc_mipi-csi.0: FIFO Overflow Error events: 0
[ .... ] mxc_mipi-csi.0: Lost Frame End Error events: 664
[ .... ] mxc_mipi-csi.0: Lost Frame Start Error events: 0
Setting pipeline to NULL ...
Freeing pipeline ...

 

 

Q1: On the device tree there is so many things that I don't understand regarding clocks and i would appreciate some help about it How do I know which clock i need to set up? How can I calculate its value? Especially for mipi_clk, phy_clk, disp_axi and disp_apb ? I am attempted to set mipi_clk to the datarate of my lanes (= 400Mbps for exemple so putting 400MHz) ?

Q2: The "real" question would be: Regarding one configuration (number-of-lanes + Datarate of the lane), which settings do I need to update and where do I update it? For the number of lane it is ok for me but not for the datarate.

Q3: Do you have any solution for the Lost Frame Ends errors debugged my the mipi-csi driver?

0 Kudos