Skip to main content
Visitor II
June 11, 2025
Question

STM USB Host MSC works with USB Flash Drive, but not with external hard drives

  • June 11, 2025
  • 3 replies
  • 555 views

Hello! everyone.

I use the stm32 Nucleo-L476RG to read the total size of USB flash drive and external hard drives, respectively. 

It works with USB flash drives, but not with external hard drives. The error message from STM32 is

FR_DISK_ERR (A hard error occurred in the low level disk I/O layer ) when I try to mount the external hard drives.

The wiring diagram is following

LeonSu_0-1749627889054.png

Please give me some suggestions to fix this issue. Thanks in advance.

 

 

 

 

 

 

 

    This topic has been closed for replies.

    3 replies

    ST Employee
    June 18, 2025

    Hello @LeonSu ,

     

    Seems the NUCLEO-L476RG is not layout optimized to interface on PA11/PA12 like a clean USB D+/D- differential tracks. Even if it is only USB Full-Speed, If you add long connection to your external drive, it may not work properly.

    5V Power may also be an issue in your context of external drive.

    If you don't succeed to solve the problem, other fallback solution could be to use :

    - a X-NUCLEO shield (USB host) if compatible with this NUCLEO Board.

    - Another Nucleo of another STM32 series offering a true on-board USB Host mode (if it exists)

    - More commonly, use Discovery boards or other evaluation boards that offer this kind of feature on a true USB User connector (USB type-C Host capable, or equipped with USB OTG micro A).

     

    Best Regards,

     

    ST Employee
    June 23, 2025

    Hello @LeonSu ,

     

    I would like to correct a typo on my previous answer : 

    USB type-C Host capable, or equipped with USB OTG micro AB , which can supply sufficient current "

    By the way , did you solve your issue ?

    Best Regards.

    Explorer
    June 23, 2025

    > " USB type-C Host capable, or equipped with USB OTG micro AB , which can supply sufficient current "

    Power supply is one of the issues with external harddisks.

    The other is the file system. While I'm not sure about FAT32 support in FatFS, NTFS will definitely be a problem.

    Super User
    June 23, 2025

    Try to debug and find where the mount fails. Does it fail at the block i/o level or in parsing the filesystem structures on the disk?

     

    LeonSuAuthor
    Visitor II
    August 6, 2025

    I tried to analyze the mounting process of USB flash drives and external hard drives in Windows.
    It shows that external hard drives use a “bridge” to connect the USB port to the hard drive. The identity of this bridge is completely unknown.
    We have sent the information back to the manufacturer for further investigation.

    Super User
    August 7, 2025

    Yes, in Windows USB Mass storage devices are mounted with help of usbstor driver. It registers as driver for the hardware bridge device; it's vendor ID can be seen in the Device Manager.

    For some other device types it can be uaspstor instead of usbstor, this isn't likely your case.