• 0

Failed to enumerate media (-2) : Capture images using Zybo and Pcam


Question

Hello all,

I am trying to capture images usong Zybbo PCam , I am using vivado design and petalinux project from digilent as reference. The reference project is in v2017.4 I am trying to implement that in v2019.1.
 

I am able to build the project successfully , However I get the error saying "Failed to enumerate media (-2)" when I try media-ctl -p command . 
The following is the error seen in the bootlog.
 

[    0.923845] xilinx-video amba_pl:vcap_mipi: device registered
[    0.928401] xilinx-video amba_pl:video_cap: No Video DMA channel found
[    0.933648] xilinx-video amba_pl:video_cap: /amba_pl/video_cap/ports/[email protected] initialization failed
[    0.941233] xilinx-video amba_pl:video_cap: DMA initialization failed

Can Somebody help me undertstand what I am doing wrong.
The following is the device tree
 

/include/ "system-conf.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/media/xilinx-vip.h>
/ {
	model = "Zynq Zybo Z7 Development Board";
	compatible = "digilent,zynq-zyboz7", "xlnx,zynq-7000";
	
	bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait";
	usb_phy0: [email protected] {
		compatible = "ulpi-phy";
		#phy-cells = <0>;
		reg = <0xe0002000 0x1000>;
		view-port = <0x0170>;
		drv-vbus;
	};
};
&usb0 {	
	dr_mode = "host";
	usb-phy = <&usb_phy0>;
};
&sdhci0 {
	u-boot,dm-pre-reloc;
};
&uart1 {
	u-boot,dm-pre-reloc;
};
&qspi {
	u-boot,dm-pre-reloc;
};
&flash0 {
	compatible = "micron,m25p80", "s25fl128s", "spi-flash";
};
&v_tc_0 {
	compatible = "xlnx,v-tc-6.1", "xlnx,v-tc-6.1";
};
/ {
	pcam_clk: pcam_clk {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <12000000>;
	};
	DOVDD: [email protected] {
		compatible = "regulator-fixed";
		regulator-name = "DOVDD_reg";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		gpio = <&gpio0 55 GPIO_ACTIVE_HIGH>;
		startup-delay-us = <50000>;
		enable-active-high;
	};
	AVDD: [email protected] {
		compatible = "regulator-fixed";
		regulator-name = "AVDD_reg";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
	};
	DVDD: [email protected] {
		compatible = "regulator-fixed";
		regulator-name = "DVDD_reg";
		regulator-min-microvolt = <1500000>;
		regulator-max-microvolt = <1500000>;
	};
};
&axi_iic_0 {
	
	ov5640: [email protected] {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		clocks = <&pcam_clk>;
		clock-names = "xclk";
		DOVDD-supply = <&DOVDD>; /* 1.8v */
		AVDD-supply = <&AVDD>;  /* 2.8v */
		DVDD-supply = <&DVDD>;  /* 1.5v */
		powerdown-gpios = <&gpio0 58 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio0 59 GPIO_ACTIVE_LOW>;
		port {
			ov5640_to_mipi_csi2: endpoint {
				remote-endpoint = <&mipi_csi2_from_ov5640>;
				clock-lanes = <0>;
				data-lanes = <1 2>;
			};
		};
	};
};
&mipi_csi2_rx_subsyst_0 {
	compatible = "xlnx,mipi-csi2-rx-subsystem-4.0", "xlnx,mipi-csi2-rx-subsystem-4.0";
	clock-names = "lite_aclk", "dphy_clk_200M", "video_aclk";
	clocks = <&misc_clk_0>, <&misc_clk_1>, <&misc_clk_0>;
	xlnx,max-lanes = <0x2>;
	xlnx,dphy-present;
	xlnx,vc = <0x4>;
	xlnx,csi-pxl-format = "YUV422_8bit";
	xlnx,vfb;
	xlnx,ppc = <0x1>;
	xlnx,axis-tdata-width = <0x10>;
	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		[email protected] {
			reg = <0>;
			xlnx,video-format = <XVIP_VF_YUV_422>;
			xlnx,video-width = <8>;
			mipi_csi2_out: endpoint {
				remote-endpoint = <&vcap_in>;
			};
		};
		[email protected] {
			reg = <1>;
			xlnx,video-format = <XVIP_VF_YUV_422>;
			xlnx,video-width = <8>;
			mipi_csi2_from_ov5640: endpoint {
				data-lanes = <1 2>;
				remote-endpoint = <&ov5640_to_mipi_csi2>;
			};
		};
	};
};
&v_frmbuf_wr_0 {
	#dma-cells = <1>;
	compatible = "xlnx,v-frmbuf-wr-2.1", "xlnx,axi-frmbuf-wr-v2.1";
	clock-names = "ap_clk";
	clocks = <&misc_clk_0>;
	reset-gpios = <&gpio0 56 GPIO_ACTIVE_LOW>;
	xlnx,dma-addr-width = <32>;
	xlnx,vid-formats = "yuyv", "uyvy", "nv16";
	xlnx,pixels-per-clock = <1>;
};
&amba_pl {
	video_cap {
		compatible = "xlnx,video";
		dmas = <&v_frmbuf_wr_0 0>;
		dma-names = "port0";
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			[email protected] {
				reg = <0>;
				direction = "input";
				vcap_in: endpoint {
					remote-endpoint = <&mipi_csi2_out>;
				};
			};
		};
	};
}

