Default SystemClock_Config fails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-06 9: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
- Labels:
-
RCC
-
STM32CubeMX
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 1: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 2:33 PM
To reproduce the issue:
- install mx cube 6.2
- Select "Start my project from ST Board"
- Select NUCLEO-F429ZI
- Initialize all periperals with their default mode --> YES
- Name Project
- Select MAKEFILE toolchain
- Use latest available firmware version (FW_F4 v1.26.1)
- Click on Generate Code
- Build firmware (make)
- Flash firmware (st-flash --reset write build/projectname.binn 0x8000000
- Use GDB to step into code
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
