2022-09-20 05:03 AM
CubeMX version: v6.6.1 MacOS
MCU: STM32G0B1CCUx
Issue:
When selecting PLLQ driven from HSE in USB Clock Mux in CubeMX and choosing LL as RCC driver, the clock source for USB is never actually set in the generated code.
This line is missing in the SystemClock_Config function:
LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLL);
When selecting HSI48 as USB clock source, this explicit setter is not necessary for some reason.
2022-09-27 08:36 AM
Hello @RWarh.1 ,
Have you check in the stm32g0xx_hal_msp.c ?
There should be a function named void HAL_HCD_MspInit(HCD_HandleTypeDef* hhcd) with this function inside :
LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLL);
Best regards,
Simon