README.rst
1.. zephyr:code-sample:: stm32_pm_gpio_wkup_src
2 :name: GPIO as a wake-up pin source
3 :relevant-api: sys_poweroff gpio_interface
4
5 Use a GPIO as a wake-up pin source.
6
7Overview
8********
9
10This sample is a minimum application to demonstrate using a wake-up pin with a GPIO as
11a source to power on an STM32 SoC after Poweroff.
12
13The system will power off automatically ``WAIT_TIME_US`` us after boot.
14Press the user button designated in boards's devicetree overlay as "wkup-src" to power it on again.
15
16.. _gpio-as-a-wkup-pin-src-sample-requirements:
17
18Requirements
19************
20
21The SoC should support POWEROFF functionality & have a wake-up pin that corresponds
22to the GPIO pin of a user button.
23To support another board, add an overlay in boards folder.
24Make sure that wake-up pins are configured in SoC dtsi file.
25
26Building and Running
27********************
28
29Build and flash wkup_pins as follows, changing ``nucleo_u5a5zj_q`` for your board:
30
31.. zephyr-app-commands::
32 :zephyr-app: samples/boards/st/power_mgmt/wkup_pins
33 :board: nucleo_u5a5zj_q
34 :goals: build flash
35 :compact:
36
37After flashing, the LED in ON.
38The LED will be turned off when the system is powered off.
39Press the user button to power on the system again.
40