10 Replies Latest reply on May 12, 2019 11:07 PM by HemanthR_06

    ECP5 VIP with Cypress FX3 Help

    OfOr_1738446

      Hello all,

       

      I got the ECP5 VIP EVK that includes Cypress CYUSB3014 FX3 USB3.

       

      The default firmware for the CYUSB3014 is pre-loaded and it works with the demo config of Latice.

       

      I want to change the image resolution of the demo and I was able to do it for the FPGA side but not for the Cypress side.

       

      I got the  UVC_AN75779 project but I don't know how to change the frame size in it.

       

      Does anyone has the source files of the ECP5 VIP Cypress demo? and how do I change the frame size?

       

      Thanks,

      Ofer.

        • 1. Re: ECP5 VIP with Cypress FX3 Help
          HemanthR_06

          Hi,

           

          If the FX3 firmware used in your product is based on AN75779, then you would have to make the changes in the following places to support new resolution:

          In /* Class specific Uncompressed VS format descriptor */

          The field '/* number of frame descriptor followed */' should be changed to number of resolution for this format you support.

          Then following the '/* Class specific Uncompressed VS Frame descriptor */' which is already present, you can add one more and fill the fields according to your new resolution.

          Then you need to add one more glProbeControl structure for the new resolution and change UVC Requests Probe Control/Commit Control - handling.

           

          It would be helpful to you if you refer to Cx3UvcOV5640 example in the FX3 SDK to take a look at how to handle multiple resolutions. (You can leave out the CX3 device specific/Sensor specific code and just take a look at UVC Request Handling)

           

          Regards,

          Hemanth

          1 of 1 people found this helpful
          • 2. Re: ECP5 VIP with Cypress FX3 Help
            OfOr_1738446

            Hi Hemanth and thank you for your replay.

             

            I don't need to add a resolution but to change the current 1280x720 16bit to 1920x1080 32bit.

             

            Every change I try to make doesn't work (any uvc player don't show anything)

            • 3. Re: ECP5 VIP with Cypress FX3 Help
              OfOr_1738446

              I made the following changes:

              1. in GPIF:

                   a. change to 32 bit.

                   b. removed the Reset pin.

                   c. changed: LD_DATA_COUNT and LD_ADDR_COUNT to 4091.

                  

                   Build it and copied the h file to my project.

               

              2. In Eclipse:

                   a. file cyfxuvcdsr.c:

                        0x20,                           /* Number of bits per pixel */

                        .

                        .

                        .

                        .

                        0x1E,                           /* Descriptor size */

                      0x24,                           /* Descriptor type*/

                      0x05,                           /* Subtype: uncompressed frame I/F */

                      0x01,                           /* Frame Descriptor Index */

                      0x01,                           /* Still image capture method 1 supported */

                      0x80, 0x07,                     /* Width in pixel */

                      0x38, 0x04,                     /* Height in pixel */

                      0x00,0xEA,0x32,0x63,            /* Min bit rate bits/s. */

                      0x00,0xEA,0x32,0x63,            /* Max bit rate bits/s. */

                      0x00, 0x81, 0x7C, 0x00,             /* Maximum video or still frame size in bytes(Deprecated)*/

                      0x0A, 0x8B, 0x02, 0x00,             // Default frame interval (in 100ns units): (1/60)x10^7

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

                      0x0A, 0x8B, 0x02, 0x00,             // Frame interval 3: Same as Default frame interval

               

                   b. file uvc.c:

                        uint8_t glProbeCtrl[CY_FX_UVC_MAX_PROBE_SETTING] = {

                       0x00, 0x00,                 /* bmHint : no hit */

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

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

                       0x0A, 0x8B, 0x02, 0x00,     /* Desired frame interval in the unit of 100ns: 30 fps */

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

                                                      to video streaming with adjustable compression parameters */

                       0x00, 0x00,                 /* PFrame rate in PFrame / key frame units: only applicable to

                                                      video streaming with adjustable compression parameters */

                       0x00, 0x00,                 /* Compression quality control: only applicable to video streaming

                                                      with adjustable compression parameters */

                       0x00, 0x00,                 /* Window size for average bit rate: only applicable to video

                                                      streaming with adjustable compression parameters */

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

                       0x00, 0x81, 0x7C, 0x00,      /* Max video frame size in bytes */

                       0x00, 0x40, 0x00, 0x00,      /* No. of bytes device can rx in single payload = 16 KB */

               

              I build and with the USB Control Center, I uploaded it into RAM.

               

              I see the fx3 in device manager.

              I open VLC and I don't see an Image (only the VLC logo), In the codec info I see: 1920x1080 YUV2 and 60 fps.

               

              In USBlyzer I see that 16380 bytes data Success and 16384 bytes buffer.

               

              I don't know what I do wrong...

              • 4. Re: ECP5 VIP with Cypress FX3 Help
                HemanthR_06

                Hi Ofer,

                 

                I understand that you just want to change the resolution from 720p to 1080p.

                When you mentioned 1080p 32bit - you meant that FPGA is giving the image data in 32 bit parallel interface while the pixel depth is still 2 bytes/pixel. Am I correct? If yes, your maximum frame size would be 1920*1080*2bytes = 0x3F4800 (But in frame descriptor and in probe control structure you mentioned it as 0x7C8100. Can you please clarify?)

                You can also refer to Points 2, 3, 4, 5 and 11 of the UVC Troubleshooting Guide

                 

                Regards,

                Hemanth

                1 of 1 people found this helpful
                • 5. Re: ECP5 VIP with Cypress FX3 Help
                  OfOr_1738446

                  Hi Hemanth,

                   

                  You are right. I changed it to 0x3F4800 but still no image.

                   

                  I see in the USBlyzer tool that I get almost all headers with 0C 8C and only a few 0C 8D (maybe 5 or less)

                   

                  I think this is the problem. Do you know why this happens?.

                   

                  BTW, When I use an .img file i got from Lattice ECP5 EVK it all works.

                  • 6. Re: ECP5 VIP with Cypress FX3 Help
                    OfOr_1738446

                    I made so many changes I don't know what is up down left right.......

                     

                    I think I tried every possible combination....

                    • 7. Re: ECP5 VIP with Cypress FX3 Help
                      HemanthR_06

                      Hi Ofer,

                       

                      Are you sure that the default FX3 firmware which works is AN75779 based?

                      If yes, can you share the project which you have modified so that we can have a look?

                       

                      Regards,

                      Hemanth

                      • 8. Re: ECP5 VIP with Cypress FX3 Help
                        OfOr_1738446

                        The img file that works is called UVC_AN75779_1080p60.

                         

                        I only have the img file that I got from Lattice with the Evk.

                        • 9. Re: ECP5 VIP with Cypress FX3 Help
                          OfOr_1738446

                          I was able to use the UART debug interface and I keep getting:

                           

                          Application Stopped

                          Application Stated

                          UVC: Completed 0 frames and 0 buffers

                          DMA Reset Event: Commit buffer failure

                           

                          ?

                          • 10. Re: ECP5 VIP with Cypress FX3 Help
                            HemanthR_06

                            Hi Ofer,

                             

                            What are the Hactive, HBlanking, VActive and VBlanking timings?

                            Commit Buffer failure tells that the DMA buffers are getting filled quickly. So you can try increasing the HActive time.

                             

                            Regards,

                            Hemanth