cancel
Showing results for 
Search instead for 
Did you mean: 

Is there documentation on best practices for changing system clock configurations and voltage scaling when an STM32 MCU device is already running?

BCogh.2
Associate II

I am updating legacy firmware running on an STM32L151QEhx to the HAL libraries. Our current firmware changes the PLL (which supplies sysclk) configuration's multiplier and divider and the voltage scaling whenever a USB is connection is detected or terminated. This is done without restarting the device.

The legacy code lacks documentation as to the rationale for the steps taken when updating the clock, so I am looking for any application notes, examples, or documentation that can describe best practices for changing system clock configurations while the device is still running.

I have looked through the knowledge base and application notes already, but my search terms may not have been sufficient as this is the first time I've had cause to dynamically change clocks.

Thank you very much for your time,

Brian

1 REPLY 1
TDK
Guru

The reference manual will tell you what is allowed. In general, this is taken care of correctly with the appropriate HAL calls. For example, it will increase wait states prior to the change but decrease them after the change.

If you feel a post has answered your question, please click "Accept as Solution".