9 years, 11 months ago.

Nucleo Wake Up from sleep, deep sleep

Is there as 'software' Wake Up timer for sleep, deepsleep on these Nucleo boards?

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F030R8T6 microcontroller.

3 Answers

9 years, 8 months ago.

And it took some time, but WakeUp (http://mbed.org/users/Sissors/code/WakeUp/) now supports this target also. I probably need to do some additional testing, but it seems to work properly :).

And now it automatically supports every ST target with this RTC (the code implements what Hermann also suggested, just add sleep time to the RTC time. I would rather use a seperate timer, but this works too). At least, it would have done that if they didn't modify the standard peripheral library even though the peripherals are identical...

That learns me not to use such a library but just address the registers directly. Often just as easy, and you don't have to worry which version of the peripheral library you get. Only since the RTC stores everything as BCD for some reason it was more straight forward.

Accepted Answer

And if someone ends up here by searching around: It should now work for all STM targets*. (Rewrote the code not to use the ST standard peripheral lib).

  • In theory, they use different IRQ lines, so that might need a define for some more targets
posted by Erik - 24 Jul 2014
9 years, 9 months ago.

Hi,

if you are looking for periodic wakeups, have a close look at figures 206 and 207 of RM0091 (Reference manual STM32F0x1/STM32F0x2/STM32F0x8).

Figure 206 is for STM32F03x/STM32F05x while figure 207 is for STM32F07x. Whereas the STM32F07x has a 16-bit wakeup auto reload timer (= periodic wakeups) and can create a WUTF signal, the STM32F03x/STM32F05x lack this feature. The workaround for the latter devices is to read time/date after wakeup, increment it by a particular period and use this time/date to set an Alarm.

Hermann

Thank you for the answer Hermann, however I will continue with the Freescale MCU's as these have a usable wake up timer that Erik has written a reliable API.

posted by Paul Staron 02 Jun 2014
9 years, 11 months ago.

Hi,

The STM32F030R8 has a RTC with alarm and periodic wake-up from slop/stand-by modes. But this is not coded in mbed, I don't even know if there is an API for this ? Otherwise you need to use directly the driver functions provided in the CMSIS folder.

Examples are given in the STM32F0xx standard peripherals library:

http://www.st.com/web/en/catalog/tools/PF257884#

Regards.

How is the RTC clocked? My four Nucleo boards I have do not have crystals fitted, this is not a problem as I can fit these, however is the 32kHz external clocked RTC now supported in Mbed? Can these boards accurately run the low power battery back up RTC in stop mode and even in MCU power down mode? Is it possible to use a low power timer in 'deep sleep' running on IRC to Wake Up the MCU similar to the Freescale and NXP platforms do on Mbed?

posted by Paul Staron 21 Apr 2014

Sorry to arrive late for this party.

I can get the STM32 (STM32L152, specifically) Alarms to work fine "bare metal" - but not under mbed.

posted by Andrew Neil 04 Aug 2017