EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1042 background imageLoading...
Page #1042 background image
Chapter 2. API Reference
enabled). Maximum extra latency is 40 us (when frequency scaling is enabled, and a switch from 40 MHz to 80 MHz
is performed on interrupt entry).
Dynamic frequency scaling (DFS) and automatic light sleep can be enabled in an application by calling
the function esp_pm_configure(). Its argument is a structure defining the frequency scaling settings,
esp_pm_config_esp32s2_t. In this structure, three fields need to be initialized:
max_freq_mhz: Maximum CPU frequency in MHz, i.e., the frequency used when the
ESP_PM_CPU_FREQ_MAX lock is acquired. This field will usually be set to the default CPU frequency.
min_freq_mhz: Minimum CPU frequency in MHz, i.e., the frequency used when only the
ESP_PM_APB_FREQ_MAX lock is acquired. This field can be set to the XTAL frequency value, or the XTAL
frequency divided by an integer. Note that 10 MHz is the lowest frequency at which the default REF_TICK
clock of 1 MHz can be generated.
light_sleep_enable: Whether the system should automatically enter light sleep when no locks are
acquired (true/false).
Alternatively, if you enable the option CONFIG_PM_DFS_INIT_AUTO in menuconfig, the maximum CPU fre-
quency will be determined by the CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ setting, and the minimum
CPU frequency will be locked to the XTAL frequency.
Note: Automatic light sleep is based on FreeRTOS Tickless Idle functionality. If automatic light
sleep is requested while the option CONFIG_FREERTOS_USE_TICKLESS_IDLE is not enabled in menuconfig,
esp_pm_configure() will return the error ESP_ERR_NOT_SUPPORTED.
Note: In light sleep, peripherals are clock gated, and interrupts (from GPIOs and internal peripherals) will not be
generated. A wakeup source described in the Sleep Modes documentation can be used to trigger wakeup from the
light sleep state.
For example, the EXT0 and EXT1 wakeup sources can be used to wake up the chip via a GPIO.
Power Management Locks
Applications have the ability to acquire/release locks in order to control the power management algorithm. When an
application acquires a lock, the power management algorithm operation is restricted in a way described below. When
the lock is released, such restrictions are removed.
Power management locks have acquire/release counters. If the lock has been acquired a number of times, it needs to
be released the same number of times to remove associated restrictions.
ESP32-S2 supports three types of locks described in the table below.
Lock Description
ESP_PM_CPU_FREQ_MAX Requests CPU frequency to be at the maximum value set
with esp_pm_configure(). For ESP32-S2, this value can be set to
80 MHz, 160 MHz, or 240 MHz.
ESP_PM_APB_FREQ_MAX Requests the APB frequency to be at the maximum supported value. For
ESP32-S2, this is 80 MHz.
ESP_PM_NO_LIGHT_SLEEP Disables automatic switching to light sleep.
ESP32-S2 Power Management Algorithm
The table below shows how CPU and APB frequencies will be switched if dynamic frequency scaling is
enabled. You can specify the maximum CPU frequency with either esp_pm_configure() or CON-
FIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ.
Espressif Systems 1031
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish