AnsweredAssumed Answered

HAL_RCC_OscConfig behavior

Question asked by pbk on Aug 20, 2014
Latest reply on Aug 20, 2014 by waclawek.jan
SystemInit in my initialization calls SetSysClock that configures the PLL using the HSE with the default PLL values of my chip. SystemClock_Config generated by CubeMX calls HAL_RCC_OscConfig which attempts to do the same. However, since the PLL is already configured, the __HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL conditional evaluates to false (SWS[1:0] = 10 since the PLL is already selected), and the function returns HAL_ERROR instead of re-configuring the PLL.

Is that the intended behavior? I would have expected that if I provide a different PLL configuration in the RCC_OscInitTypeDef argument, the PLL would be configured again.

Regards.

Outcomes