How to Enable the CSI1 & CSI2 mipi camera for the IMX8MP

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

How to Enable the CSI1 & CSI2 mipi camera for the IMX8MP

Jump to solution
2,076 Views
Mawriyo
Contributor I

I can't find documentation on enabling the cameras while using the imx-image-desktop. It does not appear in lsusb nor does ls /dev seem to display any of these modules. I looked in my device tree and there's no mention. How do I book from another dtb? Where is the bootscript? System complains that boot script not found. 

0 Kudos
1 Solution
2,067 Views
khang_letruong
Senior Contributor III

Hi @Mawriyo ,

By default, the imx8mp-evk.dts supports single ov5640 camera via CSI0 interface:

- ov5640 sensor node :

	ov5640_0: ov5640_mipi@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>;
		clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
		clock-names = "xclk";
		assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
		assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
		assigned-clock-rates = <24000000>;
		csi_id = <0>;
		powerdown-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
		mclk = <24000000>;
		mclk_source = <0>;
		mipi_csi;
		status = "okay";

		port {
			ov5640_mipi_0_ep: endpoint {
				remote-endpoint = <&mipi_csi0_ep>;
				data-lanes = <1 2>;
				clock-lanes = <0>;
			};
		};
	};

- mipi-csi2 node :

&mipi_csi_0 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port@0 {
		reg = <0>;
		mipi_csi0_ep: endpoint {
			remote-endpoint = <&ov5640_mipi_0_ep>;
			data-lanes = <2>;
			csis-hs-settle = <13>;
			csis-clk-settle = <2>;
			csis-wclk;
		};
	};
};

 

You should have the ov5640 camera module(s) connected to the MIPI-CSI2 connectors of the board (EVK for example) so that the driver can communicate with and identify it before registering into the system as /dev/video0.

If you expect to use dual ov5640 sensors (via both mipi-csi2 interfaces), work-around might be necessary on power-down and reset signals of second one : https://community.nxp.com/t5/i-MX-Processors/Dual-OV5640-cameras-on-iMX8M-Plus/m-p/1250820

There's also other examples of using dual camera sensors such as imx8mp-evk-dual-ov2775.dts or imx8mp-evk-dual-basler.dts. Please have a look.

Regards,
K.

View solution in original post

0 Kudos
3 Replies
2,068 Views
khang_letruong
Senior Contributor III

Hi @Mawriyo ,

By default, the imx8mp-evk.dts supports single ov5640 camera via CSI0 interface:

- ov5640 sensor node :

	ov5640_0: ov5640_mipi@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>;
		clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
		clock-names = "xclk";
		assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
		assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
		assigned-clock-rates = <24000000>;
		csi_id = <0>;
		powerdown-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
		mclk = <24000000>;
		mclk_source = <0>;
		mipi_csi;
		status = "okay";

		port {
			ov5640_mipi_0_ep: endpoint {
				remote-endpoint = <&mipi_csi0_ep>;
				data-lanes = <1 2>;
				clock-lanes = <0>;
			};
		};
	};

- mipi-csi2 node :

&mipi_csi_0 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port@0 {
		reg = <0>;
		mipi_csi0_ep: endpoint {
			remote-endpoint = <&ov5640_mipi_0_ep>;
			data-lanes = <2>;
			csis-hs-settle = <13>;
			csis-clk-settle = <2>;
			csis-wclk;
		};
	};
};

 

You should have the ov5640 camera module(s) connected to the MIPI-CSI2 connectors of the board (EVK for example) so that the driver can communicate with and identify it before registering into the system as /dev/video0.

If you expect to use dual ov5640 sensors (via both mipi-csi2 interfaces), work-around might be necessary on power-down and reset signals of second one : https://community.nxp.com/t5/i-MX-Processors/Dual-OV5640-cameras-on-iMX8M-Plus/m-p/1250820

There's also other examples of using dual camera sensors such as imx8mp-evk-dual-ov2775.dts or imx8mp-evk-dual-basler.dts. Please have a look.

Regards,
K.

0 Kudos
2,056 Views
Mawriyo
Contributor I

So I realized that the camera I got was not actually an ov5640... but instead this one.

https://www.baslerweb.com/en/embedded-vision/embedded-vision-portfolio/embedded-vision-kits/daa3840-...

Any idea how I'd use this instead of the OV5640? I tried the generic basler dtb but it did not work. Any information would be nice.

0 Kudos
2,041 Views
khang_letruong
Senior Contributor III

Hi @Mawriyo ,

I think there's enough documentation/instruction to get started from here : https://docs.baslerweb.com/embedded-vision/daa3840-30mc-imx8mp-evk.html. There would be a need to download and add some more specific layers from Basler (Camera Enablement Package - CEP) into Yocto and re-bitbake the image I guess.

Regards,

K.

 

0 Kudos