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

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

cross mob
SaLa_1789541
Level 3
Level 3
5 likes given First like given

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

0 Likes
1 Solution

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

View solution in original post

3 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

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

0 Likes

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

            }

0 Likes

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