iMX6 : mipi_csi no clock detected

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX6 : mipi_csi no clock detected

Jump to solution
92 Views
Contributor II

Hi,

I'm trying to interface a ADV7282m with an iMXq.

Here is my .dts and the graph obtained from media-ctl --print-dot.

#include "imx6q.dtsi"
#include "imx6qdl-smarc-wm8326.dtsi"

/ {
    model = "Freescale i.MX6 Quad SMARC REV-SA01 Device Board";
    compatible = "fsl,imx6q-smarc", "fsl,imx6q";

    v4l2_camera_0: v4l2_camera {
       compatible = "fsl,imx6q-v4l2-capture";
       ipu_id = <0>;
       csi_id = <0>;
       mipi_camera = <1>;
       mclk_source = <0>;
       status = "okay";
    };
};

&i2c2 {
    adv7282m: adv7282m@20 {
       compatible = "adi,adv7282-m";
       reg = <0x20>;
       ipu_id = <0>;
       csi_id = <0>;
       input = <0x0>;
       mclk = <27000000>;
       mclk_source = <0>;
       clocks = <&clks 200>;
       clock-names = "csi_mclk";

       port {
          adv7282_to_csi: endpoint {
             remote-endpoint = <&mipi_csi2_in>;
          };
       }:
    };
};

&mipi_csi {
    status = "okay";
    ipu_id = <0>;
    csi_id = <0>;
    v_channel = <0>; /* should be "(ipu_id << 1) | csi_id" */
    lanes = <1>;

    port@0 {
       reg = <0>;
       mipi_csi2_in: endpoint {
          data-lanes = <1>;
          remote-endpoint = <&adv7282_to_csi>;
       };
    };
};

&mxcfb1 {
    disp_dev = "ldb";
    interface_pix_fmt = "RGB666";
    default_bpp = <32>;
    status = "okay";
};

&mxcfb3 {
    disp_dev = "hdmi";
    interface_pix_fmt = "RGB24";
    mode_str ="800x600M@60";
    default_bpp = <32>;
    status = "okay";
};

&sata {
    status = "okay";
};

graph.PNG

When I use gstreamer (gst-launch-1.0 -e v4l2src device=/dev/video0 ! queue ! fakesink), I get a broken pipe with following traces in dmesg :

[ 189.271176] imx6-mipi-csi2: LP-11 wait timeout, likely a sensor driver bug, expect capture failures.
[ 189.286011] imx6-mipi-csi2: phy_state = 0x00000200
[ 189.808406] imx6-mipi-csi2: clock lane timeout, phy_state = 0x00000200
[ 189.818198] ipu1_csi0: pipeline start failed with -110

I guess the clock is not received by the imx6_mipi_csi2 entity but when I check with the scope I can see that a signal is present. I can not verifiy this signal's quality because it is too fast for my scope but it is definetly here oscillating around 200mV.

Is there anything else than a bad quality signal that can cause the bit phy_rxclkactivehs of the MIPI_CSI_PHY_STATE register to get stucked at 0 ?

 

Best regards,

Bastien

0 Kudos
1 Solution
54 Views
Contributor II

I found the problem, two parameters were missing in the .dts (at adv7282 endpoint)

 hsync-active = <1>;
vsync-active = <1>;

View solution in original post

0 Kudos
3 Replies
55 Views
Contributor II

I found the problem, two parameters were missing in the .dts (at adv7282 endpoint)

 hsync-active = <1>;
vsync-active = <1>;

View solution in original post

0 Kudos
80 Views
Contributor II

Hi Igor,

I had taken a look at it, I have now found the problem : the imx6 mipi csi expects low power inputs until the stream starts.

I have modified the adv7282m driver to enable the CSI output later.

Now I have following errors :

    gstreamer :

