AnsweredAssumed Answered

stm32f1x lowest power run mode

Question asked by Martijn Jonkers on Mar 13, 2016
Latest reply on Dec 8, 2016 by Martijn Jonkers
Hi,

I was looking into the stm32 architecture.
And i have some questions about achieving the lowest power consuption while staying operational.

Example: A simple application that every 10 seconds needs to send 20 bytes of data over the USART peripheral at 4800 baud (DMA not used).
The CPU can prepare a byte, then go to sleep. when the usart is finished sending a byte, it needs to wake the cpu to prepare the next byte, until there is nothing to send anymore.

I already learned I can put the CPU in sleep mode, until the transmission is due. I have done this by enabling the RTC and use the RTC alarm to wake the CPU from WFI (not stop or standby mode). Now I would like to optimize the USART and RTC more. 

I was playing around with the APB1 USART/GPIO/AFIO clock and noticed I can shut it down when USART is not used.

Also I noticed that the clock to the PWR peripheral needs to be enabled to enable the power to the RTC, fine with me. But in none of the examples I found the clock to the PWR peripheral is stopped again, this is just a wast of power, right?
What I did was: start PWR clock, start RTC power, stop PWR clock. And RTC just works fine. Why is the PWR clock not stopped in all the examples?

This is the same for the USART/GPIO/AFIO clocks. why keep them running when not used?

Then I had a last question: Is the HSI clock stopped when no resource is requesting it?
Or is it only stopped when I enter WFI and the DEEPSLEEP bit is set in the Cortex Core? I hope it is possible, because that would mean the USART can continue doing its thing while the CPU is sleeping. Until the clock to the USART etc.. is stopped.

Outcomes