DESK-MX6-L/Peripherals/MIPI

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2021/07/16

First DESK-MX6-L release

2022/03/03

DESK-MX6-L 3.0.0 release
2023/04/11 DESK -MX6-L4.0.0 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.142280] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 driver probed
[    0.142301] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 dphy version is 0x3130302a
[    0.142757] MIPI CSI2 driver module loaded
...
...

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

root@desk-mx6:~# dmesg | grep -i camera
[    4.844134] camera ov5640_mipi is found
root@desk-mx6:~# ls -la /dev/video1*
crw-rw---- 1 root video 81, 1 Apr  4 06:49 /dev/video1
crw-rw---- 1 root video 81, 2 Apr  4 06:49 /dev/video16
crw-rw---- 1 root video 81, 3 Apr  4 06:49 /dev/video17
crw-rw---- 1 root video 81, 4 Apr  4 06:49 /dev/video18

Usage with gstreamer[edit | edit source]

Video capture and display using OV5640 MIPI camera:

root@desk-mx6:~# gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! imxv4l2sink
...
...
====== IMXV4L2SRC: 4.7.2 build on Sep  1 2022 09:49:28. ======
====== IMXV4L2SINK: 4.7.2 build on Sep  1 2022 09:49:28. ======
Setting pipeline to PAUSED ...
display(/dev/fb0) resolution is (800x480).
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
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
Redistribute latency...
v4l2sink need allocate 3 buffers.
...
...

Additional information[edit | edit source]

More information about gstreamer on its web site.

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