Question
CubeMX not generating PLL2 code for USB using STM32H5
Hi,
I am using STM32CubeMX 6.16.1 with a STM32H503RB and I have exactly the same problem :

RCC is configured with LL library (not HAL), here is the SystemClock_Config() function generated by STM32CubeMX :
void SystemClock_Config (void)
{
LL_FLASH_SetLatency(LL_FLASH_LATENCY_5);
while (LL_FLASH_GetLatency() != LL_FLASH_LATENCY_5)
{
}
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE0);
while (LL_PWR_IsActiveFlag_VOS() == 0)
{
}
LL_RCC_HSE_Enable();
/* Wait till HSE is ready */
while (LL_RCC_HSE_IsReady() != 1)
{
}
LL_RCC_LSI_Enable();
/* Wait till LSI is ready */
while (LL_RCC_LSI_IsReady() != 1)
{
}
LL_RCC_PLL1_SetSource(LL_RCC_PLL1SOURCE_HSE);
LL_RCC_PLL1_SetVCOInputRange(LL_RCC_PLLINPUTRANGE_2_4);
LL_RCC_PLL1_SetVCOOutputRange(LL_RCC_PLLVCORANGE_WIDE);
LL_RCC_PLL1_SetM(12);
LL_RCC_PLL1_SetN(250);
LL_RCC_PLL1_SetP(2);
LL_RCC_PLL1_SetQ(4);
LL_RCC_PLL1_SetR(2);
LL_RCC_PLL1P_Enable();
LL_RCC_PLL1_Enable();
/* Wait till PLL is ready */
while (LL_RCC_PLL1_IsReady() != 1)
{
}
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL1);
/* Wait till System clock is ready */
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL1)
{
}
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
LL_RCC_SetAPB3Prescaler(LL_RCC_APB3_DIV_1);
LL_SetSystemCoreClock(250000000);
/* Update the time base */
if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
{
Error_Handler();
}
}
PLL2 is never init although PLL2Q is selected in USB Clock Mux.
