- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, i can't get the CY_U3P_DMA_CB_CONS_EVENT working on a P2U or U2U channel's callback, we have a new board which has a P2U channel, all data received (by host vis USB) correctly, the callback gets the PROD_EVENT as expected, but not the CONS_EVENT... i'm using the
dmaCfg.notification = (CY_U3P_DMA_CB_PROD_EVENT|CY_U3P_DMA_CB_CONS_EVENT);
for the callback notification type.
And i test on the DVK with the USBBulkLoopAutoSignal sample code (and the "BulkLoop.exe" on host), it has an auto-signal U2U channel, and it had the same result.
The modifications i made on the sample code are:
*. When create the channel , i use
dmaCfg.notification = (CY_U3P_DMA_CB_PROD_EVENT|CY_U3P_DMA_CB_CONS_EVENT);
*. In the Channel callback, i add
if (type == CY_U3P_DMA_CB_CONS_EVENT) glConsEventCount++; // glConsEventCount is initialized to 0 in startup.
*. And in the thread loop, i print the glConsEventCount as:
CyU3PDebugPrint( 6, "Data tracker: Number of buffer received: %d , %d\n", glDMARxCount, glConsEventCount );
The glConsEventCount is always ZERO when the "BulkLoop" is running and data are looped. (while the glDMARxCount is increased as expected).
I did some more tries, e.g. using CY_U3P_DMA_CB_CONS_EVENT only (no CY_U3P_DMA_CB_PROD_EVENT), OR
using CY_U3P_DMA_MODE_BUFFER instead of CY_U3P_DMA_MODE_BYTE....etc. but all had the same results.
Is there any more cofiguration needed to make the CONS_EVENT working on an Auto_Signal channel?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please have a look at the USBBulkSourceSink example code. It uses the CY_U3P_DMA_CB_CONS_EVENT.
Regards,
sai krishna.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sai,
Thanks...the USBBulkSourceSink example code works fine on my DVK, the CY_U3P_DMA_CB_CONS_EVENT generated in the callback, however, as the related channel is a MANUAL_OUT in this example code (i checked the sample codes, and it seems that this is the only major difference from the USBBulkLoopAutoSignal sample code for the DMA channel setup)... But we can only use AUTO_SIGNAL channel in our application.
Rgds!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right.
When you are using AUTO channels, data will be committed automatically.
when you are using MANUAL channels then you need to look for events in call back functions and you need to call "CyU3PDmaChannelCommitBuffer" to commit data.
Regards,
sai krishna.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sai,
Thanks...I understand that for Auto channel, the data are automatically commited...that's why we use it as manually commit a buffer takes too much time which limits the effective data bandwidth.
I re-read the docs (programming manual) and it seems that for an Auto Signaling Channel, the only event generated is the PROD_EVENT...so i guess there will be no CONS_EVENT for an Auto Signaling Channel.
Rgds!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
dmaSlFifoConfig.size = size * 16;//CY_FX_ENDPOINT_BULK_BURST;
dmaSlFifoConfig.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
dmaSlFifoConfig.prodSckId = (CyU3PDmaSocketId_t)(CY_FX_EP_PRODUCER_PPORT_SOCKET);
dmaSlFifoConfig.consSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 | CY_FX_EP_CONSUMER_USB_SOCKET);
dmaSlFifoConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaSlFifoConfig.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaSlFifoConfig.cb = CyFxSlFifoPtoUDmaCallback;
//dmaSlFifoConfig.cb = NULL;
dmaSlFifoConfig.prodHeader = 0;
dmaSlFifoConfig.prodFooter = 0;
dmaSlFifoConfig.consHeader = 0;
dmaSlFifoConfig.prodAvailCount = 0;
/* Create the channel */
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
CY_U3P_DMA_TYPE_MANUAL,
&dmaSlFifoConfig);