5 Replies Latest reply on Sep 24, 2020 2:01 AM by HemanthR_06

    FX3 RGB bayer RAW data Streaming Question

    gyle_4646071

      Hello. I am Lee.

       

      I want to transmit the raw data of the RGB bayer image sensor using FX3.

      For the first time, I made an FX3 test board and tested it.

       

      The test board specifications are as follows:

      1.1 FX3+ AP0101AT(onsemi ISP) + AR0132AT(onsemi Sensor)

      1.2. Data bus: 8bit GPIF (I used cyfxgpif2config.h of UVC_AN75779 as it is.)

      1.3. 1280* 960 @ 30hz, UVC(YUV422), 8bit

      1.4.  UVC Transfer (I used the example UVC_AN75779.)

              Streamer @UVC data (  refer to 'FX3 / CX3 Firmware for Streaming RAW Image Data using Cypress Driver ')

              toggled  "#define CY_DRIVER" in uvc.h

      1.5. The test board is working normally without any problems.

             I attach this program. (The sensor initialization part is erased.)

       

      And I am going to make a new board like this:

      new board specifications :

      2.1 FX3+ AR0132AT(onsemi Sensor): NO ISP

      2.2. data bus: 12bit bus (16bit GPIF)

      2.3 1280* 960 @ 30hz, RAW (RGB Bayer), 12bit

      2.4 Only RGB bayer (Sterming mode and One shot mode)

       

      I have a few questions.

       

      Q1. What is the data size (RGB bayer) of 1 frame of the new board? Is 1280*960*2 byte correct?

       

      Q2. Using the sensor's trigger mode (https://files.niemo.de/aptina_pdfs/TN_281_AR0132AT_TRIGGER_Mode_Operation.pdf)

      I want to transmit only one frame and wait (one shot mode). What should I do in this case?

       

      Q3. Is there any way to send a specific test pattern without sensor input?

      For example, can a red screen be sent even if there is no sensor operation?

       

      Q4. When changing to 8bit GPIF -> 16bit GPIF,

      Can I change the data to 16 bits and change the LD_ADDR_COUNT and LD_DATA_COUNT values to 8183?

      (LV, FV, PCLK function pins are the same.)

      Are there any other modifications in the firmware or in the GPIF II Designer tool?

       

      Q5. Cypress FX3 StramerExample Device @ USB control center

      Streaming is turned on or off via 'Zero-length data CONTROL OUT' in the req code.

      Could you ever send multiple bytes data pasted here?

      ex) 0x99 0x12 0x34

      If so, what should I process in firmware?

       

      Q6. Cypress FX3 StramerExample Device @ USB control center

      Can I receive whole 1 frame RAW data at once?

       

      Sorry for so many questions.

      I look forward to your help.

        • 1. Re: FX3 RGB bayer RAW data Streaming Question
          HemanthR_06

          Q1. What is the data size (RGB bayer) of 1 frame of the new board? Is 1280*960*2 byte correct?

          If GPIF is configured for 16 bit, and for each PCLK if only 12 bits of image data is sent, then for each pixel 4 bits are padded with zeros (if internal pull downs are enabled on these lines). In this case FX3 sends 1280 * 960 * 2 bytes to Host.

           

           

          Q2. Using the sensor's trigger mode (https://files.niemo.de/aptina_pdfs/TN_281_AR0132AT_TRIGGER_Mode_Operation.pdf)

          I want to transmit only one frame and wait (one shot mode). What should I do in this case?

          Please refer to CX3: How to capture UVC triggered still image from Windows Host Application

          and check if you this implementation works for you.

           

          Q3. Is there any way to send a specific test pattern without sensor input?

          For example, can a red screen be sent even if there is no sensor operation?

          Yes, this is possible. I think this is for debug purpose. In that case please check send pattern data in CyCx3UvcAppDmaCallback

           

          Q4. When changing to 8bit GPIF -> 16bit GPIF,

          Can I change the data to 16 bits and change the LD_ADDR_COUNT and LD_DATA_COUNT values to 8183?

          (LV, FV, PCLK function pins are the same.)

          Are there any other modifications in the firmware or in the GPIF II Designer tool?

          Yes this is correct assuming the dma buffer size is maintained as 16384 bytes (including 12 byte header and 4 byte footer). For the 4 data lines which are actually not connected to your sensor - you can leave them open and use API CyU3PGpioSetIoMode() to enable the pulldown so that zeros are sampled from these lines by GPIF.

           

          Q5. Cypress FX3 StramerExample Device @ USB control center

          Streaming is turned on or off via 'Zero-length data CONTROL OUT' in the req code.

          Could you ever send multiple bytes data pasted here?

          ex) 0x99 0x12 0x34

          If so, what should I process in firmware?

          Looking at your firmware, I think you use 0x99 as Req code with wValue as 0x0000. Instead you can use the same req code and use wValue to send the rest two bytes. In case you have more data than 2 bytes then you can use data to send field of control center and you can get the data in the firmware using API CyU3PUsbGetEP0Data() - Please refer to BulkSrcSink example of FX3 SDK: vendor command 0x80

           

          Q6. Cypress FX3 StramerExample Device @ USB control center

          Can I receive whole 1 frame RAW data at once?

          Yes you can do it (for this resolution) by entering your expected frame size in Bytes to transfer field of control center. But you have to make sure that a new frame starts coming out of FX3 after you request data from control center.

           

          Regards,

          Hemanth

          • 2. Re: FX3 RGB bayer RAW data Streaming Question
            gyle_4646071

            Hello. Sorry for the late response.

             

            I have more questions about Q6.

            I am testing the image.

            I want to receive 1 frame data as follows. One frame is 2457600 bytes (1280*960*2).

            However, the starting byte is not normal. It seems to be reading from the middle.

            Is there a way to transfer from the start of the frame when requested from PC (when Transfer Data-IN)?
            Or if you can tell me if there is any other way to do it, I'd appreciate it.

             

            11.png

            Thank you very much.

            Regards

            • 3. Re: FX3 RGB bayer RAW data Streaming Question
              HemanthR_06

              Hi,

               

              To receive exactly from the frame start, you will have to do below in the same order

              1. first issue Bulk IN request from the host using Transfer Data-IN (currently timeout for bulk read is set as 2 seconds in control center)

              2. issue vendor command to fx3. In the vendor command handler you can start video capture from sensor beginning from a frame start.

               

              If the video data is transferred from fx3 to host within 2 seconds after step1, then you can see the entire frame data from beginning.

               

              If 2 sec is not sufficient, then you will have to change the timeout value to more than 2sec in the control center source code and re-build it.

               

              Regards,

              Hemanth

              • 4. Re: FX3 RGB bayer RAW data Streaming Question
                gyle_4646071

                Thanks for the reply.
                But I am very immature.
                Could you give me a detailed example?

                 

                I uploaded my source code in the post above.


                Thank you very much.

                • 5. Re: FX3 RGB bayer RAW data Streaming Question
                  HemanthR_06

                  If 2 sec is not sufficient, then you will have to change the timeout value to more than 2sec in the control center source code and re-build it.

                  I can provide you built application which has increased timeout for bulk endpoint.

                   

                  But can you please let me know if you can start capturing a video frame by using a vendor command?

                  If you have the above application can you perform below:

                  To receive exactly from the frame start, you will have to do below in the same order

                  1. first issue Bulk IN request from the host using Transfer Data-IN (currently timeout for bulk read is set as 2 seconds in control center)

                  2. issue vendor command to fx3. In the vendor command handler you can start video capture from sensor beginning from a frame start.

                   

                  Regards,

                  Hemanth