STMicroelectronics / stm32_mw_usb_host

Provides the USB Host library part of the STM32Cube MCU Component "middleware" for all STM32xx series.
Other
32 stars 15 forks source link

USBH_MSC_RdWrProcess loop stuck #10

Closed NimaAgm closed 5 months ago

NimaAgm commented 1 year ago

Description I have USB Host application. This application would read files from USBs.

Describe the set-up

How To Reproduce

  1. Even emi problem may cause this loop too
  2. for example if you short D+ or D- or connect D+ to D- USB application would get stuck in this while loop
NimaAgm commented 1 year ago

Any news on this issue ?

NimaAgm commented 1 year ago

Any news on this issue ?

ALABSTM commented 7 months ago

See also STM32CubeF1#59

ALABSTM commented 7 months ago

Hi @NimaAgm,

Please excuse this delayed reply. Analysis is ongoing. I will keep you posted.

With regards,

ALABSTM commented 6 months ago

Hi @NimaAgm,

Regarding the USBH_MSC_Read() function, it looks you are right. I notice there is a timeout mechanism. However, local variable timeout seems to be left unchanged while it should be decremented each iteration.

https://github.com/STMicroelectronics/stm32_mw_usb_host/blob/3a524c2f185ac2f193cf3edd0b3f83ed064f3a5c/Class/MSC/Src/usbh_msc.c#L824-L830

Regarding the USBH_MSC_BOT_Process() function, it looks like you are right too.

Both points will be logged internally at the attention of our development teams. I will keep you informed.

With regards,

ALABSTM commented 6 months ago

ST Internal Reference: 175663

ALABSTM commented 6 months ago

ST Internal Reference: 175666

ALABSTM commented 6 months ago

Hi @NimaAgm,

Here is the answer of our development teams to the issue with the USBH_MSC_Read() function.

Hence, there is no timeout issue according to them.

Regarding the issue related to the USBH_MSC_BOT_Process() function, the analysis is still ongoing.

With regards,

ALABSTM commented 5 months ago

Hi @NimaAgm,

Regarding the issue related to the USBH_MSC_BOT_Process() function, our development teams say there is no need to consider the sub-case URB_Status == USBH_URB_NOTREADY in case BOT_DATA_IN_WAIT for transfers to the IN EP. Indeed:

On the other hand, for transfers from the OUT EP, this request needs to be resubmitted by the MW in order to resend the same data.

I hope this makes things clearer. Please allow me to close this thread. Thank you for your comprehension and thank you again for your report.

With regards,