root@smarc:~# gst-launch-1.0 --gst-debug-level=2 v4l2src device=/dev/video0 ! queue ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.254576000 715 0x100cc00 WARN v4l2bufferpool gstv4l2bufferpool.c:806:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:01.398244667 715 0x100cc00 WARN v4l2bufferpool gstv4l2bufferpool.c:1123:gst_v4l2_buffer_pool_poll:<v4l2src0> error: poll error 1: Invalid argument (22)
0:00:01.398498000 715 0x100cc00 WARN v4l2src gstv4l2src.c:1001:gst_v4l2src_create:<v4l2src0> error: Failed to allocate a buffer
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not read from resource.
0:00:01.398705334 715 0x100cc00 WARN basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
Additional debug info:
../../../gst-plugins-good-1.16.1/sys/v4l2/gstv4l2bufferpool.c(1123): gst_v4l2_buffer_pool_poll (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
poll error 1: Invalid argument (22)
0:00:01.398835334 715 0x100cc00 WARN basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason error (-5)
Execution ended after 0:00:01.157303666
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

      dmesg

[ 878.529609] imx_media_csi:csi_s_stream: imx-ipuv3-csi imx-ipuv3-csi.0: stream ON
[ 878.532596] imx6_mipi_csi2:csi2_s_stream: imx6-mipi-csi2 21dc000.mipi: stream ON
[ 878.612095] imx_ipu_v3:ipu_cpmem_set_image: ipu_cpmem_set_image: resolution: 720x480 stride: 1440
[ 878.612107] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 0 125 13
[ 878.612117] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 0 138 12
[ 878.612125] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 102 14
[ 878.612135] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 0 107 3
[ 878.612143] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 85 4
[ 878.612152] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 78 7
[ 878.612160] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 0 29
[ 878.612169] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 29 29
[ 878.612178] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 78 7
[ 878.612189] imx_ipu_v3:ipu_ch_param_write_field: ipu_ch_param_write_field 1 93 2
[ 878.612207] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: ch 0 word 0 - 00000000 00000000 00000000 E0001800 00077C59
[ 878.612222] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: ch 0 word 1 - 090E0000 01208000 0103C000 000167C0 00000000
[ 878.612231] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 85 4
[ 878.612241] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: PFS 0x8,
[ 878.612249] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 0 107 3
[ 878.612259] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: BPP 0x3,
[ 878.612268] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 78 7
[ 878.612277] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: NPB 0xf
[ 878.612285] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 0 125 13
[ 878.612294] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: FW 719,
[ 878.612302] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 0 138 12
[ 878.612311] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: FH 479,
[ 878.612320] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 0 29
[ 878.612330] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: EBA0 0x48700000
[ 878.612338] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 29 29
[ 878.612348] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: EBA1 0x48200000
[ 878.612356] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 102 14
[ 878.612365] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Stride 1439
[ 878.612374] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 0 113 1
[ 878.612383] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: scan_order 0
[ 878.612391] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 128 14
[ 878.612400] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: uv_stride 0
[ 878.612408] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 0 46 22
[ 878.612418] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: u_offset 0x0
[ 878.612427] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 0 68 22
[ 878.612436] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: v_offset 0x0
[ 878.612444] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 116 3
[ 878.612453] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Width0 0+1,
[ 878.612461] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 119 3
[ 878.612470] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Width1 0+1,
[ 878.612479] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 122 3
[ 878.612489] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Width2 0+1,
[ 878.612497] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 125 3
[ 878.612506] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Width3 0+1,
[ 878.612514] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 128 5
[ 878.612523] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Offset0 0,
[ 878.612531] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 133 5
[ 878.612540] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Offset1 0,
[ 878.612548] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 138 5
[ 878.612557] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Offset2 0,
[ 878.612564] imx_ipu_v3:ipu_ch_param_read_field: ipu_ch_param_read_field 1 143 5
[ 878.612573] imx_ipu_v3:ipu_cpmem_dump: imx-ipuv3 2400000.ipu: Offset3 0
[ 878.612585] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_CONF = 0x00000660
[ 878.612594] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_CONF = 0x0000002F
[ 878.612604] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_CHA_EN1 = 0x00800000
[ 878.612613] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_CHA_EN2 = 0x00000000
[ 878.612624] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_CHA_PRI1 = 0x00800001
[ 878.612633] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_CHA_PRI2 = 0x00000000
[ 878.612643] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_BAND_EN1 = 0x00000000
[ 878.612652] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IDMAC_BAND_EN2 = 0x00000000
[ 878.612663] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_CHA_DB_MODE_SEL0 = 0x00800001
[ 878.612673] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_CHA_DB_MODE_SEL1 = 0x00000000
[ 878.612682] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_FS_PROC_FLOW1 = 0x00000000
[ 878.612693] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_FS_PROC_FLOW2 = 0x00000000
[ 878.612703] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_FS_PROC_FLOW3 = 0x00000000
[ 878.612712] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_FS_DISP_FLOW1 = 0x00000000
[ 878.612722] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(0) = 00000000
[ 878.612732] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(1) = 00000000
[ 878.612742] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(2) = 00000000
[ 878.612751] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(3) = 00000000
[ 878.612761] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(4) = 00000000
[ 878.612771] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(5) = 00000000
[ 878.612780] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(6) = 00000000
[ 878.612790] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(7) = 00000000
[ 878.612800] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(8) = 00000000
[ 878.612810] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(9) = 00000000
[ 878.612819] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(10) = 00000000
[ 878.612829] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(11) = 00000000
[ 878.612839] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(12) = 00000000
[ 878.612849] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(13) = 00000000
[ 878.612859] imx_ipu_v3:ipu_dump: imx-ipuv3 2400000.ipu: IPU_INT_CTRL(14) = 00000000
[ 878.618015] imx_ipu_v3:ipu_csi_init_interface: imx-ipuv3 2400000.ipu: CSI_SENS_CONF = 0x00000A20
[ 878.623163] imx_ipu_v3:ipu_csi_init_interface: imx-ipuv3 2400000.ipu: CSI_ACT_FRM_SIZE = 0x01DF02CF
[ 878.623177] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_SENS_CONF: 04000a20
[ 878.623186] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_SENS_FRM_SIZE: 01df02cf
[ 878.623196] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_ACT_FRM_SIZE: 01df02cf
[ 878.623206] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_OUT_FRM_CTRL: 00000000
[ 878.623215] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_TST_CTRL: 00000000
[ 878.623225] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_CCIR_CODE_1: 00040030
[ 878.623234] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_CCIR_CODE_2: 00000000
[ 878.623245] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_CCIR_CODE_3: 00ff0000
[ 878.623255] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_MIPI_DI: ffffffff
[ 878.623264] imx_ipu_v3:ipu_csi_dump: imx-ipuv3 2400000.ipu: CSI_SKIP: 00000000
[ 878.623279] imx_media_common:update_fim_nominal: imx-ipuv3-csi imx-ipuv3-csi.0: FI=33333 usec
[ 879.674873] ipu1_csi0: EOF timeout
[ 881.222276] imx_media_csi:csi_s_stream: imx-ipuv3-csi imx-ipuv3-csi.0: stream OFF
[ 882.237891] imx6_mipi_csi2:csi2_s_stream: imx6-mipi-csi2 21dc000.mipi: stream OFF

Can you tell me what wan possibly cause this EOF timeout please ?

Best regards,

Bastien

 

 

0 Kudos
85 Views
NXP TechSupport
NXP TechSupport

Hi BastienSca

 

one can look at similar issue on

https://community.nxp.com/t5/i-MX-Processors/Occasional-Rolling-Video-mx6-adv7282-m/m-p/1044763

 

Best regards
igor

0 Kudos