2018-01-30 04:21 AM
hello is use stm32f30p4 and use 8000000 hse_value and use cmsis.
i change SystemCoreClock in the system_stm32f0xx.c to 8000000 but my clock doesn't change and still work on 48MHZ.how can i fix it?
SystemInit();
SystemCoreClockUpdate();
while (!RCC_WaitForHSEStartUp());/** @addtogroup STM32F0xx_System_Private_Variables
* @{ */uint32_t SystemCoreClock = 8000000;Solved! Go to Solution.
2018-01-30 05:10 AM
You'd need to change the clock and PLL settings, likely in system_stm32f0xx.c and called by SystemInit()
The value for SystemCoreClock is then recomputed for the settings in effect.
2018-01-30 05:10 AM
You'd need to change the clock and PLL settings, likely in system_stm32f0xx.c and called by SystemInit()
The value for SystemCoreClock is then recomputed for the settings in effect.
2018-04-03 03:25 AM
Hi,
Bromand.Mahmoud
could you change the core clock while running the stm32?, i am trying with this:SystemCoreClock=50000000; //(50Mhz)
clockconfig.ClockType=RCC_CLOCKTYPE_HCLK; clockconfig.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK; clockconfig.AHBCLKDivider=RCC_SYSCLK_DIV1; clockconfig.APB1CLKDivider=RCC_SYSCLK_DIV1; clockconfig.APB2CLKDivider=RCC_SYSCLK_DIV1;HAL_RCC_ClockConfig(&clockconfig,1);
SystemCoreClockUpdate();
but the core clock is still the original value (32Mhz) , i have read that you must change the core clock in an specific order like turn on the HSI, turn off the PLL, reconfigure the PLL, turn on the PLL again , and in other posts says that you only should do what i am doing , this is so confuse.
2018-04-03 10:30 AM
>>
in other posts says that you only should do what i am doing , this is so confuse.
Think of it like a manual transmission car, you can't jam it through the gears without depressing the clutch, and if you don't match some of the speeds you're going to grind the gears.
The subroutine you call here hides the details. If you plan on changing the settings at a register level you're going to need to be aware of the details. The part is synchronous, so if you stop the clock it is using to run the part everything will stop, so clearly you want to switch to some other working clock first. You can't change the PLL registers when it is running, doing so would result in also sort of odd frequency changes, phase errors, and glitches.