Difference between revisions of "DESK-MX9-L/Peripherals/MIPI"

From DAVE Developer's Wiki
Jump to: navigation, search
m (U0007 moved page DESK-MX9-L/Pheripherals/MIPI to DESK-MX9-L/Peripherals/MIPI without leaving a redirect)
Line 3: Line 3:
 
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
|-  
 
|-  
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |2024/01/30
+
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX9-L-5.0.0 release
+
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 +
|-
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |2024/01/30
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |DESK-MX9-L-5.0.0 release
 
|-
 
|-
 
|}
 
|}
 
<section end=History/>
 
<section end=History/>
 +
__FORCETOC__
 
<section begin=Body/>
 
<section begin=Body/>
  
Line 14: Line 18:
 
=== Device tree configuration ===
 
=== Device tree configuration ===
  
==== AURA SOM ====
+
Here below is an example of device tree configuration used on standard DAVE's kit for the AURA SOM:
 
 
Here below an example of device tree configuration used on standard DAVE's kit for the AURA SOM:
 
  
 
From <code>imx93-aura-cb2001.dts</code>:
 
From <code>imx93-aura-cb2001.dts</code>:
Line 121: Line 123:
 
====Linux messages at boot time====
 
====Linux messages at boot time====
  
MIPI CSI driver initialized and if a MIPI camera is inserted, it has been recognized and its video driver loaded:
+
MIPI CSI driver initialized and if a MIPI camera is inserted, it has been recognized and its video driver is loaded:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 135: Line 137:
 
</pre>
 
</pre>
  
Then check that the camera are correctly recognized.
+
Then, check if the camera is correctly recognized.
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 
root@desk-mx93:~# ls -la /dev/video0  
 
root@desk-mx93:~# ls -la /dev/video0  
Line 146: Line 148:
 
Video capture and display using [https://digilent.com/shop/pcam-5c-5-mp-fixed-focus-color-camera-module/ Pcam 5C OV5640] MIPI camera:
 
Video capture and display using [https://digilent.com/shop/pcam-5c-5-mp-fixed-focus-color-camera-module/ Pcam 5C OV5640] MIPI camera:
  
Note: the first use of camera not working, run the follow command, wait some second, terminate the gstreamer command with <code>Ctrl+C</code>, next command to use camera not have problem.
+
{{ImportantMessage|text=At every power-on cycle the first camera usage is not working. Run <code>gstreamer</code>, wait for some seconds then close it with <code>Ctrl+C</code> and restart the application again}}
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 176: Line 178:
 
More information about i.MX gstreamer plugin on the [https://github.com/Freescale/gstreamer-imx gstreamer-imx] web site
 
More information about i.MX gstreamer plugin on the [https://github.com/Freescale/gstreamer-imx gstreamer-imx] web site
  
----
+
<section end=Body/>
  
[[Category:AURA]] [[Category:SBCX AURA]]
+
[[Category:AURA]]

Revision as of 09:15, 1 February 2024

History
Issue Date Notes
2024/01/30 DESK-MX9-L-5.0.0 release



Peripheral MIPI[edit | edit source]

Device tree configuration[edit | edit source]

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

From imx93-aura-cb2001.dts:

...
/ {
...
	regulators {
...
		ov5640_reg_2v8: ov5640_reg_2v8 {
			compatible = "regulator-fixed";
			regulator-name = "ov5640_reg_2v8";
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			regulator-always-on;
		};

		ov5640_reg_1v8: ov5640_reg_1v8 {
			compatible = "regulator-fixed";
			regulator-name = "ov5640_reg_1v8";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
		};

		ov5640_reg_1v5: ov5640_reg_1v5 {
			compatible = "regulator-fixed";
			regulator-name = "ov5640_reg_1v5";
			regulator-min-microvolt = <1500000>;
			regulator-max-microvolt = <1500000>;
			regulator-always-on;
		};
...
	};
...
};
...
&lpi2c3 {
...
	ov5640_mipi: ov5640_mipi@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		clocks = <&clk IMX93_CLK_CCM_CKO3>;
		assigned-clocks = <&clk IMX93_CLK_CCM_CKO3>;
		assigned-clock-rates = <24000000>;
		clock-names = "xclk";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mipi_cam>;
		reset-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;

		csi_id = <0>;
		mclk = <24000000>;
		mclk_source = <0>;
		mipi_csi;

		DOVDD-supply = <&ov5640_reg_1v8>;
		AVDD-supply = <&ov5640_reg_2v8>;
		DVDD-supply = <&ov5640_reg_1v5>;
		status = "okay";

		port {
			ov5640_mipi1_ep: endpoint {
				remote-endpoint = <&mipi_csi_ep>;
				data-lanes = <2>;
				cfg-clk-range = <28>;
				hs-clk-range = <0x16>;
			};
		};
	};
...
};
...
&mipi_csi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port@0 {
		reg = <0>;
		mipi_csi_ep: endpoint {
			remote-endpoint = <&ov5640_mipi1_ep>;
			data-lanes = <2>;
			cfg-clk-range = <28>;
			hs-clk-range = <0x16>;
			bus-type = <4>;
		};
	};
};
...
&iomuxc {
...
	pinctrl_mipi_cam: mipi_cam {
		fsl,pins = <
			MX93_PAD_SAI1_TXFS__GPIO1_IO11			0x31e
		>;
	};
...
};

Accessing the peripheral in ORCA SOM[edit | edit source]

Linux messages at boot time[edit | edit source]

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

...
[    1.877299] i2c 2-003c: Fixed dependency cycle(s) with /soc@0/bus@42800000/camera/csi@4ae00000/port@0/endpoint
[    1.888225] ov5640 2-003c: ov5640_write_reg: error: reg=3008, val=82
[    2.064939] mxc-md 42800000.bus:camera: deferring csi device registration
[    2.072752] dwc-mipi-csi2-host 4ae00000.csi: lanes: 2, name: mxc-mipi-csi2.0
[    2.109933] mx8-img-md: Registered sensor subdevice: ov5640 2-003c (1)
[    2.123066] mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]
[    2.129497] mx8-img-md: created link [ov5640 2-003c] => [mxc-mipi-csi2.0]
...

Then, check if the camera is correctly recognized.

root@desk-mx93:~# ls -la /dev/video0 
crw-rw---- 1 root video 81, 0 Mar  3 11:31 /dev/video0
root@desk-mx93:~#

Usage with gstreamer[edit | edit source]

Video capture and display using Pcam 5C OV5640 MIPI camera:


200px-Emblem-important.svg.png

At every power-on cycle the first camera usage is not working. Run gstreamer, wait for some seconds then close it with Ctrl+C and restart the application again

root@desk-mx93:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! waylandsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 1864.940941] mxc-mipi-csi2.0: format: 0x2008
[ 1864.950148] bypass csc
[ 1864.952512] input fmt YUV4
[ 1864.955219] output fmt YUYV
[ 1865.066804] dwc-mipi-csi2-host 4ae00000.csi: enter enable=1
Redistribute latency...
handling interrupt.:99.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:06.73270[ 1871.190805] dwc-mipi-csi2-host 4ae00000.csi: enter enable=0
5712
Setting pipeline to NULL ...
Total showed frames (137), playing for (0:00:06.732670920), fps (20.349).
Freeing pipeline ...
root@desk-mx93:~#

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