3 Replies Latest reply on Aug 31, 2018 3:51 AM by srnt

    If gpif machine is going to invalid state how to prevent that, and how to return it back to normal state?

    lakhani.sagar_1789541

      Hello Everyone,

      I have created a state machine which is going to invalid state, but i haven't found why it is happening. Can you please tell me how to prevent from going to invalid state and if invalid state is achieved then how to return it to normal state?

      Thanks

      LD_DATA_COUNT is 8183

      DE signal is data enable signal

      Bus width is 16 bit

      Buffer size is 16KB

      New_State_Machine.PNG

        • 1. Re: If gpif machine is going to invalid state how to prevent that, and how to return it back to normal state?
          srnt

          Hello,

           

          How do you identify the state machine goes into an invalid state? In case you are using CyU3PGpifGetSMState() API, kindly, post the code snippet.

           

          Best regards,

          Srinath S

          • 2. Re: If gpif machine is going to invalid state how to prevent that, and how to return it back to normal state?
            lakhani.sagar_1789541

            status = CyU3PDmaMultiChannelGetBuffer (chHandle, &dmaBuffer, CYU3P_NO_WAIT);

                    while (status == CY_U3P_SUCCESS)

                    {

                        /* Add Headers*/

                        if (dmaBuffer.count == CY_FX_UVC_BUF_FULL_SIZE)

                        {

                            CyU3PDebugPrint (4, "DMA full Buffer Count: %d\r\n", dmaBuffer.count);

                            stat=CyU3PGpifGetSMState(j);

                            CyU3PDebugPrint (4, "Stat: %d, Current State: %d\r\n", stat, j);

                            /* A full buffer indicates there is more data to go in this video frame. */

                            CyFxUVCAddHeader (dmaBuffer.buffer - CY_FX_UVC_MAX_HEADER, CY_FX_UVC_HEADER_FRAME);

                        }

                        else

                        {

                            CyU3PDebugPrint (4, "DMA partial Buffer Count: %d\r\n", dmaBuffer.count);

                            stat=CyU3PGpifGetSMState(j);

                            CyU3PDebugPrint (4, "Stat: %d, Current State: %d\r\n", stat, j);

                            /* A partially filled buffer indicates the end of the ongoing video frame. */

                            CyFxUVCAddHeader (dmaBuffer.buffer - CY_FX_UVC_MAX_HEADER, CY_FX_UVC_HEADER_EOF);

             

            #ifdef DEBUG_PRINT_FRAME_COUNT

                            glFrameCount++;

                            glDmaDone = 0;

            #endif

                        }

            • 3. Re: If gpif machine is going to invalid state how to prevent that, and how to return it back to normal state?
              srnt

              Hello Sagar,

               

              Please note that the CyU3PGpifGetSMState() API's parameter is a pointer variable. Hence, it has to be passed with an address value and not the variable directly. Please modify the statement as below.

              stat = CyU3PGpifGetSMState(&j);

               

              Best regards,

              Srinath S

              1 of 1 people found this helpful