Coprocessor power management

来自百问网嵌入式Linux wiki
Zhouyuebiao讨论 | 贡献2020年5月8日 (五) 23:13的版本 (创建页面,内容为“==Article purpose== The purpose of this article is to give an overview of the software APIs available on the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 (also nam…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Article purpose

The purpose of this article is to give an overview of the software APIs available on the Arm® Cortex®-M4 (also named MCU) side to handle the low power modes.

Low power modes available on the chip

Refer to STM32MP15 reference manuals for the full description of the modes.
The AN5109 low power application note also gives details on these modes.

The modes are handled by RCC and PWR peripherals.


The table below explains the chip hardware states corresponding to each low power mode.

Subsystem either refers to Arm® Cortex®-A7 side (also called MPU) or Arm® Cortex®-M4 side (also called MCU). A mode prefixed by 'C' refers to a subsystem mode.

A platform mode is the combination of MPU and MCU modes.

Level Mode Vddcore state Clocks state
Subsystem MPU CRun on on
MPU CStop on Subsystem off
MPU CStandby on Subsystem off
MCU CRun on on
MCU CStop on Subsystem off
MPU mode MCU mode Platform mode Vddcore state Clocks state
CRun CRun Run On On
CStop CRun Run On On
CStandby CRun Run On On
CRun CStop Run On On
CStop CStop Stop/LPLV-Stop/Standby On/Retention/Off Off/Off/Off
CStandby CStop Stop/LPLV-Stop/Standby On/Retention/Off Off/Off/Off

Wakeup sources

The above modes are left due to a wakeup event.

The following table gives the list of wakeup sources available in each mode.

Mode Available wakeup sources
CStop/CStandby/Stop BOR, PVD, AVD, Vbat mon, Temp mon, LSE CSS, RTC, TAMP, USB, CEC, ETH, USART, I²C, SPI, LPTIM, IWDG, GPIO, Wakeup pins
LPLV-Stop BOR, PVD, AVD, Vbat mon, Temp mon, LSE CSS, RTC, TAMP, IWDG, GPIO, Wakeup pins
Standby BOR, Vbat mon, Temp mon, LSE CSS, RTC, TAMP, IWDG, Wakeup pins

<securetransclude src="ProtectedTemplate:ReviewsComments" params="BPU W1929: How to set a wakeup source on MCU side ?"></securetransclude>{{#set:Has reviews comments=true}}

Software overview

The power HAL is used to select the Cortex-M4 low power mode.

Further information on HAL can be found here: STM32CubeMP1 architecture

<securetransclude src="ProtectedTemplate:ReviewsComments" params="BPU W1929: Could we mention also the access through the RPMSG ? (ex: /sys/class/remoteproc/remoteproc0/state) ?"></securetransclude>{{#set:Has reviews comments=true}}

APIs description

The power HAL supports the following APIs related to power management:

 HAL_PWR_EnterSLEEPMode: CSleep mode is entered
 HAL_PWR_EnterStopMode: CStop mode is entered allowing Stop as the deepest platform low power mode 
 HAL_PWR_EnterStandbyMode: CStop mode is entered allowing Standby as the deepest platform low power mode

Code source location

STM32CubeMP1 Package provides power HAL driver:
Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pwr.c| |}} Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pwr.c <securetransclude src="ProtectedTemplate:PublicationRequestId" params="10389 | 2019-01-21 | AlainF"></securetransclude>