Difference between revisions of "How to define your low-power strategy"

[unchecked revision] [quality revision]
m (Nathalie Sangouard moved page How to define your low power strategy to How to define your low-power strategy without leaving a redirect: TW review AJ w2048)
m
 
Renaming.png This page is a candidate for renaming (move).
The requested new name is: How to define your low-power strategy .
The supplied reason is: TW review AJ w4820 .
-- Gerald Baeza (talk) 16:54, 25 November 2020 (CET).
Wiki maintainers: remember to update the pages that link this page before renaming (moving) it.

1 Purpose[edit]

This article proposes some guidelines in order to determine the best low-power strategy for your STM32MP15 product.

2 Power supplies[edit]

It is important to understand the perimeter of the two STM32MP15 main power supplies:

  • VDD supplies I/Os and analog components such as reset, power management, oscillators and PLLs. VDD is present as far as the STM32MP15 is not in Off or VBAT mode. For a given system, VDD voltage is fixed and usually chosen between 1.8 V to 3.3 V typical.
  • VDDCORE supplies the digital core domain and must be present after VDD at start up. Depending on the system low-power mode, VDDCORE voltage varies between switched off (0 V), the retention voltage (0.9 V) and the nominal voltage (1.2 V). The mapping of these voltage levels to the low-power modes is shown in the next paragraph.

For more information, refer to the PWR chapter of the STM32MP15 Reference Manual and to the STM32MP15 Datasheet.

3 Low-power modes[edit]

Starting from the Run mode, various actions can be taken to reduce the processor power consumption when all tasks have been completed:

  • Stop the high-speed clock sources (PLLs/HSI/HSE/CSI): this corresponds to the Stop mode where the VDDCORE external regulator is kept at its nominal voltage. The regulator can even be switched in low-power mode in order to reduce its power consumption: this is the LP-Stop mode.
  • Stop the high-speed clock sources (PLLs/HSI/HSE/CSI) and reduce VDDCORE voltage to its retention value: this is the LPLV-Stop mode, that enables to consume the minimum power while maintaining the content of all the registers and internal memories.
  • Stop the high-speed clock sources (PLLs/HSI/HSE/CSI) and switch off VDDCORE: this is the Standby mode, where the content of all registers and internal memories is lost, apart from the one that are in VSW domain that is supplied by VDD (when present) or VBAT (in VBAT mode). In particular, notice that the Backup registers, the Backup RAM and the Retention RAM are in the VSW domain. Please also note that PWR and RCC both have some registers in the VSW (kept during Standby) and VDD (lost during Standby) domains.

One or several wake-up source(s) are used to exit from the above low-power modes and come back to Run mode. Not all internal peripherals are able to wake up from low-power modes. Table Functionalities depending on system operating mode located in the PWR chapter of the STM32MP15 Reference Manual, shows the wake-up capability of each peripheral. This is summarized in the figure in the following paragraph.

When the processor is put in one of these low-power modes, the external RAM (DDR) is usually put in Self-Refresh mode in order to keep its content whereas most of the STM32MP15 is no more active (no more clock generated for the DDR, no more Auto-refresh commands). This extra power consumption has to be considered at system level and depends on the selected DDR memory (refer to your memory provider datasheet).

The main side effect of using low-power modes is the wake-up time required to restore the system to a full running state (Run mode): the deepest you slept and the longest it needs to wake up. The next chapter illustrates this in order to allow you to make the best choice for your product.

Refer to the AN5109 document for a deeper explanation of the low-power mode characteristics and dynamics.
Refer to the Power overview to discover the corresponding software architecture that enable using those modes with OpenSTLinux.

4 Low-power strategy[edit]

4.1 Overview[edit]

The figure below shows, for each low-power mode:

  • The peripherals that can be used as wake-up sources (grey boxes)
  • The STM32MP15 typical power consumption (on the left)
  • The system wake -up times in various configurations (on the right)


AN5109 Power overview Wake up time interpretation Power supplies Low power modesSTM32MP15 low power modes

4.2 Wake-up time interpretation[edit]

