STM32Cube  Version 2.0
Create Projects for STM32H7 Series with STM32Cube HAL and STM32CubeMX
 All Files Functions Variables Macros Pages
CMSIS-Driver USBH_HS2 Setup

The CMSIS-Driver USBH_HS2 requires:

  • Setup of USB clock to 48MHz
  • Configuration of USB_OTG_FS as Host_Only

The example below uses correct settings for STM32H743I_EVAL Board:

  • USB_OTG_FS: Mode: Host_Only

For different boards, refer to the hardware schematics to reflect correct setup values.

The STM32CubeMX configuration steps for Pinout, Clock, and System Configuration are listed below. Enter the values that are marked bold.

Pinout tab

  1. Configure USBH mode
    • Peripherals USB_OTG_FS: Mode=Host_Only

Clock Configuration tab

  1. Configure USB Clock: "To USB (MHz)": 48

Configuration tab

  1. Under Connectivity open USB_FS Configuration:
    • Parameter Settings: not used
    • User Constants: not used
    • NVIC Settings: disable interrupts
      Interrupt Table Enabled Preemption Priority Sub Priority
      USB On The Go FS End Point 1 Out global interrupt OFF 0 0
      USB On The Go FS End Point 1 In global interrupt OFF 0 0
      USB On The Go FS global interrupt OFF 0 0
      - GPIO Settings: review settings, no changes required
      Pin Name Signal on Pin GPIO mode GPIO Pull-up/Pull..Maximum out..User Label
      PA11 USB_OTG_FS_DM Alternate No pull-up and no..Low .
      PA12 USB_OTG_FS_DP Alternate No pull-up and no..Low .
      - Click OK to close the USB_OTG_FS Configuration dialog

Generate source code by click on Generate source code tool on toolbar, or select project Generate Code, or or press keys Ctrl + Shift + G.