How to get a stable UVC code for CX3 chip?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dawa_2529456
Level 4
Level 4
5 sign-ins 5 solutions authored First solution authored

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.

0 Likes
1 Reply
KandlaguntaR_36
Moderator
Moderator
Moderator
25 solutions authored 10 solutions authored 5 solutions authored

Hello,

Please let me know what is the operating system (Windows / Linux / Mac) that you are using?

Can you please explain what is the fucntionality difference that you have seen with the above two variants of the code? i.e What is the unstability that you observed the first one?

0 Likes