FX3 GPIF II: Any way to complete a <16B transfer without using INTR_CPU?

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

cross mob
AnCo_4758931
Level 1
Level 1
First like received First reply posted First question asked

My understanding is that DMA buffers must be 16B-aligned (32B if data cache is enabled) and the DMA functionality will not return a buffer via CyU3PDmaChannelGetBuffer() unless the buffer is full -or- the GPIF II state machine has issued a INTR_CPU, which permits the CPU to terminate the transfer early via CyU3PDmaChannelSetWrapUp(). 

I'm working with a 8-bit synchronous data bus (FX3 on both sides, one as M and one as S) and at times need to do 4B reads/writes for short status packets.  Is there any way to accomplish this in a single function call (i.e. synchronously) without requiring INTR_CPU?  Or, barring that, can that single function spin waiting on the INTR_CPU handler to set a volatile flag indicating the transfer can be wrapped up?  I'm not sure if the GPIF event callback can preempt a thread function in the FX3 environment.

I tried to accomplish this requirement with other interfaces like CY_U3P_PIB_GPIF_INGRESS_DATA() / CY_U3P_PIB_GPIF_EGRESS_DATA() but those appear to only transfer one bus-width of data (1B in my case) and I need to move 4B in a single transfer.  I was also unable to get the CyU3PGpifWriteDataWords() / CyU3PGpifReadDataWords() interfaces to work for this, as they too seem to only move 1B successfully.  All the available examples I could find for those also only show them moving one word at a time.

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

COMMIT Action can be used in the GPIF II state when short packets are received.

As per the gpif2_user_guide, COMMIT Action commits or wraps up the buffer associated with the selected Ingress thread and socket. The buffer will be transferred to the consumer side of the pipe. Typically this is used to wrap up the buffer in between a transaction pre-maturely

As your application uses FX3 back to back (one as master and another one as a slave), please refer to section 6.3 (note section) of the AN87216 application note where it is explained how COMMIT action can be used to read short packets (on the master side). Similarly, in the Slave state machine COMMIT action can be used instead of INTR_CPU when the PKTEND signal is asserted (this shows a short packet is sent from master) but note that IN_DATA action needs to be used in the same state where the COMMIT action is added so that the ZLP is not committed.

Please let me know if more queries on this

Regards,

Rashi

Regards,
Rashi

View solution in original post

1 Reply
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

COMMIT Action can be used in the GPIF II state when short packets are received.

As per the gpif2_user_guide, COMMIT Action commits or wraps up the buffer associated with the selected Ingress thread and socket. The buffer will be transferred to the consumer side of the pipe. Typically this is used to wrap up the buffer in between a transaction pre-maturely

As your application uses FX3 back to back (one as master and another one as a slave), please refer to section 6.3 (note section) of the AN87216 application note where it is explained how COMMIT action can be used to read short packets (on the master side). Similarly, in the Slave state machine COMMIT action can be used instead of INTR_CPU when the PKTEND signal is asserted (this shows a short packet is sent from master) but note that IN_DATA action needs to be used in the same state where the COMMIT action is added so that the ZLP is not committed.

Please let me know if more queries on this

Regards,

Rashi

Regards,
Rashi