Skip to main content
Laxel.1
Associate
April 20, 2022
Solved

STM32f072R stuck at 16mhz (RESOLVED)

HI i got a problèm on an stm32f0.after a reset the µC is at 8mhz but i'm only able to climb to 16mhz when i want to go to 48MHZ , did someone have idea of where does the problem come from.

the µc are not new because i work on protoboard and i cant change it.

void Setup_Init_Clocks()
{
 
	RCC_DeInit();
	RCC_HSICmd(ENABLE);
	RCC_PLLConfig(RCC_PLLSource_HSI,6);//with that pll mult i must have 48mhz?
	//RCC_PREDIV1Config(1);
	RCC_PLLCmd(ENABLE);
 
	//RCC_PREDIV1Config(1);
	RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
	//RCC_USARTCLKConfig();definir si utile
	RCC_ClocksTypeDef value;
	RCC_GetClocksFreq(&value);
 
}
int main(void) {
	Elevator_Data test_cab;
	Setup_Init_Clocks();
	F_Init_IO();
	F_InitTimers();
	u8_F_CrepINIT();
	F_InitUSART1();
	F_InputsRead(&test_cab);
	F_LedsWrite(&test_cab);

thanks by advance

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
April 20, 2022

> i got a timer with a blinking led , whatever i do with the PLL multiplier i got the same result on the led

It may be the "library" automatically changing the values set in Timer's registers, as you change the system clock. Read out and check the RCC and the Timer registers' content for the different versions.

> and how do you change the flash latency?

0693W00000LyR7cQAF.png0693W00000LyR9JQAV.pngJW

5 replies

waclawek.jan
Super User
April 20, 2022

> but i'm only able to climb to 16mhz

What is this, SPL?

What is "climb"? What happens if you "climb" higher? How do you verify the system clock?

Are you or the "libraries" you are using aware of the fact that you have to change FLASH latency setting (set waitstates), if you want to go beyond certain system clock frequency?

JW

Laxel.1
Laxel.1Author
Associate
April 20, 2022

I'm french so i'm trying to be the more clear as possible ,

i use the stdperiph given by ST,

i got a timer with a blinking led , whatever i do with the PLL multiplier i got the same result on the led

and how do you change the flash latency?

is that this ?0693W00000LyQjVQAV.png

waclawek.jan
waclawek.janBest answer
Super User
April 20, 2022

> i got a timer with a blinking led , whatever i do with the PLL multiplier i got the same result on the led

It may be the "library" automatically changing the values set in Timer's registers, as you change the system clock. Read out and check the RCC and the Timer registers' content for the different versions.

> and how do you change the flash latency?

0693W00000LyR7cQAF.png0693W00000LyR9JQAV.pngJW

Laxel.1
Laxel.1Author
Associate
April 20, 2022

I finaly succeed to set a 48Mhz clock but now the code seem work only in debug is latency can cause that problème?

i'm trying to change the latency to see if it work