cancel
Showing results for 
Search instead for 
Did you mean: 

How to get USB Mass Storage Device working on STM32H7A3 Nucelo

magene
Senior II

I'm trying to get the STM32 USB training "09.8 USB MSC device labs tutorial" (https://www.youtube.com/watch?v=GjQqZd1keBo) working on a STM32H7A3 Nucleo board. The tutorial is for a STMF4xx but it seems like it should work on my H7A3 Nucleo if I start with a H7A3 project in CubeIDE. My project compiles and runs in CubeIDE but no USB drive enumerates on my PC.

The example expects a full speed USB device and my Nucelo only has a high speed USB in CubeMX so I've tried setting the USB_OTG_HS to full speed (12 MBits/s) and high speed (480 MBits/sec) but neither one enumerates a drive. Other than that, I don't see any device specific code but I'm sure I'm missing something.

Single stepping through my program, it times out at this loop in stm32h7xx_ll_usb.c.

 do
  {
    if (++count > 200000U)
    {
      return HAL_TIMEOUT;
    }
  } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);

Any ideas will be greatly appreciated. Thanks

1 REPLY 1

Hello @magene​ ,

You can refer to the following example provided under the H7 Firmware Package:

BeST Regards,

Walid