I am also attaching the complete boot og 
Any help is greatly appreciated. 
Thanks in advance!!

 

putty.log

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello Again,

There has been an update from yesterday , Actually the problem was that there were two vcap nodes created video_cap and vcap_mipi.
I changed the name of the node in the system-user.dtsi from video_cap to vcap_mipi.

After this the media device is probed and I am successfull in getting media graph as well. 

However after I set the media bus formats and resoltuion using media-ctl commands, when I try to capture images using the command as shown below I get an error and petalinux freezes.
 

media-ctl -d /dev/media0 -V '"ov5640 2-003c":0 [fmt:UYVY/'"640x"480'@1/30' field:none]'
media-ctl -d /dev/media0 -V '"43c60000.mipi_csi2_rx_subsystem":0 [fmt:UYVY/'"640x"480'@1/30' field:none]'
v4l2-ctl -d /dev/video0 --set-fmt-video=width="640",height="480",pixelformat='YUYV'
yavta -c14 -f YUYV -s 640x480 -F /dev/video0

The following is the error I get before it freezes.

[email protected]_ImageSaver:~# yavta -c1 -f YUYV -s 640x480 -F /dev/video0 
Device /dev/video0 opened.
Device `vcap_mipi output 0' on `platform:vcap_mipi:0' is a video output (without mplanes) device.
Video format set: YUYV (56595559) 640x480 field none, 1 planes: 
 * Stride 1280, buffer size 614400
Video format: YUYV (56595559) 640x480 field none, 1 planes: 
 * Stride 12Unable to handle kernel paging request at virtual address f09e0000
80, buffer size 614400
8 buffers requested.
length: 1 offset: pgd = (ptrval)
3201174072 timestamp type/source: mono/EoF
Buffer 0/0 m[afp0p9ee0000] *pgd=2fffb841, *pte=00000000, *ppte=00000000
 at address 0xb6daf000.
