13 Replies Latest reply on Nov 4, 2019 7:41 PM by JayakrishnaT_76

    How to configure CYUSB3065 PCLK_TEST pin output clock?

    jawu_4351971

      as the title

      and my configure is

      CyU3PMipicsiCfg_t OV9282_Resolution0 =
      {
      #if (USING_FROMAT_RAW10 == 1)
          CY_U3P_CSI_DF_RAW10,
      #else
          CY_U3P_CSI_DF_YUV422_8_2,    /* CyU3PMipicsiDataFormat_t dataFormat */
      #endif
          4,                           /* uint8_t numDataLanes */
          2,                             /* uint8_t pllPrd */
          89,                             /* uint16_t pllFbd */  //PLL_CLK = REFCLK * [(PLL_FBD + 1) / (PLL_PRD + 1) ] / (2^ PLL_FRS)
          CY_U3P_CSI_PLL_FRS_250_500M, /* CyU3PMipicsiPllClkFrs_t pllFrs */  
          CY_U3P_CSI_PLL_CLK_DIV_4,     /* CyU3PMipicsiPllClkDiv_t csiRxClkDiv */
          CY_U3P_CSI_PLL_CLK_DIV_4,     /* CyU3PMipicsiPllClkDiv_t parClkDiv */
          0,                             /* uint16_t mClkCtl */
          CY_U3P_CSI_PLL_CLK_DIV_2,     /* CyU3PMipicsiPllClkDiv_t mClkRefDiv */
          640,                         /* uint16_t hResolution */
          50                             /* uint16_t fifoDelay */
      };
      
      
       CyU3PMipicsiSetIntfParams (&OV9282_Resolution0, CyTrue);
      
        • 1. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
          JayakrishnaT_76

          Hello,

           

          PCLK_test pin is used to test the PCLK issued by the MIPI Receiver. You can configure PCLK by using the MIPI configuration Utility.

           

          The following fig shows a sample configuration which is set by making use of the utility for OV5640. The details of each fields are obtained from the sensor datasheet.

           

           

          The tool will automatically set the MIPI receiver configurations from the data provided above. The MIPI receiver configurations generated by the tool is shown below.

           

           

          Please ensure that the utility do not show up any errors while configuring the MIPI Receiver. The errors will be shown as red boxes or cross marks. Adjust each fields so that it falls in the given range.

           

          Please refer to the section 4.4 of the document  EzUsbSuite_UG to learn more about using the configuration utility. This can be found in the following location.

          C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\doc\firmware.

           

          Best Regards,

          Jayakrishna

          • 2. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
            jawu_4351971

            thanks for reply,I have find the problem,CyU3PMipicsiSetIntfParams(&Clover_OV9282_Resolution0, CyTrue);the second parameter set to true,it will produce PCLK immediately.

            But now new quwstion,the callback of  CyCx3GpifEventCB can't be execute,and I check the state of GPIF is always 1.

            I used an oscilloscope to look at the camera and found a data output.

             

            HSYNC and VSYNC is no data.

             

            Can you give me some advice on how to proceed to solve this problem?

            Thank you

            • 3. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
              JayakrishnaT_76

              Hello,

               

              I find that you set CyU3PMipicsiSetIntfParams(&Clover_OV9282_Resolution0, CyTrue); as true at the beginning itself. The second parameter  just tells when the interface clock needs to be turned ON. If it is CyTrue, then the interface clock will be turned ON after the configuration of MIPI-CSI interface. If it is CyFalse, the interface clock needs to be turned ON by using CyU3PMipicsiWakeup() API. This is actually done after CyCx3UvcAppImageSensorSetVideoResolution() is called. So it will not make any difference.

               

              The CyCx3AppGpifCB is called when the FV triggers GPIF interrupts. It is not called because HSYNC and VSYNC do not have any data in your case. This occurs because there is some problem with your MIPI receiver configuration. So can you please share a screenshot of your MIPI Receiver Configuration (as shown in the configuration utility) and the UART debug messages?

               

              Best Regards,

              Jayakrishna

              • 4. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                jawu_4351971

                After I modify camera and combiner configure,GPIF callback can come in.But new problem come.

                1.if I config CyU3PMipicsiSetIntfParams second parameter to CyFalse,and call CyU3PMipicsiWakeup in CyCx3UvcAppImageSensorSetVideoResolution(),but the clock does not turned on.

                2.if I config CyU3PMipicsiSetIntfParams second parameter to CyTrue,and in CyCx3UvcAppImageSensorSetVideoResolution() to modify the resolution by the api of CyU3PMipicsiSetIntfParams , the clcok will turn off,and can not turn on by CyU3PMipicsiWakeup ,and the api CyU3PMipicsiGetErrors can get errors.

                 

                • 5. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                  JayakrishnaT_76

                  Hello,

                   

                  Please go through the following comments:

                  1. If you call CyU3PMipicsiSetIntfParams with second parameter set to CyFalse, then the interface clock will not be turned on soon after the configuration is complete. But this is turned on in CyCx3AppStart();. This function is called after CyCx3AppImageSensorSetVideoResolution is called. So there is no need to turn the interface clock ON in CyCx3AppImageSensorSetVideoResolution.

                  2. If you call CyU3PMipicsiSetIntfParams with second parameter set to CyTrue, then the interface clock will be turned ON soon after the configuration is complete. This is done in the API itself.

                   

                  Can you please share us the complete project?

                   

                  Best Regards,

                  Jayakrishna

                  • 6. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                    jawu_4351971

                    Hi the attachment is my project.

                    1.the question I ask in CyU3PDebugPrint print format is error ,is also exist; I  have called CyU3PDebugPreamble to set sendPreamble =CyFalse,but the error format is also exist

                    2.the more important question mention in https://community.cypress.com/thread/49916

                    the Dma data commit to UVC about 6 times, it will stop, if I use potlayer to open it again, and it will go on send 6 times and stop.

                    Please help me, thank you!

                    • 7. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                      JayakrishnaT_76

                      Hello,

                       

                      Please find my comments below:

                      1. I find that the format that was printed is same as the format that you used in CyU3PDebugPrint();. Please refer to the following KBA to understand the solution for the format error if it occurs.

                      Use of CyU3PDebugPreamble() API – KBA227492

                      2. Can you please share the Debug prints. This can be used for better understanding of your problem and helps us to debug the issue quickly.

                       

                      Best Regards,

                      Jayakrishna

                      • 8. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                        jawu_4351971

                        1. I don't understand the problem of print format error,does the problem has the relation with the KBA you give?

                        • 9. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                          JayakrishnaT_76

                          Hello,

                           

                          Can you please let us know what is the print format that you were referring to in this thread?

                          CyU3PDebugPrint print format is error

                          I find that the print is obtained in the same format as you have mentioned in the CyU3PDebugPrint API. Can you please let us know the error that you get.

                           

                          Best Regards,

                          Jayakrishna

                          • 10. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                            jawu_4351971

                            you can see the log, in https://community.cypress.com/thread/49915

                            mdlErrCnt=4003D50C,ctlErrCnt=4000794C,eidErrCnt=4000A778 is error, the print may be is the variable address,not the real value.

                            frmErrCnt=0,crcErrCnt=0,recrErrCnt=0,unrcErrCnt=0,recSyncErrCnt=0,unrSyncErrCnt=0 is always 0,but in fact some of these is not 0.

                             

                             

                             

                             

                            • 11. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                              JayakrishnaT_76

                              Hello,

                               

                              CyU3PMipicsiGetErrors is used to get a count of CSI protocol and physical layer errors from the MIPI-CSI block. The error counts for each error type is retrieved via a pointer of type  CyU3PMipicsiErrorCounts_t passed to this function. In your case, mdlErrCnt, ctlErrCnt and eidErrCnt have got a count associated with them. So these are the MIPI errors that have occurred.

                              Please try the following and tell the result:

                              1.Please check your MIPI receiver configuration and sensor configurations match correctly?

                              2.Please try adding CyU3PMipicsiSetPhyTimeDelay() just after you call CyU3PMipicsiSetIntfParams. CyU3PMipicsiSetPhyTimeDelay() makes use of 2 parameters. Please set the first parameter as 1 and the second parameter with the PHY time delay value given by the tool. In your case, this will be CyU3PMipicsiSetPhyTimeDelay(1,0x10 ); . We have found that when some sensors are used, CyU3PMipicsiSetPhyTimeDelay need to be used for streaming the video properly. But for some sensors, it is not required.

                               

                              Also can you please probe Hsync, Vsync and Pclk and share it with us?

                               

                              Best Regards,

                              Jayakrishna

                              • 12. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                                jawu_4351971

                                my question is print format error!!!

                                • 13. Re: How to configure CYUSB3065 PCLK_TEST pin output clock?
                                  JayakrishnaT_76

                                  Hello,

                                   

                                  Can you please change the DebugPrint statement to that shown below and tell the results?

                                  CyU3PDebugPrint(4,"\n\rMipi Errors: %d %d %d %d %d %d %d %d %d",errCnts.crcErrCnt,errCnts.ctlErrCnt, errCnts.eidErrCnt, errCnts.frmErrCnt, errCnts.mdlErrCnt, errCnts.recSyncErrCnt, errCnts.recrErrCnt, errCnts.unrSyncErrCnt, errCnts.unrcErrCnt );

                                   

                                  Best Regards,

                                  Jayakrishna