cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7R3 USB FS device enumeration problem

mkrk
Associate III

Dear ST,

I'm trying to get USB CDC device working on custom STM32H7R3L8HxH based board. Host (Windows) detects it but unfortunately the USB device fails to enumerate with error:

Windows has stopped this device because it has reported problems. (Code 43)
A request for the USB device descriptor failed.

USB FS based Boot ROM works in DFU mode so I know hardware should be okay.

I found a bug in CubeMX code generator. USBPHY clock source is configured to be HSE (which is 24 MHz):

mkrk_0-1756912658908.png

However code generator creates usbd_conf.c function HAL_PCD_MspInit with these lines:

  /** Initializes the peripherals clock
  */
    PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USBOTGFS;
    PeriphClkInit.UsbOtgFsClockSelection = RCC_USBOTGFSCLKSOURCE_PLL3Q;
    if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
    {
      Error_Handler();
    }

 

I confirmed with debugger in SFR view that indeed OTGFSSEL bits in RCC_CCIPR1 are set to PLL3/Q.

STM32CubeIDE version is 1.19.0 and MxCube version is 6.15.0.

Unfortunately manually fixing clock to HSE did not make it work. So there is probably another problem.

USB settings are:

mkrk_1-1756913245041.png

mkrk_2-1756913261908.png

mkrk_3-1756913284132.png

mkrk_5-1756913361500.png

mkrk_6-1756913374013.png

Only change in code is calling USBD_Start() after USB has been initialized in MX_USB_DEVICE_Init.

 

 

0 REPLIES 0