2021-05-06 09:38 AM
I started a default project and the system clock fails initialization. Does the SDK have a bug?
thanks,
cubemx 6.2
Nucleo F429ZI dev kit
makefile
gcc
ubuntu 20
2021-05-07 10:50 AM
Hello @YPear.1 ,
What about the clock configuration used?
Would it be possible to provide the source code which shows the problem?
Imen
2021-05-07 01:12 PM
> the system clock fails initialization
What are the symptoms? What do you try to accomplish? Did you debug/step through the given function?
JW
2021-05-07 02:33 PM
To reproduce the issue:
HAL_RCC_OscConfig(&RCC_OscInitStruct):138
This function call returns HAL_ERROR
The IF statement fails in line stm2f4xx_hal_rcc.c line 552
if (((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF) || │
│553 (READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || │
│554 (READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != (RCC_OscInitStruct->PLL.PLLM) << RCC_PLLCFGR_PLLM_Pos) || │
│555 (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != (RCC_OscInitStruct->PLL.PLLN) << RCC_PLLCFGR_PLLN_Pos) || │
│556 (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U)) << RCC_PLLCFGR_PLLP_Pos) || │
│557 (READ_BIT(pll_config, RCC_PLLCFGR_PLLQ) != (RCC_OscInitStruct->PLL.PLLQ << RCC_PLLCFGR_PLLQ_Pos))) │
│558 #endif │
│559 { │
│560 return HAL_ERROR; │
│561 }
Any idea?
I'm not adding or removing anything from the default setup for the ST dev kit
2021-05-08 12:58 AM
I understand your frustration, but I don't use Cube/CubeMX.
That line basically says, that if you already use PLL as system clock, and request the function to change its parameters, that is an error. Basically, there should be no reason to call that function twice, or set PLL anywhere else.
JW