- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi !
In the cyfxbulklpauto.c of AN87216 - Designing a GPIF II Master Interface,there is a CyU3PDmaChannelSetXfer.
In the
CyFxBulkLpApplnStart (
void)
UtoP and PtoU all been set.
But in the
CyFxBulkLpApplnUSBSetupCB (
uint32_t setupdat0, /* SETUP Data 0 */
uint32_t setupdat1 /* SETUP Data 1 */
)
why it doesn't be used to CyU3PDmaChannelSetXfer(glChHandleBulkLpPtoU,CY_FX_DMA_TX_SIZE)and CyU3PDmaChannelReset(&glChHandleBulkLpPtoU) did not be set either.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for pointing this error in this App Note Code. We will update it in next version of the App Note.
This snippet supposed to be following. We should reset the DMA Channel, Flush and RESET the endpoints based on the consumer and producer separately.
if ((bTarget == CY_U3P_USB_TARGET_ENDPT) && (bRequest == CY_U3P_USB_SC_CLEAR_FEATURE)
&& (wValue == CY_U3P_USBX_FS_EP_HALT))
{
if ((wIndex == CY_FX_EP_PRODUCER))
{
if (glIsApplnActive)
{
CyU3PUsbSetEpNak (CY_FX_EP_PRODUCER, CyTrue);
CyU3PBusyWait (125);
CyU3PDmaChannelReset (&glChHandleBulkLpUtoP);
CyU3PUsbFlushEp(CY_FX_EP_PRODUCER);
CyU3PUsbResetEp (CY_FX_EP_PRODUCER);
CyU3PDmaChannelSetXfer (&glChHandleBulkLpUtoP, CY_FX_DMA_TX_SIZE);
CyU3PUsbStall (wIndex, CyFalse, CyTrue);
CyU3PUsbSetEpNak (CY_FX_EP_PRODUCER, CyFalse);
isHandled = CyTrue;
CyU3PUsbAckSetup ();
}
}
if ((wIndex == CY_FX_EP_CONSUMER))
{
if (glIsApplnActive)
{
CyU3PUsbSetEpNak (CY_FX_EP_CONSUMER, CyTrue);
CyU3PBusyWait (125);
CyU3PDmaChannelReset (&glChHandleBulkLpPtoU);
CyU3PUsbFlushEp(CY_FX_EP_CONSUMER);
CyU3PUsbResetEp (CY_FX_EP_CONSUMER);
CyU3PDmaChannelSetXfer (&glChHandleBulkLpPtoU, CY_FX_DMA_TX_SIZE);
CyU3PUsbStall (wIndex, CyFalse, CyTrue);
CyU3PUsbSetEpNak (CY_FX_EP_CONSUMER, CyFalse);
isHandled = CyTrue;
CyU3PUsbAckSetup ();
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for pointing this error in this App Note Code. We will update it in next version of the App Note.
This snippet supposed to be following. We should reset the DMA Channel, Flush and RESET the endpoints based on the consumer and producer separately.
if ((bTarget == CY_U3P_USB_TARGET_ENDPT) && (bRequest == CY_U3P_USB_SC_CLEAR_FEATURE)
&& (wValue == CY_U3P_USBX_FS_EP_HALT))
{
if ((wIndex == CY_FX_EP_PRODUCER))
{
if (glIsApplnActive)
{
CyU3PUsbSetEpNak (CY_FX_EP_PRODUCER, CyTrue);
CyU3PBusyWait (125);
CyU3PDmaChannelReset (&glChHandleBulkLpUtoP);
CyU3PUsbFlushEp(CY_FX_EP_PRODUCER);
CyU3PUsbResetEp (CY_FX_EP_PRODUCER);
CyU3PDmaChannelSetXfer (&glChHandleBulkLpUtoP, CY_FX_DMA_TX_SIZE);
CyU3PUsbStall (wIndex, CyFalse, CyTrue);
CyU3PUsbSetEpNak (CY_FX_EP_PRODUCER, CyFalse);
isHandled = CyTrue;
CyU3PUsbAckSetup ();
}
}
if ((wIndex == CY_FX_EP_CONSUMER))
{
if (glIsApplnActive)
{
CyU3PUsbSetEpNak (CY_FX_EP_CONSUMER, CyTrue);
CyU3PBusyWait (125);
CyU3PDmaChannelReset (&glChHandleBulkLpPtoU);
CyU3PUsbFlushEp(CY_FX_EP_CONSUMER);
CyU3PUsbResetEp (CY_FX_EP_CONSUMER);
CyU3PDmaChannelSetXfer (&glChHandleBulkLpPtoU, CY_FX_DMA_TX_SIZE);
CyU3PUsbStall (wIndex, CyFalse, CyTrue);
CyU3PUsbSetEpNak (CY_FX_EP_CONSUMER, CyFalse);
isHandled = CyTrue;
CyU3PUsbAckSetup ();
}
}
}