cancel
Showing results for 
Search instead for 
Did you mean: 

stm32mp135f-dk camera problem

kagan_senkeser
Associate III

Hello,

 

I have stm32mp135f-DK board also gc2145 camera which works perfectly fine

but when ı connect Raspberry pi camera module v2

it does not appear with 

 v4l2-ctl --list-devices

So I wonder is it possible to use that camera with modifying linux kernel device tree etc or is it's just impossible ?

4 REPLIES 4
kagan_senkeser
Associate III

I discovered When I connect usb camera or gc2145 I can get stream them from the app on the board without stm32mp135f-dk.stb on the boot folder but I could not get stream with raspberry pi.
So is it possible to use Raspberry pi camera with stm32mp135f-dk board 

Also for example I bought a new camera which can work with stm32mp135f-dk

Should I modify linux kernel device tree etc. Or just modify dtb file is enough ( take dtb from boot folder make it dts make configuration that I want make it dtb again and upload the board's boot folder  is this enough)

@Erwan SZYMANSKI 

Hello @kagan_senkeser ,
USB camera has a driver that is supported by default in our deliveries, this is the reason why you can manipulate this kind of camera.
Concerning the CSI camera gc2145this is the default camera we provide with the Discovery Kit, so by default yes you are right, this is configured inside the device tree.

Let's take a look together, take a look at https://github.com/STMicroelectronics/linux/blob/v6.1-stm32mp/arch/arm/boot/dts/stm32mp135f-dk.dts

You can see : 

gc2145: gc2145@3c {
		compatible = "galaxycore,gc2145";
		reg = <0x3c>;
		clocks = <&clk_ext_camera>;
		IOVDD-supply = <&scmi_v3v3_sw>;
		AVDD-supply = <&scmi_v3v3_sw>;
		DVDD-supply = <&scmi_v3v3_sw>;
		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		status = "okay";

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

The node gc2145 configures everything to use this camera, with status = "okay".
Just behind you can see on this same file that you have a node called ov5640 that has status= "disabled". It is the configuration for another camera (the old one we had by default in our delivery). If you want to use this one, you will put the status at "okay" and the status of the other one(s) at "disabled".

Now, what about your Raspi camera ? 

You now understand that a one CSI camera = one Device tree configuration. You also see the compatible property that is here to target the camera driver. Please check if your camera has a driver already supported in the Linux kernel, then adapt the device tree to probe your camera driver/config instead of the default one configured in our deliveries.

I hope it will help you to go forward.

Kind Regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello I enabled IMX219 driver which is raspberry pi camera sensor 
and modified device tree but my board still don't see the camera 
Can you check my dts
I added port@3 and IMX219 are these correct @Erwan SZYMANSKI 

 

 

 

ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;

				mipid02_0: endpoint {
					data-lanes = <1 2>;
					lane-polarities = <0 0 0>;
					remote-endpoint = <&gc2145_ep>;
				};
			};
			port@2 {
				reg = <2>;

				mipid02_2: endpoint {
					bus-width = <8>;
					hsync-active = <0>;
					vsync-active = <0>;
					pclk-sample = <0>;
					remote-endpoint = <&dcmipp_0>;
				};
			};
			
			port@3 {
				csi_in: endpoint {
				    remote-endpoint = <&imx219_out>;
				    data-lanes = <1 2>;
				    clock-lanes = <0>;
				    clock-noncontinuous;
				};
			};
		};
	};
	
	
	

	gc2145: gc2145@3c {
		compatible = "galaxycore,gc2145";
		reg = <0x3c>;
		clocks = <&clk_ext_camera>;
		IOVDD-supply = <&scmi_v3v3_sw>;
		AVDD-supply = <&scmi_v3v3_sw>;
		DVDD-supply = <&scmi_v3v3_sw>;
		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		status = "okay";

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

	ov5640: camera@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		clocks = <&clk_ext_camera>;
		clock-names = "xclk";
		DOVDD-supply = <&scmi_v3v3_sw>;
		status = "disabled";
		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;

		port {
			ov5640_0: endpoint {
				/*remote-endpoint = <&mipid02_0>;*/
				clock-lanes = <0>;
				data-lanes = <1 2>;
			};
		};
	};
	
	imx219@10 {
		compatible = "sony,imx219";
		reg = <0x10>;
		status = "okay";

		/* Clock configuration */
		clocks = <&clk_ext_camera>;
		clock-names = "xclk";

		/* GPIO pins configuration */
		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;

		/* Power supplies */
		avdd-supply = <&scmi_v3v3_sw>;
		dovdd-supply = <&scmi_v3v3_sw>;
		dvdd-supply = <&scmi_v3v3_sw>;

		/* I2C settings */
		i2c-bus = <&i2c1>;

		/* MIPI CSI-2 settings */
		port {
		    imx219_out: endpoint {
		        remote-endpoint = <&csi_in>;
		        data-lanes = <1 2>;
		        clock-lanes = <0>;
		        clock-noncontinuous;
		        link-frequencies = /bits/ 64 <600000000>;
		    };
		};
    	};
​

 

Hi @kagan_senkeser ,
Not sure about your modification on stmipi node. I think you have to do like for the ov5640, comment the remote-endpoint, and put the same on your new camera node.

Then, you will have to check the probing state of your different IPs thanks to Kernel logs. Check if all the element involved in your new camera configuration are well probed, or correct/report the errors you have.

Also double check that you do not need to activate a specific kernel config dedicated to your new camera driver.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.