Warning.png External factors, such as a ONKEY that would be debounced before reaching the STM32MP15 wake up pin, may influence the measurements given in the figure above and must be taken into account:
  • For Arm® Cortex®-A7 core:
    • The wake-up times given in the above figure correspond to a typical OpenSTLinux distribution (around 7-Mbyte uImage, 500-Mbyte Weston rootfs, 30-second cold boot time)
  • For the Arm® Cortex®-M4 core:
    • The wake-up times correspond to the return to the software execution, so your application extra time has to be added to those figures, which are taken from the STM32MP15 datasheets.
    • The RETRAM and SRAM remain supplied in (LP-)Stop and LPLV-Stop modes, so the Cortex-M4 firmware code and data can use them.
    • The RETRAM remains supplied in Standby mode, and can hence be used to store the code of a size limited firmware that would be executed at wake-up. Once woken up, the firmware can use again the SRAM for data storing and the application running on the Cortex-A7 core could even reload some services (code) in SRAM.
Info.png The core that is started on wake up from Standby is selected thanks to the MPU_BEN (Cortex-A7) and MCU_BEN (Cortex-M4) bits in RCC_MP_BOOTCR.
  • Disabling both MPU_BEN and MCU_BEN is equivalent to enabling MPU_BEN.
  • Enabling MPU_BEN is the nominal case.
  • Enabling MCU_BEN requires to be aware of the ES0438 errata sheet following items:
    • RCC security settings for Cortex-M4 access are not kept upon wake up from Standby
    • Wake-up pin flags cleared at Standby mode exit with MCU_BEN high and MPU_BEN low
  • Enabling both MPU_BEN and MCU_BEN is not recommended because race condition may occur on shared resources between each core (Cortex-A7 boot chain, including the ROM code, and Cortex-M4 firmware)


{{ArticleToRename | How to define your low-power strategy | TW review AJ w4820 | [[User:Gerald Baeza|Gerald Baeza]] ([[User talk:Gerald Baeza|talk]]) 16:54, 25 November 2020 (CET)}}
==Purpose==
This article proposes some guidelines in order to determine the best low-power strategy for your STM32MP15 product.<br>