length: 1 offset: 3201174072 timestamp Internal error: Oops - BUG: 827 [#1] PREEMPT SMP ARM
type/source: mono/EoF
Buffer 1/0 mappMeodd ualte sa dldirneksesd in: uio_pdrv_genirq
0xb6d19000.
length: 1 offset: 3201174C0P7U2:  t1i mPeIsDt:a m1p318 Comm: yavta Not tainted 4.19.0-xilinx-v2019.1 #1
type/source: moHnaor/dEwoaFr
e
 Bnuafmfee:r  X2i/l0i nmxa pZpyend Platform
 at address 0xb6c83000.
length: 1 offset: 3201174072 tiPmCe sits at xcsi2rxss_s_stream+0x84/0x1a0
mp type/source: mono/EoF
Buffer 3/0 mapLpRe di sa ta ta dadrrme_heavy_mb+0x18/0x4c
s 0xb6bed000.
lengtphc:  :1  [o<fcf0s5e1t1:1 3302>0]1 1 7 4 0l7r : [<c01146f4>]    psr: 60070013
 timestamp type/sourcsep:  :m oeneoa/4E7ocF3
0
 B uifpf e:r  e4f/f4110  fp : 006080c0
0 mapped at addressr 100x:b 6ebf517408050c.0
 
 lre9n g:t he:f 316944  r8 : 00010000
 offset: 3201174072 timre7s t:a mepf 3t4y6p6e7/8s o urr6c e::  em346410  r5 : f09e0000  r4 : ef346460
ono/EoF
Buffer 5/0 marp3p e:d  0a0t0 0a0d0d0r2e s sr 20 x:b 6eae8eb524  r1 : 00000000  r0 : f080a730
1000.
length: 1 offset: F3l2a0g1s1:7 4n0Z7C2v  t iImReQsst aomnp FIQs on  Mode SVC_32  ISA ARM  Segment none
 type/source: mono/EoF
CBounftfreorl :6 /108 cm5a3p8p7edd   aTtable: 2e61804a  DAC: 00000051
address 0xb6a2b000.
lenPgrtohc:e s1s  oyfafvsteat :( p3i2d0:1 11318, stack limit = 0x(ptrval))
4072 timestamp type/soSutraccek::  m(o0nxoe/eEao4F7
c
3B0u ftfoe 0xeea48000)
 7/0 mapped at address 0xb6995000.
7c20:                                     fffffdfd 00000001 ef346460 ef346810
7c40: ef346810 c050c2bc eea47c68 ef148300 c0a03c48 00000000 ef346810 c050c510
7c60: 00010001 ef345018 ef148300 ef1485c0 00000000 00000000 ef345018 ef345048
7c80: ef346460 ef346490 ef353014 ef353044 effd0940 80070013 00000001 effd0940
7ca0: 2ee9c000 c01c1ba4 ffffe000 fffffffc 00000001 c0116b9c c0a346c0 00000000
7cc0: c0a346c0 c01a7c0c c0a03c48 00096000 00000001 eea47d74 00000034 c0a34dc0
7ce0: 0000000f 00000001 f091003c c0380290 ef148940 00000020 00000000 5f46fc1c
7d00: ef288cd0 ef345010 ef34535c 00000000 00000000 ef3453ec ef345010 ef346a3c
7d20: ef345018 c050d13c c0a03c48 ef346810 c0a03c48 00000001 00000000 00000280
7d40: 000001e0 0000200f 00000001 00000008 00000000 00000000 00000000 00000000
7d60: 00000000 00000000 00000000 ef345010 ef345010 eea9a600 eeb09f00 c0a03c48
7d80: ef34563c c050c0d4 eea47e5c 5f46fc1c 00000001 ef345500 ef3454d8 ef3455fc
7da0: c0a26e20 ef345414 eea47e5c c0769b18 c04efd84 c05021f8 00000000 ef345500
7dc0: 40045612 c0a26e20 ef345414 c05034b4 00000001 ef345018 40045612 c04f3b34
7de0: b6a00000 b6a2b000 b6a2b000 eea21500 00000000 ef21cc00 c0a03c48 eea21500
7e00: 00000114 00096000 ef19ea10 5f46fc1c ef19ea10 5f46fc1c bece05cc 00000000
7e20: 00000000 ef21cc00 00000000 40045612 eea47e5c 00000004 00000000 c04f4124
7e40: 00000000 bece07b8 ef21cc00 00000001 c04f3928 00000000 00000000 00000009
7e60: 00000009 00000000 00002003 00000000 00000000 00000000 00000000 00000000
7e80: 00000000 00000000 00000000 00000001 bece05cc 00000001 00000000 00000000
7ea0: 00000001 c038aebc ef21cc00 c038d0cc 00000051 eea27400 ee82a380 eeaebd80
7ec0: c038acbc 00000000 c0a03c48 becde2b0 00000029 00000004 bece092c 5f46fc1c
7ee0: 00096000 bece07b8 ef34acb0 ef21cc00 40045612 bece07b8 eea46000 00000036
7f00: c0a03c48 c01f34f0 bece07b8 c01f3d60 fff69fff 00000000 00000000 00000000
7f20: 00000000 5f46fc1c ef21cc00 eeaebd80 00000000 00000029 eeaebd88 ef116e40
7f40: 00000002 00000004 bece092c c01e3944 00000000 00000000 00000029 eeaebd80
7f60: becde2b0 5f46fc1c eeaebd80 ef21cc00 00000003 ef21cc00 40045612 bece07b8
7f80: eea46000 00000036 bece092c c01f4538 00498f2c b6f9a900 00096000 00000036
7fa0: c0101204 c0101000 00498f2c b6f9a900 00000003 40045612 bece07b8 2a7e4900
7fc0: 00498f2c b6f9a900 00096000 00000036 bece08e8 00000000 0049a4b4 bece092c
7fe0: 00498f64 bece07ac 00486c65 b6efad68 20070030 00000003 00000000 00000000
[<c0511130>] (xcsi2rxss_s_stream) from [<c050c2bc>] (xvip_entity_start_stop+0xcc/0x210)
[<c050c2bc>] (xvip_entity_start_stop) from [<c050c510>] (xvip_pipeline_start_stop+0x110/0x1b0)
[<c050c510>] (xvip_pipeline_start_stop) from [<c050d13c>] (xvip_dma_start_streaming+0x250/0x2b4)
[<c050d13c>] (xvip_dma_start_streaming) from [<c05021f8>] (vb2_start_streaming+0x64/0xec)
[<c05021f8>] (vb2_start_streaming) from [<c05034b4>] (vb2_core_streamon+0xe0/0x13c)
[<c05034b4>] (vb2_core_streamon) from [<c04f3b34>] (__video_do_ioctl+0x20c/0x320)
[<c04f3b34>] (__video_do_ioctl) from [<c04f4124>] (video_usercopy+0x3c4/0x4e4)
[<c04f4124>] (video_usercopy) from [<c01f34f0>] (vfs_ioctl+0x20/0x38)
[<c01f34f0>] (vfs_ioctl) from [<c01f3d60>] (do_vfs_ioctl+0x90/0x830)
[<c01f3d60>] (do_vfs_ioctl) from [<c01f4538>] (ksys_ioctl+0x38/0x54)
[<c01f4538>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeea47fa8 to 0xeea47ff0)
7fa0:                   00498f2c b6f9a900 00000003 40045612 bece07b8 2a7e4900
7fc0: 00498f2c b6f9a900 00096000 00000036 bece08e8 00000000 0049a4b4 bece092c
7fe0: 00498f64 bece07ac 00486c65 b6efad68
Code: e0855008 f57ff04e ebf00d6b e3a03002 (e5853000) 
---[ end trace 33f6bc73415560a9 ]---

Your help and time is highly appreciated.
Thank you!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now