I am using the FX3-USB3014 to capture MPEG2 TS data from LG electronics demodulator IC.
Because there is no flow control mechanism between FX3-GPIFII and demodulator output,
so I adopted the 2 thread ping-pong DMA structure and similar GPIF II state machine as explained in application note AN-75779 UVC image sensor examples.
I don't have any need to change the stream data, then I created AUTO Many-to-ONE DMA channels, and 4 buffers each thread, each buffer has 16KB(16384 bytes) size.
This is my DMA channel creation,
// Create a multi-DMA AUTO channel for the GPIF to USB transfer
CyU3PMemSet((uint8_t *)&dmaMultiConfig, 0, sizeof(dmaMultiConfig));
dmaMultiConfig.size = 16384;
dmaMultiConfig.count = 4;
dmaMultiConfig.validSckCount = 2; // Number of producer sockets
dmaMultiConfig.prodSckId = (CyU3PDmaSocketId_t)PING_PRODUCER_SOCKET;
dmaMultiConfig.prodSckId = (CyU3PDmaSocketId_t)PONG_PRODUCER_SOCKET;
dmaMultiConfig.consSckId = (CyU3PDmaSocketId_t)CONSUMER_ENDPOINT_SOCKET;
dmaMultiConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
Status = CyU3PDmaMultiChannelCreate(&glDualGPIF2USB_Handle, CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE, &dmaMultiConfig);
When I captured the packets through EP1-IN (BULK IN transfer),
there is some data loss (or 1 byte more data) around each 16KB boundary of the captured data.
Yet, this data loss result is different from which types of valid signal is coming.
As I have tested, it is depends on the signal pattern of incoming "VALID" signal.
When the signal have 188-byte-length continuous style, like Fig. 1), there is NO data loss in capturing.
On the contrary, if the valid signal pattern is changed to like Fig 2), it has 4 or 5 clocks intervals between each valid signal,
every 16KB boundary , there is some data loss (about 6-bytes) or invalid data insertion in captured data.
Except the valid signal format, all other test conditions are same .
I have no idea why the data loss result is relevant to valid signal pattern.
I tried several version of GPIF II , including almost same version of AN 75779 UVC example, but the result was same.
Always data loss was occurered in Fig. 2 case in 16KB boundary.
If I changed the DMA buffer size to 8KB, then the data loss found in 8KB boundary.
Attached is the GPIF II source which is used.
I would appreciate any help I can get, so thanks in advance.