README.rst
1.. zephyr:code-sample:: stm32_pm_adc
2 :name: ADC power management
3 :relevant-api: adc_interface
4
5 Use ADC in a low-power context on STM32.
6
7Overview
8********
9
10This sample is a minimum application to demonstrate basic power management
11behavior in a basic ADC set up in low power context.
12
13.. _stm32-pm-adc-sample-requirements:
14
15Requirements
16************
17
18The board should support enabling PM. For a STM32 based target, it means that
19it should support a clock source alternative to Cortex Systick that can be used
20in core sleep states, as LPTIM (:dtcompatible:`st,stm32-lptim`).
21
22Building and Running
23********************
24
25Build and flash as follows, changing ``nucleo_wb55rg`` for your board:
26
27.. zephyr-app-commands::
28 :zephyr-app: samples/boards/st/power_mgmt/adc
29 :board: nucleo_wb55rg
30 :goals: build flash
31 :compact:
32
33After flashing, the console shows the ADC measurement in the form:
34``ADC reading[0]:``
35``- adc@50040000, channel 3: 1158 = 932 mV``
36
37PM configurations
38*****************
39
40By default, :kconfig:option:`CONFIG_PM_DEVICE` and :kconfig:option:`CONFIG_PM_DEVICE_RUNTIME` are
41enabled.
42On STM32WB, we can observe a power consumption of about 25µA with both kconfig
43enabled, 27.5µA without (each time with :kconfig:option:`CONFIG_PM` enabled).
44