1 Reply Latest reply on Apr 29, 2019 3:27 AM by KandlaguntaR_36

    How to get a stable UVC code for CX3 chip?

    dawa_2529456

      Dear Sir,

       

      Can Cypress provide a authorized , stable version for CX3? I download several demo codes from cypress , As0260, Ov5640 and balabala..., and I also create a new project in EZsuite which can generate all necessary .c file automatically, you only need customize sensor init file.

       

      There are so many different source code between them,specifically in USBEventCB(),  although all of them can show image video, but it seems there are more different stability.

       

      Please see one section code from AS0260 code. as same in DEMO code which EZsuite generate.

       

      /* This is the Callback function to handle the USB Events */

      static void

      CyCx3UvcAppUSBEventCB (

              CyU3PUsbEventType_t evtype,     /* Event type */

              uint16_t            evdata      /* Event data */

              )

      {

          uint8_t interface = 0, altSetting = 0;

       

       

          switch (evtype)

          {

              case CY_U3P_USB_EVENT_SUSPEND:

                  /* Suspend the device with Wake On Bus Activity set */

                  glIsStreamingStarted = CyFalse;

                  CyU3PEventSet (&glCx3Event, CX3_USB_SUSP_EVENT_FLAG, CYU3P_EVENT_OR);

                  break;

       

       

              case CY_U3P_USB_EVENT_SETINTF:

                  /* Start the video streamer application if the

                   * interface requested was 1. If not, stop the

                   * streamer. */

                  interface = CY_U3P_GET_MSB(evdata);

                  altSetting = CY_U3P_GET_LSB(evdata);

                 

                  /* Make sure that the endpoint toggles/sequence numbers are cleared. */

                  glIsClearFeature = CyTrue;

                 

      #if CX3_DEBUG_ENABLED

                  CyU3PDebugPrint(4,"\n\rUsbCB: IF = %d, ALT = %d", interface, altSetting);

      #endif

                  glIsStreamingStarted = CyFalse;

                  if ((altSetting == CX3_UVC_STREAM_INTERFACE) && (interface == 1))

                  {

                      /* Stop the application before re-starting. */

                      if (glIsApplnActive)

                      {

      #if CX3_DEBUG_ENABLED

                          CyU3PDebugPrint (4, "\n\rUsbCB:Call AppStop");

      #endif

                          CyCx3UvcAppStop ();

                      }

                      CyCx3UvcAppStart ();

                      break;

                  }

       

      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

      An other version, CyCx3UvcAppStart () is in the bracket pair, in fact, it is more stable than DEMO code.

       

       

                      if (glIsApplnActive)

                      {

      #if CX3_DEBUG_ENABLED

                          CyU3PDebugPrint (4, "\n\rUsbCB:Call AppStop");

      #endif

                          CyCx3UvcAppStop ();

                          CyCx3UvcAppStart ();

                      }

                      break;

                  }

       

      I am very confused that which version is more stable. so Can cypress provide an authorized, proven stable version of CX3 platform?

       

      Thanks.