This is a bit long to describe so please bear with me.
-
We have GPIF setup to 100.8 MHz. Yes, slightly faster than it is rated to go, but the top speed when using 19.2 MHz crystal seems to be either 100.8 MHz (403.2 / 4) or 89.6 MHz. We had hoped the GPIF would run 0.8% overclocked for performance reasons. This problem is reproducible on at least a couple boards at room temperature, so it doesn't seem to be related to the process limitation.s
-
We have a GPIF description that can transfer in blocks with an external "ready" signal. The block waits until "ready" is asserted, then proceeds. This continues until the entire transfer is complete.
-
Due to the presence of this ready signal, the host must check the FX3 to see if the transfer is complete when performing a "write" operation (host to FX3 to GPIF). The point is that the GPIF needs some time to flush the DMA buffer to truly complete the transfer, even though the host has sent everything via USB bulk transfers. So the host pings the FX3 using a vendor command to check the status. Both DMA completion status and GPIF state are queried.
-
We found some interesting data corruption issues when performing transfers that utilize the ready signal to slow down the transfer. It's notable that when these corruption issues exist, they are as if the DR_DATA pointer has been decreased by exactly 8 (32 bytes when performing on our 32-bit GPIF interface). At the next "block" (remember, we check the ready signal on a block-by-block basis), the DR_DATA pointer is back to where it's supposed to be. So when the corruption occurs, we are only getting bad data until the end of the block. Then everything resumes.
-
Since we're just waiting for GPIF to complete, we can put a short delay (25ms) at the host and ignore the status check. When we do this, no data corruption occurs.
-
In fact, even if we perform the status check (USB vendor request) immediately after the bulk transfer, but DO NOT CALL DmaChannelGetStatus, no corruption occurs.
-
If we set the GPIF to 89.6 MHz, no corruption occurs.
-
If we DO NOT slow the transfer using the ready signal, no corruption occurs. Presumably, this is because the transfer completes before we have the opportunity to call DmaChannelGetStatus.
-
Note that DmaChannelGetStatus returns CY_U3P_SUCCESS in all cases. We found it interesting that the API guide calls for the possibility of a ERROR_MUTEX_FAILURE because this sort of issue is often the result of a data sharing issue. Without the sources, it's impossible to check, but we suspect there may be an issue with DmaChannelGetStatus that may be corrupting data pointers mid-transfer.
-
So I should say we have TWO resolutions here:
-
1. Set the GPIF to 89.6 MHz and take the performance penalty.
-
2. DO NOT use DmaChannelGetStatus to determine the transfer completion status. This corrupts our data. We instead use only CyU3PGpifGetSMState and determine completion from that information. This works just fine and no data corruption is seen.
|