AnsweredAssumed Answered

What it the recommended way to obtain lots of clock switch functions?

Question asked by arnold_w on May 31, 2016
Latest reply on Jun 13, 2016 by arnold_w
I am working with the Discovery Development Board and a custom-made PCB with an STM32F405 microcontroller operating at 1.85 Volts. I would like to be able to easily switch clock frequency, that is, I would like to have functions called switchFreq_500_kHz, switchFreq_1_MHz, switchFreq_2_MHz, switchFreq_4_MHz, etc. I thought I had found a good way to do this, I used the makro in the STM32F4xx_Clock_Configuration_V1.1.0.xls Excel-sheet provided by ST Microelectronics and generated code and then I renamed, for example, SystemInit to SystemInit_500_kHz and SystemCoreClockUpdate to SystemCoreClockUpdate_500_kHz and to switch frequency I would call both of these functions. This works fine on the development board but after having updated the system-folder to the latest release my STM32F405 microcontroller is acting erratically and I've traced the problem to these functions. What is the proper way to create the functions I want?