Forum : ARM
Post Information | Post |
---|---|
July 13, 2009 - 4:40am
|
My STM32F103C8T6 board has a 4 MHz external oscillator. When I run the following RCC configuration code the second call to the RCC_GetClocksFreq() routine reports a SYSCLK, HCLK and PCLK2 clock speed of 112 MHz and a PCLK1 speed of 56 MHz. If I change the PLLSource to RCC_PLLSource_HSE_Div2, then the clock frequencies are halved, as you would expect. The device specifications say the maximum clock speed is 72 HMz, but I'm sure it could go a little further; whether it can go all the way to 112 MHz, I don't know. Is the clock actually being set to 112 MHz or is the reported value being multiplied by 2? Either way, something is wrong. Any suggestions? Could it be something in the compiler? void RCC_Configuration(void) /* Get the frequencies of different on-chip clocks */ /* RCC system reset(for debug purpose) -------------------------------------*/ /* Enable HSE --------------------------------------------------------------*/ /* Wait till HSE is ready --------------------------------------------------*/ if(HSEStartUpStatus == SUCCESS) /* Flash 2 wait state */ /* HCLK = SYSCLK */ /* PCLK2 = HCLK */ /* PCLK1 = HCLK/2 */ /* PLLCLK = 4MHz * 14 = 56 MHz */ /* Enable PLL */ /* Wait till PLL is ready */ /* Select PLL as system clock source */ /* Wait till PLL is used as system clock source, SWS_PLL = 0x80 */ /* Get the frequencies of different on-chip clocks */ } |
Hi,
You have a complex issue here. Definitely trying to walk off-ways of the specifications to overclock your STM32 does not look like a good idea.
This issue does not look like it is related to the tools (the compiler should get it right), so you should contact the ST support people for help.
Regards,
Bruno
Hello Bruno. Thank you for your reply. The code says it all. I am not trying to overclock the device, that's just what the debugger is reporting.
Since I can't get the 4 MHz external oscillator to oscillate at the frequency I want (56 MHz via the PLL), could you supply some code that would show me how to get the internal 8 Mhz oscillator to oscillate at 56 MHz (via the PLL of course).
Regards,
Harry.
Hi
We do not see a solution to te problems you have.
I think the best solution is to start from latest STmicroelectronics library files.
http://www.st.com/mcu/modules.php?name=mcu&file=devicedocs&DEV=STM32F103C8&FAM=110
If this does not work it wil be easier to get support from ST Microelectronics teams.
Regards,
Matloub
@Oudenhoven
Can you also check that you have changed the define of the frequency in the library.
In stm32f10x_conf.h file the frequency is by default defined at 800000 it has to be changed to 400000.
This might be the reason why.
Regards,
Matloub