cancel
Showing results for 
Search instead for 
Did you mean: 

USB Memory Device Compatibility Issue with STM32H47

Spinoza53
Associate II

Hi all,

I hope everyone is progressing well with their projects.

I'm currently working with the STM32H47 series microcontroller. In my project, I log certain values and store them in external flash memory. Later, I use USB host functionality to retrieve this data from flash. Under normal conditions, the project works as expected.

However, I’ve encountered an issue: when using a specific brand of USB drive, the device is recognized and functions properly. But when I try other USB brands, the STM32 fails to detect them. I’ve tested the hardware setup and found no issues there, which led me to believe the problem might lie in the USB host code—possibly in the files generated by STM32CubeIDE.

Do you have any suggestions or best practices on how to standardize USB host support to ensure compatibility across various USB drive brands? Any recommendations on what to check or modify in the generated code would be greatly appreciated.

Thanks in advance for your support!

Best regards,

5 REPLIES 5
AScha.3
Super User

Hi,

STM32H47 series --- 47? cpu ? 

I use (here) the H743 , also USB host -> MSC ; i have seen all usb-sticks working, even the cheap "mini-64GB-stick" from China , unknown source. 

I suspect a hardware problem or the correct detection of the current USB status ; (Appli_state = APPLICATION_START ....and what you do then.).

+

>I’ve tested the hardware setup and found no issues there,

How you tested ?

+

or format problem ?  

Maybe stick is  exFAT  , but you have not enabled  exFAT  in your file system. btw what you use ?

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @Spinoza53 

Do you have USB protocol analyzers to spot differences?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Pavel A.
Super User

Do you have any suggestions or best practices on how to standardize USB host support to ensure compatibility across various USB drive brands?

There are some "advanced" drives that your firmware will be unable to handle (those with UASP protocol, formatted in unsupported filesystem or partition scheme). If you detect such drives, reject them gracefully (don't format them).

> Any recommendations on what to check or modify in the generated code would be greatly appreciated.

Enable debug logs/prints in the USB library to understand where detection fails. A protocol analyzer will be helpful, but they are expensive and hard to find these days.

 

 

 

Thanks for the reply, indeed, the settings are quite the same for both usb drivers, when I connect the non-working usb driver , it basically 

case HOST_USER_DISCONNECTION:

Appli_state = APPLICATION_DISCONNECT;

break; , gives this return ?

 

Thanks a lot for the reply. Indeed, the workind usb driver return Appli_state = APPLICATION_READY; class while non-working usb driver returns to Appli_state = APPLICATION_START , while trying to debug enumrator , they frequently turn to same logs , both devices powered on and formatted same way , and all the suggester parameters are arranged accordingly , but in the end , same result for it. For hardware issue, it is usb_otg_fs pins. any idea ? thanks again for the help