9 Replies Latest reply on Jun 29, 2018 4:55 AM by srdr

    CX3 decoder capabilities when frame headers do  not match

    user_16672

      We would like to know behavior of cx3 when following configuration is set.

       

      The sensor outputs a stream flux over mipi interface in a raw10 format. ie data lines have a packet header of 0x2B. We set the cx3 to raw10 input and the 16 bits output. But in this configuration, each 16 bits there are 10 bits of data and 6 zeros bits. This is not very interesting in terms of data rate.

       

      Now, if we configure the mipi to a RGB888 input format and 24 bits ouput format, the data rate would be far superior. Problem is sensor outputs a raw10 format and so there are no 24h packet frame headers as expected by CX3 decoder : what is the behavior of cx3 decoder in this case ?

       

      Thank you.

        • 1. Re: CX3 decoder capabilities when frame headers do  not match
          srdr

          The packing of RAW 10 data in the 24-bit output format is done as the follows:

           

          1. The MIPI CSI2 receives the data in standard RAW 10 format as shown in the Figure. (Source: MIPI Alliance Specification for Camera Serial Interface 2 (CSI-2))

          RAW10.PNG

          b. The input serial RAW 10 data will be converted to parallel 24-bit data as follows and this will be sampled by the GPIF II. i.e. For every clock cycle, GPIF II receives 24-bit data. There is no additional padded bits in this case.

          - First clock cycle - P1[9:2], P2[9:2], P3[9:2]

          - Second clock cycle - P4[9:2], P1[1:0], P2[1:0], P3[1:0], P4[1:0], P5[9:2]

          - Third clock cycle –  and so on.

          Note that the GPIF II will be configured in 24-bit data bus format when selecting 24-bit as output data format. And the line size of the frame should be multiple of 24 bits.

          • 2. Re: CX3 decoder capabilities when frame headers do  not match
            user_16672

            This is the output of sensor.

            Ok but what is behavior of cx3 decoder when this RAW10 data are sent and configuration of  mipi in CX3 is RGB24 ? we are asking this because when RAW10 is selected, CX3 sends 16 bits on USB with 6 zeroes. This reduces drastically the bandwith.

            Best Regards,

            • 3. Re: CX3 decoder capabilities when frame headers do  not match
              user_16672

              Thank you again for this answer.

               

              In fact, we need more explaination on point b.

              This is the behavior we would have in fine !

               

              The point is the documentation tells that when RAW10 is selected as input then output is 16 bits with 6 zeroes.

               

              So the question is : what are the CX3 configuraton parameters for a gpif2/cx3 behavior as you indicate in your answer.

              we will of course use the 24 bits line size constraint in these condition.

               

              Best Regards,

              • 4. Re: CX3 decoder capabilities when frame headers do  not match
                srdr

                For example, you can set the configuration as follows:

                1. Image Sensor Configuration:

                2. CX3 MIPI Receiver Configuration

                3. Cyu3mipicsi.c provide the configuration details

                 

                i.e

                /* XYZ_Sensor_RAW10_Resolution0 :  */

                CyU3PMipicsiCfg_t XYZ_Sensor_RAW10_Resolution0 = 

                {

                    CY_U3P_CSI_DF_RGB888,  /* CyU3PMipicsiDataFormat_t dataFormat */

                    2,                          /* uint8_t numDataLanes */

                    2, /* uint8_t pllPrd */

                    89, /* uint16_t pllFbd */

                    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 */

                    1920,         /* uint16_t hResolution */

                    250                         /* uint16_t fifoDelay */

                };

                 

                Answer to your question:

                 

                1. The template project passes the above MIPI Configuration structure to  CyU3PMipicsiSetIntfParams (&XYZ_Sensor_RAW10_Resolution0, CyFalse); API to configure the MIPI in 24-bit output format.

                 

                2. Similarly, 24-bit GPIF_BUS_WIDTH will be passed to CyU3PMipicsiGpifLoad API to configure the GPIF II to 24-bit data bus

                • 5. Re: CX3 decoder capabilities when frame headers do  not match
                  user_16672

                  Hi,

                   

                  Thank you for the files and screenshots.

                  if this is working this way we are ok.

                   

                  in fact, this leads to the first question : you define the input format as CY_U3P_CSI_DF_RGB888, and for this format, the MIPI is supposed to expect 0x24 packet header frames.

                  But here, sensor will send 0x2B as packet headers frames.

                   

                  If the cx3 works with your behavior, this means with cx3 there is a "range" of packet header frames values (for example all 0x2X values) considered as the "real" sensor data.

                   

                  Would it be possible to have a confirmation for this ?

                  Thank you again,

                  Best Regards,

                  • 6. Re: CX3 decoder capabilities when frame headers do  not match
                    user_16672

                    srdr,

                    we have modified the working conditions to get a csi-clok frequency of 300 Mhz, thus 600 Mbps per lane X 4 = 2400 MBps in fine delivered at max by sensor. With blanking parameters, the bit frame size is roughly 90 Mbits/frame for a 4K frame, RAW10 data format.

                    We would like to understand why the CX3 configuration tool is not able to go above 10 fps.

                    That is only 900 Mbits/s compared to the normally reachable 2400 Mbits/s.

                    What has to be changed in configuration tool parameters to work at this data rate if possible ?

                    Thank you for your help, Best regards.

                    • 7. Re: CX3 decoder capabilities when frame headers do  not match
                      srdr

                      Hello Lebrun,

                       

                      MIPI Bridge on the CX3 does not expect any header format. It simply convert the input serial data into parallel format and send to the GPIF Block.

                       

                      Correction to your comment: I have set RGB888 as output data format NOT as input data format.

                       

                      1. Can you please explain what do you mean by packet header here? Let us know what is the sensor that you are using in the application.

                       

                      I have attached an example project with the following configuration:

                       

                      CSI Clock = 300 MHz

                      H_Active = 3840

                      H_Blank = 220 (assumed, get these details from the sensor provider)

                      V_Active = 1260

                      V_Blank = 30 (assumed, get these details from the sensor provider)

                      Frame Rate = 20

                      Input Data = RAW 10

                      Output Data = RGB888 ( Input RAW 10 will be packed into 24-bit and send to GPIF)

                       

                      The MIPI configuration for the above setting is as follows:

                       

                      /* Xyz_Leb_RAW10_Resolution0 :  */

                      CyU3PMipicsiCfg_t Xyz_Leb_RAW10_Resolution0 =

                      {

                          CY_U3P_CSI_DF_RGB888,  /* CyU3PMipicsiDataFormat_t dataFormat */

                          4,                          /* uint8_t numDataLanes */

                          1, /* uint8_t pllPrd */

                          79, /* uint16_t pllFbd */

                          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 */

                          3840,        /* uint16_t hResolution */

                          50                        /* uint16_t fifoDelay */

                      };

                       

                      Refer attached project. Ignore the errors showed at CSI clock and Output Pixel Clock.

                      • 8. Re: CX3 decoder capabilities when frame headers do  not match
                        user_16672

                        srdr,

                         

                        For me "input RGB888" was data format from sensor before sending to gpif2 , I'm ok to tell it is indeed "output" of the cx3 mipi decoder part.

                         

                        I think the misundestanding comes from what is "decoded" by CX3.

                         

                        In fact, I guess that was is decoded is FS/FE (=>frame valid) and packet headers/packet footers (=>line valid) from CSI and everything else is sent in RGB888 format to gpif2.

                         

                        so if I'm correct last question will be : are the FS/FE and packet header/packet footers (32 bits each) data sent or not ?

                         

                        Thank you for your help,

                        Best Regards.

                        • 9. Re: CX3 decoder capabilities when frame headers do  not match
                          srdr

                          Lebrun,

                           

                          The FE/FS and headers/footers are stripped off in the MIPI Bridge itself only the DATA will be remain in the buffers of MIPI CSI-2 bridge.

                          The control signals HSYNC and VSYNC and also clock will be generated by the MIPI CSI-2 bridge as per the inputs provided us. i.e MIPI CSI-2 configuration settings passed using CyU3PMipicsiSetIntfParams API.

                           

                          Therefore, the GPIF II receives the data, clock and VSYNC and HSYNC.