Selecting a system clock with CTL.
Hi Guys,
How does one best set up for a crystal or system clock frequency that is different from the default?
I've used HSE_VALUE to define the crystal frequency (STM32 .. I guess that's the same on other ARMs), but how do I then set the system-clock from that and how do I set to use a HSI instead of HSE (STM32F051), and so on?
Thanks.
Gordon.
-
Refer to system_stm32f10x.c (for the STM32... guys) and its comment blocks. It does a decent job of explaining what it's doing and why.
I normally just #include it and take the defaults. If you want to change it (there are spots like "Uncomment the line corresponding to the desired System clock (SYSCLK)" where you may want to do that), then explicitly add it to your project and import it so that you get a local copy to modify.
-
Hmmmm, your photo looks disarmingly like a photo of me. Spooky.
I think maybe that system_xxx.c file usually gets copied into the project directory? Most of my projects have one of that form and either I've rarely modified them, or my modifications have been incorporated by Rowley. This STM32F0xx project seems to be an exception, as the appropriate file is not in the project directory. I can and will copy it in myself.
I think you're right that where to make such changes. It seems to have most of the relevant stuff in it.
I too usually use the defaults, but likely not this time.
Thanks.
Gordon.
Please sign in to leave a comment.
Comments
2 comments