Trying to implement power savings - programming question

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Locked
burrito
Posts: 1
Joined: Mon Jul 10, 2017 7:47 pm

Trying to implement power savings - programming question

Post by burrito » Mon Jul 10, 2017 8:03 pm

Hi - I'm new to these boards. I have a lot of experience with ATMEL arduinos. I am trying to establish some power savings and want to switch between the run modes and scale the voltage and frequency of the cores. Is there a flag i need to set in order to stop executing during these changes? I should be able to keep going while scaling the voltage regulator but would need to stop the clock, right?

thanks!
-Burrito

victor_pv
Posts: 1605
Joined: Mon Apr 27, 2015 12:12 pm

Re: Trying to implement power savings - programming question

Post by victor_pv » Wed Aug 16, 2017 5:06 pm

burrito wrote:
Mon Jul 10, 2017 8:03 pm
Hi - I'm new to these boards. I have a lot of experience with ATMEL arduinos. I am trying to establish some power savings and want to switch between the run modes and scale the voltage and frequency of the cores. Is there a flag i need to set in order to stop executing during these changes? I should be able to keep going while scaling the voltage regulator but would need to stop the clock, right?

thanks!
-Burrito
I believe there is several threads on the subject, try a search for terms like: standby, sleep, power savings.
There is some core functions to switch the MCU out to sleep or standby.
It can also run a lower speeds, but in general it's better to run fast and sleep, than run slow but active for longer.

User avatar
Pito
Posts: 1500
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Trying to implement power savings - programming question

Post by Pito » Thu Aug 17, 2017 6:52 am

To switch the main cpu clock frequencies on-fly is possible with stm32, I did it in past but in mecrisp forth (BluePill).
I did a loop while switching between for example 72/8/48MHz and it worked fine, not crashing.
Except you have to use a complete PLL frequency setup routine (as you may see in core files) for the switch itself, you have to adjust the Serial and Systick upon such switch to stay consistent with baudrate and delays, etc..
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6702
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Trying to implement power savings - programming question

Post by RogerClark » Thu Aug 17, 2017 10:47 am

I'm locking this topic, because there are many other threads about the same subject.

The thread can be deleted in due course.

Locked