5 Replies Latest reply on Oct 22, 2018 8:26 PM by yyca

    CX3 - Debug MIPI CSI-2 Interface

    steffen.kutz_3708171

      Hi,

       

      I am using the CX3 on the e-con systems Denebola Development Kit. I am trying to connect a image sensor but I have some issues and I am stuck with the debugging.

      I get to the state where the device is enumerated correctly on the PC with the proper resolution, but the image is black and the frame rate is 0.

      Here are my questions:

       

      1.) Can the following work?

      The sensor is configured via I2C, but not from the CX3 but from another external module. So I start the firmware of the CX3, it gets configured and in a sleep state, I set up the image sensor, than start a viewer on my PC(e-cam view) to get the CX3 reading the MIPI-Interface.

       

      2.) Is the MIPI configuration correct?

      I use the CX3 configurator tool to create the firmware I use. Here are the values:

      THS-Prepare: 64 ns

      THS-Zero: 392 ns

      Video Format: RAW12

      Data Lanes: 4

      CSI Clock (Mhz): 375

      H-Active (Pxl): 1280

      H-Blanking Pxl): 370

      V-Active (Pxl): 960

      V-Blanking Pxl): 37

      Frame Rate (fps): 40

      mipiConfig.jpg

       

      3.) Is there a way to read LV (Line Valid) and FV (Frame Valid) via software?

      In order to debug I would like to know if there is any data coming on the MIPI CSI-2 interface. I know that the GPIF State Machine is stuck in state 2 (Wait for Frame Valid) and that glDMATxCount is always 0.

        • 1. Re: CX3 - Debug MIPI CSI-2 Interface
          yyca

          Hi Steffen,

           

          1.) Can the following work?

          The sensor is configured via I2C, but not from the CX3 but from another external module. So I start the firmware of the CX3, it gets configured and in a sleep state, I set up the image sensor, than start a viewer on my PC(e-cam view) to get the CX3 reading the MIPI-Interface.

          >> Yes, it should work.

           

          2.) Is the MIPI configuration correct?

          I use the CX3 configurator tool to create the firmware I use. Here are the values:

          THS-Prepare: 64 ns

          THS-Zero: 392 ns

          Video Format: RAW12

          Data Lanes: 4

          CSI Clock (Mhz): 375

          H-Active (Pxl): 1280

          H-Blanking Pxl): 370

          V-Active (Pxl): 960

          V-Blanking Pxl): 37

          Frame Rate (fps): 40

          >> You need to check these values with sensor vendor. We are not able to check whether they are correct or not. The configuration tool will use these values to calculate MIPI block configuration parametes.

           

          3.) Is there a way to read LV (Line Valid) and FV (Frame Valid) via software?

          In order to debug I would like to know if there is any data coming on the MIPI CSI-2 interface. I know that the GPIF State Machine is stuck in state 2 (Wait for Frame Valid) and that glDMATxCount is always 0.

          >> You could count how many times the state machines jumps to 3 from 2. BaiduShurufa_2018-10-19_13-12-30.bmp

          • 2. Re: CX3 - Debug MIPI CSI-2 Interface
            steffen.kutz_3708171

            Thank you very much for your fast reply!

            The state of the state machine seems to always stay at 2.

            I was probing PCLK, HSYNC and VSYNC.

            PCLK is 72MHz as expected, but HSYNC and VSYNC are low all the time. What does this mean?

            • 3. Re: CX3 - Debug MIPI CSI-2 Interface
              yyca

              Hi Steffen,

               

              That means the MIPI bridge inside of CX3 could not extract the correct H_sync and V_sync signals from MIPI input. The reasons could vary from many casues.

              1. Please confirm the image sensor is initialized corrctly.

              2. Please confirm that all the configuration bytes written to image sensor are correct and valid. Try to read them back after writting and check if they are the same.

              3. Please confirm with the sensor vendor that all the MIPI CSI inputs parameters are correct. This tool will check the MIPI interface configuration values according to these values.

              4. Suppose that all the parameters are correct. Please try to configure the MIPI PHY dealy time using API CyU3PMipicsiSetPhyTimeDelay();

              status = CyU3PMipicsiSetIntfParams (&AR0521_RAW8_2600P_4lane, CyFalse);
              if (status != CY_U3P_SUCCESS)
              {
                   CyU3PDebugPrint (4, "\n\rUSBStpCB:SetIntfParams SS1 Err = 0x%x", status);
              }
              status =  CyU3PMipicsiSetPhyTimeDelay(1,0x12);
              CyU3PDebugPrint (4, "\n\r Mipicsi Set PHY Delay status = 0x%x",status);
              
              

              0x12(in your configuration tool) means 18 in decimal format.

              5. Is the sensor operating in continuous clock mode? If yes, please try changing it to gated clock and repeat the test.

              • 4. Re: CX3 - Debug MIPI CSI-2 Interface
                steffen.kutz_3708171

                Hi,

                 

                I tried 4., but then the PCLK is at 1kHz. This can not be correct I guess?

                • 5. Re: CX3 - Debug MIPI CSI-2 Interface
                  yyca

                  Yes, it is incorrect. It should be 72MHz as expected.