cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_RCC_OscConfig behavior

pb
Associate
Posted on August 20, 2014 at 01:29

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.

1 REPLY 1
Posted on August 20, 2014 at 15:51

This question should perhaps go to the dedicated ''software tools'' [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx]sub-forum.

JW