Skip to main content
Visitor II
October 13, 2025
Question

USB Memory Device Compatibility Issue with STM32H47

  • October 13, 2025
  • 3 replies
  • 441 views

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,

    This topic has been closed for replies.

    3 replies

    Super User
    October 13, 2025

    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 ?

    Spinoza53Author
    Visitor II
    October 15, 2025

    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 ?

     

    Technical Moderator
    October 13, 2025

    Hi @Spinoza53 

    Do you have USB protocol analyzers to spot differences?

    Super User
    October 13, 2025

    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.

     

     

     

    Spinoza53Author
    Visitor II
    October 16, 2025

    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