3 Replies Latest reply on Feb 26, 2020 1:58 AM by star_4282566

    CX3 RAW8 to 24 bit packing

      Our sensor outputs RAW8 data over 4 lane MIPI CSI-2. To achieve highest transfer rate between MIPI CSI-2 receiver and GPIF II we need to use 24-bit wide transfers, which fully utilize GPIF II input bus. According to page 9 of TRM, the only mode which fully utilizes 24-bit bus is RGB888.


      A possible solution to this issue is packing, mentioned on page 10 of TRM:

      Packing more than one pixel per PCLK is possible. For example, selecting the “MIPI CSI input -Data format"

      configured as "RAW8" and the “MIPI interface configuration – data format” as a 24bit format (RGB888) will

      output three pixel data per PCLK.

      It's unclear, however, where/how to configure the mentioned "MIPI CSI input -Data format" and "MIPI interface configuration – data format" via the CX3 API. The API has CyU3PMipicsiSetIntfParams() function, which has CyU3PMipicsiCfg_t struct parameter with CyU3PMipicsiDataFormat_t dataFormat field. This makes it possible to only configure a single format, not two different formats.


      What CX3 API can I use to configure two different formats to enable packing?


      I can think of several possibilities, but none is documented:

      Should I use CY_U3P_CSI_DF_RAW8 format in CyU3PMipicsiSetIntfParams(), but set CyU3PMipicsiGpifLoad(CY_U3P_MIPICSI_BUS_24, ...)?

      Should I do as above, but also set CX3_CONFIG_CTRL[DATA MODE] register to non-zero value? (what value?)

      Should I configure CY_U3P_CSI_DF_RGB888 format for CX3, while the sensor output is sill RAW8?


      Please, provide clear instructions.


      Thank you in advance.




        • 1. Re: CX3 RAW8 to 24 bit packing

          You can set the input format by selecting RAW8 from the drop down menu as shown above.

          To set the output format as 24bit you have to choose 24-bit from the output video format drop down list. This will change CyU3PMipicsiDataFormat_t dataFormat as CY_U3P_MIPICSI_BUS_24 .

          On other words, CyU3PMipicsiDataFormat_t dataFormat will be changed based on the Output video format that you will choose from the drop down menu.


          In addition to this, you have to also change the GPIF II bus width to 24 bit.

          • 2. Re: CX3 RAW8 to 24 bit packing

            Thanks, Keaj!


            Your answer confirms my third guess:

            I configure CY_U3P_CSI_DF_RGB888 format for CX3, while the sensor output is sill RAW8

            It means that sensor and CX3 data formats need not be aligned. If I want to use the full bus width I configure CX3 for RGB888 and make sensor output in any format I like (as long as host software can deal with it).

            • 3. Re: CX3 RAW8 to 24 bit packing



              When selecting this configuration (CY_U3P_CSI_DF_RGB888 , RAW8) with 24bits GPIF bus, does it means that line length should be a multiple of 24 bits (3 RAW8 pixels) ?

              if not, If my sensor frame size is 320x200x8bits how much bytes will I get for each line ... 321 ?


              Thanks in advance,