2020-12-09 04:22 AM
Hello,
I am trying to use USB-HS DMA in my program... It works good with other endpoints except EP0
For EP0, the enumeration phase is done successfully, But when I start sending my USB class specific messages one after the other continuously on EP0, after some successful transmissions, it suddenly gets stuck and EP0 Nack status is set ... I also check that DMA address be 4byte-align
Note that there is no problem when DMA is disabled
What could be the probable mistake?
Thanks in advnace
Solved! Go to Solution.
2021-03-13 12:36 PM
Hi,
I guess DMA is used for both IN and OUT actions. Anyway, I was testing B2B for OUT actions
2021-03-14 07:48 AM
The problem was in USBD_LL_DataOutStage and USBD_LL_DataInStage that was fixed by removing these snippets from code:
In function USBD_LL_DataOutStage:
#if 0
if (pdev->ep0_state == USBD_EP0_STATUS_OUT)
{
/*
* STATUS PHASE completed, update ep0_state to idle
*/
pdev->ep0_state = USBD_EP0_IDLE;
USBD_LL_StallEP(pdev, 0U);
}
#endif
In function USBD_LL_DataInStage:
#if 0
if ((pdev->ep0_state == USBD_EP0_STATUS_IN) ||
(pdev->ep0_state == USBD_EP0_IDLE))
{
USBD_LL_StallEP(pdev, 0x80U);
}
#endif