You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was seen in a vendor-defined application on an ATSAME51G19A running FreeRTOS.
USB transfers stop working when a bus stall is used to indicate an error in vendor-defined control transfers and is called outside of the interrupt context (deferred handling.) I traced this to the following reasons:
DRV_USBFSV1_DEVICE_EndpointStall() calls _DRV_USBFSV1_DEVICE_IRPQueueFlush(), but when called outside of the interrupt context a new read IRP does not get submitted for endpoint 0, so new control transfers are never received. I was able to work around this by not calling _DRV_USBFSV1_DEVICE_IRPQueueFlush() if hDriver->isInInterruptContext is true.
_USB_DEVICE_Ep0ReceiveCompleteCallback() is called on completion of the stall, which subsequently calls the application callback function. This calls driver functions which attempt to make nested calls to lock hDriver->mutexID resulting in a deadlock. This may work if recursive mutexes are enabled, but I worked around by returning immediately from _USB_DEVICE_Ep0ReceiveCompleteCallback() if (irpHandle->status == USB_DEVICE_IRP_STATUS_ABORTED) || (irpHandle->status == USB_DEVICE_IRP_STATUS_ABORTED_ENDPOINT_HALT).
The text was updated successfully, but these errors were encountered:
This was seen in a vendor-defined application on an ATSAME51G19A running FreeRTOS.
USB transfers stop working when a bus stall is used to indicate an error in vendor-defined control transfers and is called outside of the interrupt context (deferred handling.) I traced this to the following reasons:
DRV_USBFSV1_DEVICE_EndpointStall()
calls_DRV_USBFSV1_DEVICE_IRPQueueFlush()
, but when called outside of the interrupt context a new read IRP does not get submitted for endpoint 0, so new control transfers are never received. I was able to work around this by not calling_DRV_USBFSV1_DEVICE_IRPQueueFlush()
ifhDriver->isInInterruptContext
is true._USB_DEVICE_Ep0ReceiveCompleteCallback()
is called on completion of the stall, which subsequently calls the application callback function. This calls driver functions which attempt to make nested calls to lockhDriver->mutexID
resulting in a deadlock. This may work if recursive mutexes are enabled, but I worked around by returning immediately from_USB_DEVICE_Ep0ReceiveCompleteCallback()
if(irpHandle->status == USB_DEVICE_IRP_STATUS_ABORTED) || (irpHandle->status == USB_DEVICE_IRP_STATUS_ABORTED_ENDPOINT_HALT)
.The text was updated successfully, but these errors were encountered: