Difference between revisions of "DESK-MX6-L/Pheripherals/MIPI"

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "<section begin=History/> {| style="border-collapse:collapse; " !colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History |- !style="border-le...")
 
(Accessing the peripheral)
Line 57: Line 57:
  
 
<pre>
 
<pre>
}
+
 
 
</pre>
 
</pre>
  
 
====Linux messages at boot time====
 
====Linux messages at boot time====
 +
 +
MIPI CSI-2 driver initialized:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 67: Line 69:
 
[    0.261643] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 driver probed
 
[    0.261643] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 driver probed
 
[    0.261659] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x3130302a
 
[    0.261659] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x3130302a
 +
[    0.431259] MIPI CSI2 driver module loaded
 +
...
 +
...
 +
</pre>
 +
 +
and if a MIPI camera is inserted, it has been recognized and its video driver loaded:
 +
 +
<pre class="workstation-terminal">
 +
root@imx6qdlxelk:~# dmesg | grep -i camera
 +
[    3.373634] camera ov5640_mipi is found
 +
root@imx6qdlxelk:~# ls -la /dev/video1*
 +
crw-rw---- 1 root video 81, 3 Jun 22 00:33 /dev/video1
 +
crw-rw---- 1 root video 81, 0 Jun 22 00:33 /dev/video16
 +
crw-rw---- 1 root video 81, 1 Jun 22 00:33 /dev/video17
 +
root@imx6qdlxelk:~#
 +
</pre>
 +
 +
==== Usage with [https://gstreamer.freedesktop.org/ gstreamer] ====
 +
 +
Video capture and display using ov5640 MIPI camera:
 +
 +
<pre class="workstation-terminal">
 +
root@imx6qdlxelk:~# gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! imxv4l2sink
 +
 +
[  592.680143] ERROR: v4l2 capture: slave not found!
 +
====== IMXV4L2SRC: 4.4.5 build on Jun 22 2020 02:01:01. ======
 +
====== IMXV4L2SINK: 4.4.5 build on Jun 22 2020 02:01:01. ======
 +
Setting pipeline to PAUSED ...
 +
display(/dev/fb0) resolution is (800x480).
 +
Pipeline is live and does not need PREROLL ...
 +
Setting pipeline to PLAYING ...
 +
New clock: GstSystemClock
 +
/GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1
 +
/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1
 +
v4l2sink need allocate 3 buffers.
 
...
 
...
 
...
 
...
 
</pre>
 
</pre>
 +
 +
=== Additional information ===
 +
More information about ''gstreamer'' on https://gstreamer.freedesktop.org/ its] web site.
 +
 +
More information about i.MX gstreamer plugin on the [https://github.com/Freescale/gstreamer-imx gstreamer-imx] web site
  
 
=== Additional information ===
 
=== Additional information ===

Revision as of 13:04, 13 October 2020

History
Version Issue Date Notes
1.0.0 Oct 2020 First DESK release


Peripheral MIPI[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

&mipi_csi {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_mipi_csi_axel_sbc>;
    status = "okay";
    ipu_id = <0>;
    csi_id = <1>;
    v_channel = <0>;
    lanes = <2>;
};

From imx6qdl-axelcommon.dtsi:


&iomuxc {
...
...
        pinctrl_mipi_csi_axel_sbc: mipi_csigrp-2 {
            fsl,pins = <
                MX6QDL_PAD_SD3_DAT7__GPIO6_IO17 0x0b0b0 /* ov5640 mipi powerdown */
                MX6QDL_PAD_SD3_DAT6__GPIO6_IO18 0x000b0 /* ov5640 mipi reset */
                MX6QDL_PAD_CSI0_MCLK__CCM_CLKO1 0x000b0 /* ov5640 mclk */
            >;
        };
...
...
};

Accessing the peripheral[edit | edit source]


Linux messages at boot time[edit | edit source]

MIPI CSI-2 driver initialized:

...
...
[    0.261643] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 driver probed
[    0.261659] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x3130302a
[    0.431259] MIPI CSI2 driver module loaded
...
...

and if a MIPI camera is inserted, it has been recognized and its video driver loaded:

root@imx6qdlxelk:~# dmesg | grep -i camera
[    3.373634] camera ov5640_mipi is found
root@imx6qdlxelk:~# ls -la /dev/video1*
crw-rw---- 1 root video 81, 3 Jun 22 00:33 /dev/video1
crw-rw---- 1 root video 81, 0 Jun 22 00:33 /dev/video16
crw-rw---- 1 root video 81, 1 Jun 22 00:33 /dev/video17
root@imx6qdlxelk:~#

Usage with gstreamer[edit | edit source]

Video capture and display using ov5640 MIPI camera:

root@imx6qdlxelk:~# gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! imxv4l2sink

[  592.680143] ERROR: v4l2 capture: slave not found!
====== IMXV4L2SRC: 4.4.5 build on Jun 22 2020 02:01:01. ======
====== IMXV4L2SINK: 4.4.5 build on Jun 22 2020 02:01:01. ======
Setting pipeline to PAUSED ...
display(/dev/fb0) resolution is (800x480).
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1
v4l2sink need allocate 3 buffers.
...
...

Additional information[edit | edit source]

More information about gstreamer on https://gstreamer.freedesktop.org/ its] web site.

More information about i.MX gstreamer plugin on the gstreamer-imx web site

Additional information[edit | edit source]