==Power supplies==
It is important to understand the perimeter of the two STM32MP15 main power supplies:
* '''V<sub>DD</sub>''' supplies I/Os and analog components such as reset, power management, oscillators and PLLs. V<sub>DD</sub> is present as far as the STM32MP15 is not in '''Off''' or '''VBAT''' mode. For a given system, V<sub>DD</sub> voltage is fixed and usually chosen between 1.8 V to 3.3 V typical.
* '''V<sub>DDCORE</sub>''' supplies the digital core domain and must be present '''after V<sub>DD</sub>''' at start up. Depending on the system low-power mode, V<sub>DDCORE</sub> voltage varies between switched off (0 V), the retention voltage (0.9 V) and the nominal voltage (1.2 V). The mapping of these voltage levels to the low-power modes is shown in the next paragraph.
For more information, refer to the PWR chapter of the [[STM32MP15 resources#Reference manuals|STM32MP15 Reference Manual]] and to the [[STM32MP15 resources#Datasheets|STM32MP15 Datasheet]].

==Low-power modes==
Starting from the '''Run''' mode, various actions can be taken to reduce the processor '''power consumption''' when all tasks have been completed:
* Stop the high-speed clock sources (PLLs/HSI/HSE/CSI): this corresponds to the '''Stop''' mode where the V<sub>DDCORE</sub> external regulator is kept at its nominal voltage. The regulator can even be switched in low-power mode in order to reduce its power consumption: this is the '''LP-Stop''' mode.
* Stop the high-speed clock sources (PLLs/HSI/HSE/CSI) and reduce V<sub>DDCORE</sub> voltage to its retention value: this is the '''LPLV-Stop''' mode, that enables to consume the minimum power while maintaining the content of all the registers and internal memories.
* Stop the high-speed clock sources (PLLs/HSI/HSE/CSI) and switch off V<sub>DDCORE</sub>: this is the '''Standby''' mode, where the content of all registers and internal memories is lost, apart from the one that are in V<sub>SW</sub> domain that is supplied by V<sub>DD</sub> (when present) or V<sub>BAT</sub> (in VBAT mode). In particular, notice that the Backup registers, the Backup RAM and the Retention RAM are in the V<sub>SW</sub> domain. Please also note that PWR and RCC both have some registers in the V<sub>SW</sub> (kept during Standby) and V<sub>DD</sub> (lost during Standby) domains. 
One or several '''wake-up source'''(s) are used to exit from the above low-power modes and come back to '''Run''' mode. Not all internal peripherals are able to wake up from low-power modes. Table ''Functionalities depending on system operating mode'' located in the PWR chapter of the [[STM32MP15 resources#Reference manuals|STM32MP15 Reference Manual]], shows the wake-up capability of each peripheral. This is summarized in the figure in the following paragraph.<br><br>

When the processor is put in one of these low-power modes, the '''external RAM (DDR)''' is usually put in '''Self-Refresh''' mode in order to keep its content whereas most of the STM32MP15 is no more active (no more clock generated for the DDR, no more Auto-refresh commands). This extra power consumption has to be considered at system level and depends on the selected DDR memory (refer to your memory provider datasheet).<br><br>

The main side effect of using low-power modes is the '''wake-up time''' required to restore the system to a full running state ('''Run''' mode): the deepest you slept and the longest it needs to wake up. The next chapter illustrates this in order to allow you to make the best choice for your product.<br><br>

Refer to the [[STM32MP15 resources#AN5109|AN5109]] document for a deeper explanation of the low-power mode characteristics and dynamics.<br>

Refer to the [[Power overview]] to discover the corresponding software architecture that enable using  those modes with OpenSTLinux.

==Low-power strategy==
===Overview===
The figure below shows, for each '''low-power mode''':
* The peripherals that can be used as '''wake-up sources''' (grey boxes)
* The STM32MP15 '''typical power consumption''' (on the left)
* The system '''wake -up times''' in various configurations (on the right)

{{ImageMap|Image: STM32MP15 low power modes.png {{!}} center {{!}} STM32MP15 low power modes
rect 3 1 145 135 [[STM32MP15 resources#AN5109|AN5109]]
rect 724 1 866 135 [[Power overview]]
rect 468 213 896 323 [[#Wake-up time interpretation|Wake up time interpretation]]
rect 63 213 402 322 [[#Power supplies|Power supplies]]
circle 436 222 197 [[#Low-power modes|Low power modes]]
}}

===Wake-up time interpretation===
{{Warning| External factors, such as a ONKEY that would be debounced before reaching the STM32MP15 wake up pin, may influence the measurements given in the figure above and must be taken into account:}}
* For '''Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-A7 core''':
** The wake-up times given in the above figure correspond to a typical OpenSTLinux distribution (around 7-Mbyte uImage, 500-Mbyte Weston rootfs, 30-second cold boot time)
* For the '''Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-M4 core''':
** The wake-up times correspond to the return to the software execution, so your application extra time has to be added to those figures, which are taken from the [[STM32MP15 resources#Datasheets|STM32MP15 datasheets]].
** The '''RETRAM''' and '''SRAM''' remain supplied in (LP-)Stop and LPLV-Stop modes, so the Cortex-M4 firmware code and data can use them.
** The '''RETRAM''' remains supplied in Standby mode, and can hence be used to store the code of a size limited firmware that would be executed at wake-up. Once woken up, the firmware can use again the SRAM for data storing and the application running on the Cortex-A7 core could even reload some services (code) in SRAM.
{{Info|The core that is started on '''wake up from Standby''' is selected thanks to the MPU_BEN (Cortex-A7) and MCU_BEN (Cortex-M4) bits in RCC_MP_BOOTCR.
* Disabling both MPU_BEN and MCU_BEN is equivalent to enabling MPU_BEN.
* '''Enabling MPU_BEN''' is the nominal case.
* Enabling MCU_BEN requires to be aware of the [[STM32MP15 resources#ES0438|ES0438]] errata sheet following items:
** RCC security settings for Cortex-M4 access are not kept upon wake up from Standby
** Wake-up pin flags cleared at Standby mode exit with MCU_BEN high and MPU_BEN low
* Enabling both MPU_BEN and MCU_BEN is not recommended because race condition may occur on shared resources between each core (Cortex-A7 boot chain, including the ROM code, and Cortex-M4 firmware)}}
<noinclude>

[[Category:How to design products with STM32 MPU]]
{{PublicationRequestId | 18173 |2020-11-19 | }}</noinclude>
Line 1: Line 1:
{{ArticleToRename | How to define your low-power strategy | TW review AJ w4820 | [[User:Gerald Baeza|Gerald Baeza]] ([[User talk:Gerald Baeza|talk]]) 16:54, 25 November 2020 (CET)}}
 
 
 
==Purpose==
 
==Purpose==
 
This article proposes some guidelines in order to determine the best low-power strategy for your STM32MP15 product.<br>
 
This article proposes some guidelines in order to determine the best low-power strategy for your STM32MP15 product.<br>