Commit Graph

13 Commits (5bb3ede8904d2488c60b1d7539dff2edcce87062)

Author SHA1 Message Date
Laurent MEUNIER ad4a250292 Style fix 2018-04-06 17:03:53 +02:00
Laurent MEUNIER 3d92af50ce Add delay to let clock stabilize when out of deep sleep
Tests have shown that there is hich-up on MSI clock during the setup phase.
If this stabilization phase happens when application has restarted again
this can have side effects, like grambled UART characters typically.

So we're adding a delay before hading-over back to application.

With this modification, on NCULEO_L476RG, the wake-up time is increased
from 2ms to 2,5ms.
If possible this should be improved in the future to save 500 microseconds
of wak-up time.  See TODO
2018-04-06 16:10:27 +02:00
Laurent MEUNIER 8007b1df7c Use temporarily MSI or HSI when exiting Deep Sleep
There are cases where HW registers are found in unpexcepted state when
exiting Deep Sleep only few micro-seconds after it was entered.

By using an internal clock that does not depend on anythin and clocking
the system without using PLL, this allows SetSysClock default configuration
to run fine whatever possible configuration we find the HW in when
exiting Deep Sleep.

Also we shall restore interrupts only after all cloks are back to
expected running state.
2018-04-06 16:10:27 +02:00
jeromecoutant a816e93e9a STM32 LOWPOWERTIMER : introduce LPTIM feature
STM32L0, L4, F7 and few F4 chip are supporting LPTIM feature.
We propose to allow user to use LPTIM for MBED LowPowerTimer API instead of using RTC wakeup timers.

By default, all targets that are supporting this feature have been configured.
2018-01-09 14:10:14 +01:00
jeromecoutant c13ffaf477 STM32 LOW_POWER_TIMER update : sleep
RSF synchro after deepsleep is not specific to Low Power Timer feature
And we have to check if RTC is configured before synchro
2017-12-04 17:35:29 +01:00
Wolfgang Betz e2dc67750c Make HAL & US tickers idle safe 2017-08-09 14:29:57 +02:00
jeromecoutant 053072c2dc STM32 : set back US counter after deepsleep 2017-02-21 17:46:15 +01:00
jeromecoutant e8519416c1 STM32 sleep.c remove compilation warning 2017-02-21 17:46:11 +01:00
Helmut Tschemernjak 10bb94a365 Fixed code style violation needs '{' 2017-02-07 22:24:20 +01:00
Helmut Tschemernjak 605059e683 Fixed a problem that the STOP2 was falling back to STOP1 because
the LPR was not turned on. Now the deepsleep mode only needs 1.6uA
instead of 10uA.
2017-01-31 11:44:41 +01:00
Bartek Szatkowski 6a045a49a9 Platform: Add sleep/deepsleep user facing functions
Add sleep/deepsleep functions to platform layer which are replacing HAL
functions with the same name, rename existing symbols in HAL layer
to hal_sleep/hal_deepsleep. This way sleep functions
are always available, even if target doesn't implement them, which makes
the code using sleep clearer. It also enables us to make decision on in
which builds (debug/release) the sleep will be enabled.
2017-01-19 09:39:29 +00:00
jeromecoutant 633240b93b STM32L4 deepsleep improvement 2017-01-09 12:21:24 +01:00
jeromecoutant ab28a5e5cb STM32: Refactor lp_ticker.c + rtc_api.c + sleep.c + rtc_api_hal.h files 2016-12-21 16:54:18 +00:00