USBH_MSC_Read Problem is Stuck in while Loop?
Hello
USBH_MSC_Read function uses a while loop and USBH_MSC_RdWrProcess to USB mass storage.
while (USBH_MSC_RdWrProcess(phost, lun) == USBH_BUSY)
{
if (((phost->Timer - timeout) > (10000U * length)) || (phost->device.is_connected == 0U) )
{
MSC_Handle->state = MSC_IDLE;
return USBH_FAIL;
}
}
MSC_Handle->state = MSC_IDLE;This part of the blocks the application for more than 3 or 4 seconds in some usb mass storages
I investigated the USB_MSC_Bot process and it was understood that most of the time in USBH_MSC_BOT_Process in the BOT_DATA_IN_WAIT
application URB_Status is equal to USBH_URB_NOTREADY which is not handled in the BOT_DATA_IN_WAIT
I used a counter until the end of USBH_MSC_Read and USBH_URB_NOTREADY was counted for 45000 time until the loop ended
I have searched most of the post related to this issue but most of them were unanswered and no useful fix was released
#USB
#STM32F7
#STM32F4
