Skip to main content
Graduate
December 22, 2025
Question

STM32U545: stand-alone USB HOST MSC to interface USB Pen drive

  • December 22, 2025
  • 4 replies
  • 137 views

Requesting ST to kindly provide a working example for STM32U545 using stand-alone USB HOST MSC to interface with a USB Pen drive. A Tech-Note explaining the code to be added to the various CUBEMX generated files would help.
I have been logging to the USB Pen Drive for years using the F105 and F405 series.
For battery operated devices I planned to move to U545 expecting a simple code migration but the USB interface has changed from the familiar and simple FATFS.
I tried to refer to the available USBX/FILEX samples of various other devices but could not get them to work as many refer OTG types while U545 has DRD types.
I referred to various threads on the community.st.com but they trail off without answers.

Thanks.

    This topic has been closed for replies.

    4 replies

    ST Employee
    December 23, 2025

    Hello @NFern.1 

    You can refer to the application available in the STM32U575I-EV project, which uses the same USB configuration. Just make sure not to include USBPD in your project and ensure that your device (pen drive) is powered via the VBUS line by external power.

    The example can be found here:

    STM32CubeU5/Projects/STM32U575I-EV/Applications/USBX/Ux_Host_MSC at main · STMicroelectronics/STM32CubeU5 · GitHub

    Best regards,

    hamdi 

    NFern.1Author
    Graduate
    December 24, 2025

    Hi,

    Thanks for the response. The example suggested for reference uses ThreadX.

    STM32CubeU5/Projects/STM32U575I-EV/Applications/USBX/Ux_Host_MSC at main · STMicroelectronics/STM32CubeU5 · GitHub

    My requirement is for Stand-Alone without using ThreadX.

    Anyway, I decided to try and replicate the project, ThreadX and all, with U545.
    However in CUBEMX, under "USBX Mode and Configuration"->"UX Host FS"->"Host Class FS"->"MSC" is disabled.

    u545usbx_msc_notsupported.png


    Please confirm if USB Host Mass Storage Class is supported with U545.
    I am using the NUCLEO-U545RE-Q Board for testing.

    Technical Moderator
    December 24, 2025

    Hi @NFern.1 

    I have already answered your question in the other post. You need to enable FileX in threadX context. If you would like to implement it in standalone context you need to enable this 

    #define UX_HOST_CLASS_STORAGE_NO_FILEX

    However, this is not directly using CubeMX code generated. You need to configure it manually. 

    ST Employee
    December 26, 2025

    Hello @NFern.1 

    For standalone mode, the following article can help you add the USB Device Library to your project and customize it for your application.

    How to implement a USB composite device applicatio... - STMicroelectronics Community

    Best regards,

    Hamdi

    NFern.1Author
    Graduate
    December 26, 2025

    Hi @T_Hamdi , requesting you to please write a similar article for USB HOST MSC, it will really help us.
    The article is really good, but we may miss some steps when attempting to convert to host mode.

    Our Sincere Thanks for your support!

    ST Employee
    December 26, 2025

    Hello @NFern.1 

    You can also check this repository which contains the application for the STM32U5:
    stm32u5-classic-coremw-apps/Projects/NUCLEO-U575ZI-Q/Applications/USB_Host/MSC_Standalone

    It should be helpful for your USB Host MSC implementation, along with the article already provided.

    Thank you!

    Best regards.

     

     

    NFern.1Author
    Graduate
    December 29, 2025

    Based on the responses to this post, I understand that the STM32U545 USB Host MSC supports USB pen drive.
    There are 3 approaches:
    1. With USBX, FILEX, No THREADX (ie. Stand-Alone Mode)
    2. With USBX, FILEX, THREADX (ie. RTOS Mode)
    3. With ST's Classic Core Middleware STM32_USB_Host_Library and FATFS
    However currently no sample code is available specifically for this application with STM32U545
    I started with approach 1, then tried 2 and finally tried 3, but I could not succeed for now.
    I will work on this again after a few days when I get time.


    This post can be closed. I will open a new post for specific queries as and when I encounter them.

    NFern.1Author
    Graduate
    January 5, 2026

    Approach 3 ST's Classic Core Middleware STM32_USB_Host_Library and FATFS was successful and I have documented the steps in the post below.

    Solved: How To access a USB Pen Drive with stm32u545 using... - STMicroelectronics Community

    Many thanks to @FBL and @T_Hamdi