Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,63 @@ ostest

Runs OS tests from ``apps/testing/ostest``.

pm
-------

This config demonstrate the use of power management.
You can use the ``pmconfig`` command to check current power state and time spent in other power states.
Also you can define time will spend in standby and sleep modes::

$ make menuconfig
-> Board Selection
-> (15) PM_STANDBY delay (seconds)
(0) PM_STANDBY delay (nanoseconds)
(20) PM_SLEEP delay (seconds)
(0) PM_SLEEP delay (nanoseconds)

Timer wakeup is not only way to wake up the chip. Other wakeup modes include:

- EXT1 wakeup mode: Uses RTC GPIO pins to wake up the chip. Enabled with ``CONFIG_PM_EXT1_WAKEUP`` option.
- GPIO wakeup mode: Uses GPIO pins to wakeup the chip. Only wakes up the chip from ``PM_STANDBY`` mode and requires ``CONFIG_PM_GPIO_WAKEUP``.
- UART wakeup mode: Uses UART to wakeup the chip. Only wakes up the chip from ``PM_STANDBY`` mode and requires ``CONFIG_PM_GPIO_WAKEUP``.

Before switching PM status, you need to query the current PM status to call correct number of relax command to correct modes::

nsh> pmconfig
Last state 0, Next state 0

/proc/pm/state0:
DOMAIN0 WAKE SLEEP TOTAL
normal 0s 00% 0s 00% 0s 00%
idle 0s 00% 0s 00% 0s 00%
standby 0s 00% 0s 00% 0s 00%
sleep 0s 00% 0s 00% 0s 00%

/proc/pm/wakelock0:
DOMAIN0 STATE COUNT TIME
system normal 2 1s
system idle 1 1s
system standby 1 1s
system sleep 1 1s

In this case, needed commands to switch the system into PM idle mode::

nsh> pmconfig relax normal
nsh> pmconfig relax normal

In this case, needed commands to switch the system into PM standby mode::

nsh> pmconfig relax idle
nsh> pmconfig relax normal
nsh> pmconfig relax normal

System switch to the PM sleep mode, you need to enter::

nsh> pmconfig relax standby
nsh> pmconfig relax idle
nsh> pmconfig relax normal
nsh> pmconfig relax normal

pwm
---

Expand Down
181 changes: 178 additions & 3 deletions arch/risc-v/src/common/espressif/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -816,25 +816,200 @@ config PM_GPIO_WAKEUP_GPIO27

config PM_GPIO_WAKEUP_GPIO28
bool "GPIO28"
depends on ARCH_CHIP_ESP32C6
depends on ARCH_CHIP_ESP32C6 || ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO28 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO29
bool "GPIO29"
depends on ARCH_CHIP_ESP32C6
depends on ARCH_CHIP_ESP32C6 || ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO29 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO30
bool "GPIO30"
depends on ARCH_CHIP_ESP32C6
depends on ARCH_CHIP_ESP32C6 || ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO30 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO31
bool "GPIO31"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO31 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO32
bool "GPIO32"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO32 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO33
bool "GPIO33"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO33 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO34
bool "GPIO34"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO34 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO35
bool "GPIO35"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO35 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO36
bool "GPIO36"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO36 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO37
bool "GPIO37"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO37 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO38
bool "GPIO38"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO38 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO39
bool "GPIO39"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO39 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO40
bool "GPIO40"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO40 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO41
bool "GPIO41"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO41 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO42
bool "GPIO42"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO42 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO43
bool "GPIO43"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO43 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO44
bool "GPIO44"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO44 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO45
bool "GPIO45"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO45 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO46
bool "GPIO46"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO46 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO47
bool "GPIO47"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO47 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO48
bool "GPIO48"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO48 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO49
bool "GPIO49"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO49 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO50
bool "GPIO50"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO50 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO51
bool "GPIO51"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO51 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO52
bool "GPIO52"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO52 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO53
bool "GPIO53"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO53 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO54
bool "GPIO54"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO54 as an GPIO wakeup source.

config PM_GPIO_WAKEUP_GPIO55
bool "GPIO55"
depends on ARCH_CHIP_ESP32P4
default n
---help---
Enable GPIO55 as an GPIO wakeup source.

choice PM_GPIO_WAKEUP_TRIGGER_MODE
prompt "PM GPIO Wakeup Trigger Mode"
default PM_GPIO_WAKEUP_TRIGGER_ANY_LOW
Expand Down
1 change: 1 addition & 0 deletions arch/risc-v/src/common/espressif/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ include common$(DELIM)espressif$(DELIM)Bootloader.mk
# Silent preprocessor warnings

CFLAGS += -Wno-shadow -Wno-undef -Wno-unused-variable -fno-jump-tables -fno-tree-switch-conversion -Wno-deprecated-declarations
AFLAGS += -Wno-undef

# Remove quotes from CONFIG_ESPRESSIF_CHIP_SERIES configuration

Expand Down
Loading
Loading