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

v3.4.1 fail MSC with usb stick. v3.4.0 is ok #8

Closed GLASS-FR closed 1 year ago

GLASS-FR commented 2 years ago

set-up

Describe the bug Before, using usb host lib v.3.4.0 we can use usb stick with no problem. On stm32f765, upgrading hal to 1.17.0 we got also usb host lib v.3.4.1. After lot of croised tests it appear that reverting only this lib to v3.4.0 give us a functionnal MSC USB HOST.

See : https://community.st.com/s/question/0D53W00001fPT6NSAW/stm32g0b1-usb-host-msc-flash-drive-not-working

How To Reproduce Cube mx generated code for stm32f765 (seems exactly the same for other user with stm32g0) with latest hal (1.17.0 for F7).

Can be reproduced just plugging a usb stick (4gb fat32 ). And the v.3.4.1 lib go to infinite oop.

GLASS-FR commented 2 years ago

Other users hit same issue . Give a look here : https://community.st.com/s/question/0D53W00001eaR69SAE/fatfsusbdisk-example-with-usbfs-does-not-work-when-an-usb-stick-is-connected-the-usbhmscprocess-never-gets-further-then-mscreadinquiry-any-hints

iiMattView commented 2 years ago

hello from one of the other users that hit the same issue...

I have compared the sources of 3.4.0 and 3.4.1. The only functional change I found was in USBH_ParseEPDesc where the buffersize handling changed. I have reverted row 561 of usbh_ctlrqe.c to what is was before what fixes the problem for me. I have tested it with the F769 Discovery (USB HS) and the F767 NUCLEO (USB FS). I however do not have the the insight nor the resources to test it properly. The author might have had reasons to change this code. Please verify my inputs for a new release

ABOUSTM commented 2 years ago

Hello GLASS-FR, Thanks for reporting the issue, the fix is part of Host lib v3.5.0 available under ST github

Regards, Aymen

GLASS-FR commented 2 years ago

@ABOUSTM and @ALABSTM : please its urgent to update : 1)Release note : v3.4.1 MSC regression solved by v3.5.0 2) All Hal and cube package using 3.4.1=>3.5.0 with release note clearly explaining msc regression solved by v3.5.0 usb host lib Hope you will can do something quickly because we are numerous to fall in this trap...

ALABSTM commented 1 year ago

Hi @GLASS-FR,

Thank you once more for having reported this point.

Regarding the upgrade of USB Host library to the latest version in all firmware packages, there is currently no plan for such update concerning certain series. We will keep you updated should there be any change.

In the meanwhile, you can easily perform the integration into your package by yourself as newer versions are backward compatible. Thank you for your comprehension.

With regards,