Hi Matt Ferrari,
You can check the return value of the EP0 handler when USB device fail to complete the enumeration, and you can find the code above
g_Ep0BaseHdlr = pCtrl->ep_event_hdlr[0];
pCtrl->ep_event_hdlr[0] = EP0_patch;
ErrorCode_t EP0_patch(USBD_HANDLE_T hUsb, void *data, uint32_t event)
{
switch (event) {
case USB_EVT_OUT_NAK:
if (g_ep0RxBusy) {
return LPC_OK;
}
else {
g_ep0RxBusy = 1;
}
break;
case USB_EVT_SETUP:
case USB_EVT_OUT:
g_ep0RxBusy = 0;
break;
}
return g_Ep0BaseHdlr(hUsb, data, event);
}
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------