diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h index 2e4119e..83d2a3f 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h @@ -136,7 +136,8 @@ MSC_HandleTypeDef; #define USB_REQ_BOT_RESET 0xFF #define USB_REQ_GET_MAX_LUN 0xFE -#define MSC_TIMEOUT_FRAMES_PER_BLOCK 1000 +//#define MSC_TIMEOUT_FRAMES_PER_BLOCK 1000 +#define MSC_TIMEOUT_FIXED 5000 //Some flash drives take 2 seconds to write a single block! /* MSC Class Codes */ #define USB_MSC_CLASS 0x08 diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c index 57630a6..ea622d9 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c @@ -735,7 +735,7 @@ USBH_StatusTypeDef USBH_MSC_Read(USBH_HandleTypeDef *phost, MSC_Handle->unit[lun].state = MSC_READ; MSC_Handle->rw_lun = lun; MSC_Handle->RdWrCompleteCallback = callback; - MSC_Handle->timeout = phost->Timer + (length * MSC_TIMEOUT_FRAMES_PER_BLOCK); + MSC_Handle->timeout = phost->Timer + MSC_TIMEOUT_FIXED; USBH_MSC_SCSI_Read(phost, lun, @@ -776,7 +776,7 @@ USBH_StatusTypeDef USBH_MSC_Write(USBH_HandleTypeDef *phost, MSC_Handle->unit[lun].state = MSC_WRITE; MSC_Handle->rw_lun = lun; MSC_Handle->RdWrCompleteCallback = callback; - MSC_Handle->timeout = phost->Timer + (length * MSC_TIMEOUT_FRAMES_PER_BLOCK); + MSC_Handle->timeout = phost->Timer + MSC_TIMEOUT_FIXED; USBH_MSC_SCSI_Write(phost, lun,