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.

AM5728: VIN1A camera issue

Part Number: AM5728
Other Parts Discussed in Thread: TMDSCM572X,

Hi

I have a custom board with AM5728 with a camera connector similar on the EVM module to connect TMDSCM572X mt9t111x camera sensor. The only difference is the video input port has been changes from VIN3A on the EVM board to VIN1A on my custom board. I use linux sdk 06.00.00.07.

We have generated pad config data and pad io delay data with am57xx_generate_pin_config_data.pl script and generated files with pinmux software and we have replaced them on the U-Boot mux_data.h file to enable VIN1A pads. The I2C and control pins and ports are same as EVM. The following lines have been added to am57xx-beagle-x15-common.dtsi file to enable I2C5 and VIN1A:

&i2c5 {
	status = "okay";
	clock-frequency = <400000>;
	
	mt9t11x@3C {
		compatible = "aptina,mt9t111";
		bufen-gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
		camen-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* connects to LED1 */
		oscen-gpios = <&gpio5 10 GPIO_ACTIVE_HIGH>;
		powerdown-gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
		reg = <0x3C>;
		reset-gpios = <&gpio4 17 GPIO_ACTIVE_LOW>;

		port {
			cam: endpoint {
				hsync-active = <1>;
				input-clock-freq = <32000000>;
				pclk-sample = <0>;
				pixel-clock-freq = <96000000>;
				remote-endpoint = <&vin1a_ep>;
				vsync-active = <0>;
			};
		};
	};
};

&vin1a {
	vin1a_ep: endpoint {
		remote-endpoint = <&cam>;
		slave-mode;
	};
};

&vip1 {
	status = "okay";
};

Since there is no extra buffer between camera module and the AM5728 IC (which is on the LCD module of EVM), camen-gpios not used.

The output of dmesg shows the camera is detected and registered correctly:

root@am57xx-evm:~# dmesg | grep video
[    0.595056] videodev: Linux video capture interface: v2.00
[   13.723198] vpe 489d0000.vpe: Device registered as /dev/video0
[   14.040980] vin1a-0: device registered as video1
[    0.776204] omap_i2c 48070000.i2c: bus 0 rev0.12 at 400 kHz
[    0.777075] omap_i2c 48060000.i2c: bus 2 rev0.12 at 400 kHz
[    0.778086] omap_i2c 4807c000.i2c: bus 4 rev0.12 at 400 kHz

[   16.047082] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   16.047151] of_get_named_gpiod_flags: parsed 'powerdown-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   16.047212] of_get_named_gpiod_flags: parsed 'oscen-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   16.047270] of_get_named_gpiod_flags: parsed 'bufen-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   16.047329] of_get_named_gpiod_flags: parsed 'camen-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)

root@am57xx-evm:~# dmesg | grep mt9
[   15.201468] mt9t11x 4-003c: input-clock-freq: 32000000
[   15.208719] mt9t11x 4-003c: pixel-clock-freq: 96000000
[   15.229080] mt9t11x 4-003c: GPIO lookup for consumer reset
[   15.229088] mt9t11x 4-003c: using device tree for GPIO lookup
[   15.242047] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   15.242127] mt9t11x 4-003c: GPIO lookup for consumer powerdown
[   15.242134] mt9t11x 4-003c: using device tree for GPIO lookup
[   15.243428] of_get_named_gpiod_flags: parsed 'powerdown-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   15.277442] mt9t11x 4-003c: GPIO lookup for consumer oscen
[   15.277448] mt9t11x 4-003c: using device tree for GPIO lookup
[   15.277479] of_get_named_gpiod_flags: parsed 'oscen-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   15.277500] mt9t11x 4-003c: GPIO lookup for consumer bufen
[   15.277506] mt9t11x 4-003c: using device tree for GPIO lookup
[   15.277524] of_get_named_gpiod_flags: parsed 'bufen-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   15.277544] mt9t11x 4-003c: GPIO lookup for consumer camen
[   15.277550] mt9t11x 4-003c: using device tree for GPIO lookup
[   15.277566] of_get_named_gpiod_flags: parsed 'camen-gpios' property of node '/ocp/i2c@4807c000/mt9t11x@3C[0]' - status (0)
[   15.334510] mt9t11x 4-003c: mt9t111 chip ID 2680 rev 007f
[   15.372336] mt9t11x 4-003c: mt9t11x sensor driver registered !!
[   16.198923] vin1a: Port A: Using subdev mt9t11x for capture

And I can see /dev/video1 . But there is no meaningful output on the screen. The Video Analytics Demo hangs and do nothing. gstreamer pipelines do nothing and hangs.

gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480' ! vpe num-input-buffers=8 ! queue ! kmssink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:30.189018661
Setting pipeline to PAUSED ...
Setting pipeline to READY ...

(gst-launch-1.0:1152): GStreamer-CRITICAL **: 03:16:23.719: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
Setting pipeline to NUL ...

The only test I can perform is  capturevpedisplay with the following command and it shows a colored screen:

capturevpedisplay 1920 1080 yuyv 1920 1080 yuyv 0 1 -s 54:1920x1080

vpe:/dev/video0 open success!!!
vip open success!!!
using 1 connectors, 1920x1080 display, multiplanar: 1
Setting mode 1920x1080 on connector 54, crtc 55
vip: G_FMT(start): width = 1920, height = 1080, 4cc = YUYV
vpe i/p: G_FMT: width = 1920, height = 1080, 4cc = YUYV
vpe o/p: G_FMT: width = 1920, height = 1080, 4cc = YUYV
Page flip: frame=2067, sec=158, usec=964634, remaining=0

Any suggestion on what maybe wrong in the DTS or something else? (The Camera module is fine with EVM module)

  • Hi Aidin,

    Your MT9 message look identical to the output on my system running the same version of the SDK.  Also your gstreamer pipeline works fine on my EVM as well.  Are you able to probe any of your video signals to verify pixel data is actually being sent to the AM57x?

    Regards,
    Mike

  • Hi Michael

    Thanks for the reply. As I mentioned in the post, everything works fine on the EVM with VIN3A.

    The problem is with my custom board connecting sensor to VIN1A. I have checked all the signals, data lines and 96MHz clock are fine. GPIO4_17 which is connected to sensor reset, is going high when script runs. Same for CAM_POWERDOWN, they are low before starting the script and then they go high. OSC_EN is always high regardless of running the program and BUFEN is always low.

    I think something need to be done to feed VIN1A video data to the next stages.

  • Hi Again

    I found the source of the problem. I was in mux_data.h in U-Boot.

    There is a structure named pad_conf_entry core_padconf_array_delta_x15_sr2_0[] in the mux_data.h and it is called in the board.c file and overwrites the previous pad config. In this structure, VIN1A_CLK0 pad was configured by default to gpio. I changed it and the streaming starts!

  • Hi Aidin,

    Thank you for replying with your fix!