Skip to main content
SARTHAK KELAPURE
Associate III
January 29, 2018
Question

STM32 Sleep

Posted on January 29, 2018 at 13:02

What is the best way to put STM32L0 micro-controllers to sleep for limited time duration(preferably using RTC)?

#stm32l0 #stm32-sleep
This topic has been closed for replies.

10 replies

Andrew Neil
Super User
January 29, 2018
Posted on January 29, 2018 at 13:14

There is no such thing as 'best' - it all depends on your particular requirements.

It is a tradeoff between

  • current consumption while in sleep;
  • functionality while in sleep;
  • available wakeup triggers;
  • time taken to 'wake up' from sleep;
  • amount of reconfiguration required to enter & exit sleep;
  • etc...
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
SARTHAK KELAPURE
Associate III
January 29, 2018
Posted on January 29, 2018 at 13:18

Well, in that case, I would like to wake the controller on an RTC timeout and would like to have low power consumption(not the least, functionality is priority). Is this possible?

Andrew Neil
Super User
January 29, 2018
Posted on January 29, 2018 at 13:41

So have you looked at the Datasheet and Reference Manual - they list & describe the available 'sleep' modes ...

The STM32L0x2 Reference Manual, at least, has code examples at the end ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
January 29, 2018
Posted on January 29, 2018 at 18:08

Pretty sure the LRWAN implementation is illustrative of the RTC being used as the primary timebase, placing the device into SLEEP state(s)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User
January 29, 2018
Posted on January 29, 2018 at 18:19

Yes, it is - though rather a lot to wade through just for an example of SLEEP ... !!

:(

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
January 29, 2018
Posted on January 29, 2018 at 18:21

But the mechanics are at least fully explored. And the OP was using the LoRa L0 code previously.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Antonio Vilei
ST Employee
January 30, 2018
Posted on January 30, 2018 at 15:30

Hi,

as already said by Andrew, the best option really depends on the situation.

If you want to try different configurations, you'll find some examples in the STM32CubeL0 package in the

'Projects\{board name}\Examples\PWR' directory.

Among other things, there is an example, called 'PWR_STANDBY_RTC', where RTC is used to wake-up from standby mode.

Please refer to the datasheet and reference manual for more details about the different low-power states you can enter.

Best regards,

Antonio