This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] SK-AM62A-LP:Pcam5C OV5640 摄像头的流式传输不工作。

Guru**** 2587365 points
Other Parts Discussed in Thread: SK-AM62A-LP

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1574504/sk-am62a-lp-streaming-of-the-pcam5c-ov5640-camera-is-not-working

器件型号:SK-AM62A-LP


工具/软件:

尊敬的 TI 专家:

我正在尝试将 Pcam5c(具有内置 ISP 的 ov5640)连接到 SK-AM62A-LP。

PSDK 的版本为 11.01.07.05。

我按如下方式修改了器件树、  

diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
index 3a6d18c141d0..57a967b91b6e 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
@@ -248,6 +248,11 @@ sound_master: simple-audio-card,codec {
 			clocks = <&tlv320_mclk>;
 		};
 	};
+	clk_ov5640_fixed: ov5640-xclk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <12000000>;
+	};
 };
 
 &mcu_pmx0 {
@@ -626,6 +631,13 @@ exp2: gpio@23 {
 				  "RGMII2_BRD_CONN_DET", "CSI_SEL2",
 				  "CSI_EN", "AUTO_100M_1000M_CONFIG",
 				  "CSI_VLDO_SEL", "SoC_WLAN_SDIO_RST";
+		p19-hog {
+			/* P19 - CSI_SEL2 */
+			gpio-hog;
+			gpios = <19 GPIO_ACTIVE_HIGH>;
+			output-low;
+			line-name = "CSI_SEL2";
+		};
 	};
 
 	sii9022: bridge-hdmi@3b {
@@ -663,7 +675,60 @@ &main_i2c2 {
 	status = "okay";
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_i2c2_pins_default>;
-	clock-frequency = <400000>;
+
+	i2c-switch@71 {
+		compatible = "nxp,pca9543";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x71>;
+		i2c@1 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <1>;
+
+			ov5640: camera@3c {
+				compatible = "ovti,ov5640";
+				reg = <0x3c>;
+				clocks = <&clk_ov5640_fixed>;
+				powerdown-gpios = <&exp1 13 GPIO_ACTIVE_LOW>;
+				clock-names = "xclk";
+				port {
+					csi2_cam0: endpoint {
+						remote-endpoint = <&csi2rx0_in_sensor>;
+						clock-lanes = <0>;
+						data-lanes = <1 2>;
+					};
+				};
+			};
+		};
+	};
+};
+
+&cdns_csi2rx0 {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		csi0_port0: port@0 {
+			reg = <0>;
+			status = "okay";
+
+			csi2rx0_in_sensor: endpoint {
+				remote-endpoint = <&csi2_cam0>;
+				bus-type = <4>; /* CSI2 DPHY. */
+				clock-lanes = <0>;
+				data-lanes = <1 2>;
+			};
+		};
+	};
+};
+
+&ti_csi2rx0 {
+	status = "okay";
+};
+
+&dphy0 {
+	status = "okay";
 };
 
 &sdhci0 {

对设备树的修改似乎正常工作。

 

[    5.980358] ov5640 4-003c: supply DOVDD not found, using dummy regulator
[    5.983954] ov5640 4-003c: supply AVDD not found, using dummy regulator
[    5.985083] ov5640 4-003c: supply DVDD not found, using dummy regulator
...
[    6.108100] /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/camera@3c: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
[    6.130838] /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000: Fixed dependency cycle(s) with /bus@f0000/i2c@20020000/i2c-switch@71/i2c@1/camera@3c
[    6.154938] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 2/4 lanes, 4 streams, external D-PHY

当我登录时、将显示消息。  

CSI Camera 0 detected
    device = /dev/video-ov5640-cam0
    name = ov5640
    format = [fmt:YUYV8_1X16/1280x720]
    subdev_id = /dev/v4l-ov5640-subdev0
    isp_required = no

接下来、我尝试使用以下命令进行摄像头流式传输。

gst-launch-1.0 -v v4l2src device=/dev/video-ov5640-cam0 io-mode=5 ! \
video/x-raw, width=1280, height=720, framerate=30/1,format=YUY2 ! \
kmssink driver-name=tidss sync=false

结果如下、HDMI 显示屏上不显示任何图像。

root@am62axx-evm:/opt/edgeai-gst-apps# gst-launch-1.0 -v v4l2src device=/dev/video-ov5640-cam0 io-mode=5 ! \
rate=30/1,format=YUY2 ! \
kmssin> video/x-raw, width=1280, height=720, framerate=30/1,format=YUY2 ! \
> kmssink driver-name=tidss sync=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUY2, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUY2, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUY2, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUY2, interlace-mode=(string)progressive, colorimetry=(string)bt709

如果您有解决方案、如果您能告诉我、我将不胜感激。

此致、

Takayuki

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、 Takayuki、

    让我检查一下并更新您

    此致、

    Dilna K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    H Takayuki、

    请将您的格式更改为 format=YuYv8 并重试。

    并使用“videotestsrc"进行“进行测试、以确定它是否是与显示器相关的问题。

    此致、

    Dilna K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Dilna K-San、

    将格式设置为 YUYV8 的测试没有顺利进行。

    因此、屏幕上不会显示任何内容。

    root@am62axx-evm:/opt/edgeai-gst-apps# gst-launch-1.0 -v v4l2src device=/dev/video-ov5640-cam0 io-mode=5 ! video/x-raw, width=1280, height=720, framerate=30/1,format=YUYV8 ! kmssink driver-name=tidss sync=false
    WARNING: erroneous pipeline: could not link v4l2src0 to kmssink0, neither element can handle caps video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUYV8

    videotestsrc 的结果很好。 测试模式在屏幕上正确显示。

    root@am62axx-evm:/opt/edgeai-gst-apps# gst-launch-1.0 -v videotestsrc ! \
    > video/x-raw, width=1280, height=720, framerate=30/1,format=YUY2 ! \
    > kmssink driver-name=tidss sync=false
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
    /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:01.800291050
    Setting pipeline to NULL ...
    Freeing pipeline ...

    此致、

    Takayuki

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Dilna K-San:

    补丁程序的以下部分已删除、流式传输正在运行。

    @@ -626,6 +631,13 @@ exp2: gpio@23 {
     				  "RGMII2_BRD_CONN_DET", "CSI_SEL2",
     				  "CSI_EN", "AUTO_100M_1000M_CONFIG",
     				  "CSI_VLDO_SEL", "SoC_WLAN_SDIO_RST";
    +		p19-hog {
    +			/* P19 - CSI_SEL2 */
    +			gpio-hog;
    +			gpios = <19 GPIO_ACTIVE_HIGH>;
    +			output-low;
    +			line-name = "CSI_SEL2";
    +		};
     	};
     
     	sii9022: bridge-hdmi@3b {

    我 忽略了 11.01.07.05 中设备树覆盖文件的更改、当时我指的是 PSDK10 上的覆盖文件。

    下面是一个补丁、可使流式传输正常工作。

    diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
    index 3a6d18c141d0..f06cd9359dd2 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
    +++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
    @@ -109,6 +109,21 @@ rtos_ipc_memory_region: ipc-memories@a0000000 {
     			reg = <0x00 0xa0000000 0x00 0x01000000>;
     			no-map;
     		};
    +		edgeai_memory_region: edgeai-dma-memory@a1000000 {
    +			compatible = "shared-dma-pool";
    +			reg = <0x00 0xa1000000 0x00 0x02000000>;
    +			no-map;
    +		};
    +
    +		edgeai_shared_region: edgeai_shared-memories {
    +			compatible = "dma-heap-carveout";
    +			reg = <0x00 0xa3000000 0x00 0x0ac00000>;
    +		};
    +		edgeai_core_heaps: edgeai-core-heap-memory@adc00000 {
    +			compatible = "shared-dma-pool";
    +			reg = <0x00 0xadc00000 0x00 0x12400000>;
    +			no-map;
    +		};
     	};
     
     	opp-table {
    @@ -248,6 +263,11 @@ sound_master: simple-audio-card,codec {
     			clocks = <&tlv320_mclk>;
     		};
     	};
    +	clk_ov5640_fixed: ov5640-xclk {
    +		compatible = "fixed-clock";
    +		#clock-cells = <0>;
    +		clock-frequency = <25000000>;
    +	};
     };
     
     &mcu_pmx0 {
    @@ -664,6 +684,60 @@ &main_i2c2 {
     	pinctrl-names = "default";
     	pinctrl-0 = <&main_i2c2_pins_default>;
     	clock-frequency = <400000>;
    +
    +	i2c-switch@71 {
    +		compatible = "nxp,pca9543";
    +		#address-cells = <1>;
    +		#size-cells = <0>;
    +		reg = <0x71>;
    +		i2c@1 {
    +			#address-cells = <1>;
    +			#size-cells = <0>;
    +			reg = <1>;
    +
    +			ov5640: camera@3c {
    +				compatible = "ovti,ov5640";
    +				reg = <0x3c>;
    +				clocks = <&clk_ov5640_fixed>;
    +				powerdown-gpios = <&exp1 13 GPIO_ACTIVE_LOW>;
    +				clock-names = "xclk";
    +				port {
    +					csi2_cam0: endpoint {
    +						remote-endpoint = <&csi2rx0_in_sensor>;
    +						clock-lanes = <0>;
    +						data-lanes = <1 2>;
    +					};
    +				};
    +			};
    +		};
    +	};
    +};
    +
    +&cdns_csi2rx0 {
    +	ports {
    +		#address-cells = <1>;
    +		#size-cells = <0>;
    +
    +		csi0_port0: port@0 {
    +			reg = <0>;
    +			status = "okay";
    +
    +			csi2rx0_in_sensor: endpoint {
    +				remote-endpoint = <&csi2_cam0>;
    +				bus-type = <4>; /* CSI2 DPHY. */
    +				clock-lanes = <0>;
    +				data-lanes = <1 2>;
    +			};
    +		};
    +	};
    +};
    +
    +&ti_csi2rx0 {
    +	status = "okay";
    +};
    +
    +&dphy0 {
    +	status = "okay";
     };
     
     &sdhci0 {

    此致、

    Takayuki