8 Replies Latest reply on Sep 18, 2018 11:58 PM by vladimirostu_2251656

    I still can not set the resolution of 1280x960 and 5 mp for USB2

    vladimirostu_2251656

      Hello.

      I have a Denebola dev board.

      I try set resolutions 1280x960 and 2592x1944 and not success...

      Very difficult...

       

      I try, try, try...

       

      Please help me...

      I use Cypress EZ USB suite, but MIPI configurator not easy for me...

       

      I have NDA with Omnivision...

      Don't understand.

       

       

      My descriptors for USB2:

       

       

       

          // Class specific Uncompressed VS frame descriptor 2 - 2592x1944 @ 1fps

          0x1E,                               // Descriptor size

          CX3_CS_INTRFC_DESCR,                // Descriptor type

          0x05,                               // Subtype: Uncompressed frame interface

          HS_RES_1944,                        // Frame Descriptor Index: 1

          0x00,                               // No Still image capture method supported

          0x20, 0x0A,                         // Width in pixel:  2592

          0x98, 0x07,                         // Height in pixel: 1944

          0x00, 0x30, 0xCE, 0x04,             // Min bit rate (bits/s): 2592 x 1944 x 2 x 1 x 8 = 80621568 = 0x04CE3000

          0x00, 0x30, 0xCE, 0x04,             // Max bit rate (bits/s): Fixed rate so same as Min

          0x00, 0xC6, 0x99, 0x00,             // Maximum video or still frame size in bytes(Deprecated): 2592 x 1944 x 2

          0x80, 0x96, 0x98, 0x00,             // Default frame interval (in 100ns units): 10000000 ( 1 fps )

          0x01,                               // Frame interval type : No of discrete intervals

          0x80, 0x96, 0x98, 0x00,             // Frame interval 1: Same as Default frame interval

       

       

       

       

       

       

          // Class specific Uncompressed VS frame descriptor 1 - 1280x960 @ 5 fps

          0x1E,                               // Descriptor size

          CX3_CS_INTRFC_DESCR,                // Descriptor type

          0x05,                               // Subtype: Uncompressed frame interface

          HS_RES_640,                         // Frame Descriptor Index: 2

          0x00,                               // No Still image capture method supported

          0x80, 0x02,                         // Width in pixel:  1280

          0xE0, 0x01,                         // Height in pixel: 960

          0x00, 0x00, 0xDC, 0x05,             // Min bit rate (bits/s): 1280 x 960 x 2 x 5 x 8 = 98304000 = 0x05DC0000

          0x00, 0x00, 0xDC, 0x05,             // Max bit rate (bits/s): Fixed rate so same as Min

          0x00, 0x80, 0x25, 0x00,             // Maximum video or still frame size in bytes(Deprecated): 1280 x 960 x 2 =

          0x80, 0x84, 0x1E, 0x00,             // Default frame interval (in 100ns units): 2000000 ( 5 fps ).

          0x01,                               // Frame interval type : No of discrete intervals

          0x80, 0x84, 0x1E, 0x00,             // Frame interval 3: Same as Default frame interval

       

       

       

      What MIPI are nedeed?

        • 1. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
          vladimirostu_2251656

          My probes:

           

           

           

           

           

           

          /* UVC Probe Control Setting - 960p @5fps*/

          uint8_t const gl960pProbeCtrl_HS[CX3_APP_MAX_PROBE_SETTING] = {

              0x00, 0x00,                        /* bmHint : No fixed parameters */

              0x01,                              /* Use 1st Video format index */

              HS_RES_1920,                                /* Use 2nd Video frame index */

              0x80, 0x84, 0x1E, 0x00,            /* Desired frame interval in 100ns = (1/5)x10^7*/

              0x00, 0x00,                        /* Key frame rate in key frame/video frame units */

              0x00, 0x00,                        /* PFrame rate in PFrame / key frame units */

              0x00, 0x00,                        /* Compression quality control */

              0x00, 0x00,                        /* Window size for average bit rate */

              0x00, 0x00,                        /* Internal video streaming i/f latency in ms */

              0x00, 0x80, 0x25, 0x00,            /* Max video frame size in bytes: 960 x 1280 x 2*/

          #ifdef CX3_UVC_1_0_SUPPORT

              0x00, 0x90, 0x00, 0x00              /* No. of bytes device can rx in single payload: 36KB */

          #else

              /* UVC 1.1 Probe Control has additional fields from UVC 1.0 */

              0x00, 0x90, 0x00, 0x00,            /* No. of bytes device can rx in single payload: 36KB */

              0x00, 0x60, 0xE3, 0x16,            /* Device Clock */

              0x00,                              /* Framing Information - Ignored for uncompressed format*/

              0x00,                              /* Preferred payload format version */

              0x00,                              /* Minimum payload format version */

              0x00                                /* Maximum payload format version */

          #endif

          };

           

           

           

           

          /* UVC Probe Control Setting - 5Mp @1fps*/

          uint8_t const gl5MpProbeCtrl_HS[CX3_APP_MAX_PROBE_SETTING] = {

              0x00, 0x00,                        /* bmHint : No fixed parameters */

              0x01,                              /* Use 1st Video format index */

              HS_RES_1944,                              /* Use 2nd Video frame index */

              0x80, 0x96, 0x98, 0x00,            /* Desired frame interval in 100ns = (1/1)x10^7*/

              0x00, 0x00,                        /* Key frame rate in key frame/video frame units */

              0x00, 0x00,                        /* PFrame rate in PFrame / key frame units */

              0x00, 0x00,                        /* Compression quality control */

              0x00, 0x00,                        /* Window size for average bit rate */

              0x00, 0x00,                        /* Internal video streaming i/f latency in ms */

              0x00, 0xC6, 0x99, 0x00,            /* Max video frame size in bytes: 2592 x 1944 x 2 = 10077696 */

          #ifdef CX3_UVC_1_0_SUPPORT

              0x00, 0x90, 0x00, 0x00              /* No. of bytes device can rx in single payload: 36KB */

          #else

              /* UVC 1.1 Probe Control has additional fields from UVC 1.0 */

              0x00, 0x90, 0x00, 0x00,            /* No. of bytes device can rx in single payload: 36KB */

              0x00, 0x60, 0xE3, 0x16,            /* Device Clock */

              0x00,                              /* Framing Information - Ignored for uncompressed format*/

              0x00,                              /* Preferred payload format version */

              0x00,                              /* Minimum payload format version */

              0x00                                /* Maximum payload format version */

          #endif

          };

          • 3. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
            srdr

            Please ensure whether the following settings are correct in your case.

            UVC descriptors

            Probe Control Structure

            GPIF II configuration

            MIPI CSI-2 configuration

            Sensor Configuration

             

            If the sensor and MIPI CSI-2 configuration are correct, you would see VSYNC and HSYNC waveforms correctly. Is this happening in your case?

             

            Please let us know where is going wrong.

             

             

            Regarding UVC descriptors -

            Uncompressed Frame and format descriptors.

                      In the above, 1280 x 960 frame descriptor,

             

            // Class specific Uncompressed VS frame descriptor 1 - 1280x960 @ 5 fps

                0x1E,                               // Descriptor size

                CX3_CS_INTRFC_DESCR,                // Descriptor type

                0x05,                               // Subtype: Uncompressed frame interface

                HS_RES_640,                         // Frame Descriptor Index: 2  - IS THIS CORRECT?

                0x00,                               // No Still image capture method supported

                0x80, 0x02,                         // Width in pixel:  1280 - WIDTH is INCORRECT

                0xE0, 0x01,                         // Height in pixel: 960 - HEIGHT is INCORRECT

                0x00, 0x00, 0xDC, 0x05,             // Min bit rate (bits/s): 1280 x 960 x 2 x 5 x 8 = 98304000 = 0x05DC0000

                0x00, 0x00, 0xDC, 0x05,             // Max bit rate (bits/s): Fixed rate so same as Min

                0x00, 0x80, 0x25, 0x00,             // Maximum video or still frame size in bytes(Deprecated): 1280 x 960 x 2 =

                0x80, 0x84, 0x1E, 0x00,             // Default frame interval (in 100ns units): 2000000 ( 5 fps ).

                0x01,                               // Frame interval type : No of discrete intervals

                0x80, 0x84, 0x1E, 0x00,             // Frame interval 3: Same as Default frame interval

             

            Similarly in Probe control Structure of 1280 x 960.

             

            HS_RES_1920 ??

             

            The descriptor and probe structure of 5M resolution are correct.

            • 4. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
              vladimirostu_2251656

              HS_RES_1920 ??

              It is index

               

               

              typedef enum
              {
              HS_RES_START,
              HS_RES_640,
              HS_RES_1920,
              HS_RES_1944,
              } EResolsHS;
              
              

               

               

                   I wrote "how use GPIF II..", but may be, it very difficult for me...

               

              Now I try code...

               

              Many Thanks.

              • 5. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
                srdr

                Since GPIF II in CX3 work in fixed mode, you do not need to write it here.

                 

                The reason behind mentioning the GPIF II above is as follows.

                Sometimes we might have configured GPIF II to 16-bit mode initially.

                If any resolution needs 24-bit data bus, we need to set it to 24-bit using the same API CyU3PMipicsiGpifLoad(CY_U3P_MIPICSI_BUS_24, CX3_APP_DATA_BUF_SIZE) in CyCx3AppImageSensorSetVideoResolution function.

                • 6. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
                  vladimirostu_2251656

                  Tell me please, you can show here the settings for the mipi for modes 1280 * 960 5 fps and 2592 * 1944 1 fps.

                  I tried to run the MIPI configurator, but unfortunately, I could not configure it ...

                   

                  Many thanks.

                   

                  My MIPI settings:

                   

                  for 5Mp  @ 1 fps :

                   

                  CyU3PMipicsiCfg_t mipiCfg_5Mp_1 =
                  {
                      CY_U3P_CSI_DF_YUV422_8_2,
                      2,
                      1,
                      64,
                      CY_U3P_CSI_PLL_FRS_63_125M,
                      CY_U3P_CSI_PLL_CLK_DIV_8,
                      CY_U3P_CSI_PLL_CLK_DIV_8,
                      0,
                      CY_U3P_CSI_PLL_CLK_DIV_2,
                      2592,
                      0x01
                  };
                  

                   

                   

                  for 1280 x 960 @ 5 fps :

                   

                  CyU3PMipicsiCfg_t mipiCfg_960p5 =
                  {
                  CY_U3P_CSI_DF_YUV422_8_2,       // dataFormat
                  2,                            // numDataLanes
                  0x1,                          // pllPrd
                  90,                            // pllFbd
                  // CY_U3P_CSI_PLL_FRS_125_250M,    // pllFrs
                      CY_U3P_CSI_PLL_FRS_63_125M,
                  CY_U3P_CSI_PLL_CLK_DIV_2,     // csiRxClkDiv
                  CY_U3P_CSI_PLL_CLK_DIV_8,     // parClkDiv
                  0x00,                         // mclkCtl
                  CY_U3P_CSI_PLL_CLK_DIV_8,     // mClkRefDiv
                  1280,                          // hResolution
                  0x01                          // fifoDelay
                  };
                  
                  

                   

                   

                  It's right ?

                  • 7. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
                    srdr

                    Please provide the following details for both the resolutions to cross check the above MIPI configurations of both.

                     

                    1. CSI clock

                    2. Data Lane

                    3. THS Prepare

                    4. THS Zero

                    5. Frame Rate

                    6.  H Active

                    7. H Blanking

                    8. V Active

                    9. V Blanking

                    10. Data Format

                    • 8. Re: I still can not set the resolution of 1280x960 and 5 mp for USB2
                      vladimirostu_2251656

                      Yes, thank you very much.

                      The problem is probably in the sensor settings.

                      The question is in the sensor settings.