When power management is enabled, the peripheral bus (APB) frequency and CPU frequency may change during operation. This process is called Dynamic Frequency Scaling (DFS). When DFS is enabled, the APB frequency can be changed multiple times within a single RTOS tick. The APB frequency change does not affect the operation of some peripherals, while other peripherals may have issues. For example, Timer Group peripheral timers will keep counting, however, the speed at which they count will change proportionally to the APB frequency. Therefore, developers should understand which peripherals will be affected by DFS and which peripherals will not. With the continuous improvement of ESP-IDF development, more and more peripheral drivers will not be affected by DFS.
The following peripherals are not affected by DFS when clocked from a specific clock source:
REF_TICKis used as the clock source, UART is not affected by DFS. Otherwise, it will be affected by DFS.
REF_TICKis used as the clock source, LEDC is not affected by DFS. Otherwise, it will be affected by DFS.
REF_TICKor XTAL is used as the clock source, RMT is not affected by DFS.
Currently, the following peripheral drivers are not affected by DFS.
These drivers will acquire the
ESP_PM_APB_FREQ_MAX lock for the
duration of the transaction and release the lock upon the completion of
the the transaction automatically.
I2S (if an APLL clock is used, I2S acquires
ESP_PM_NO_LIGHT_SLEEPpower management lock.)
SPI slave: between calls to
spi_slave_free(), SPI slave is not affected by DFS.
Wi-Fi: between calls to
esp_wifi_stop(), Wi-Fi is not affected by DFS. In Modem-sleep mode, when Wi-Fi is enabled, the chip releases the
ESP_PM_APB_FREQ_MAXpower management lock upon turning off the RF module.
TWAI: between calls to
twai_driver_uninstall(), TWAI is not affected by DFS.
Bluetooth: between calls to
esp_bt_controller_disable(), Bluetooth is not affected by DFS. In Modem-sleep mode, when Bluetooth is enabled, the chip releases
ESP_PM_APB_FREQ_MAXpower management lock upon turning off the RF module, but still holds the
ESP_PM_NO_LIGHT_SLEEPpower management lock unless
CONFIG_BTDM_CTRL_LOW_POWER_CLOCKis configured to the 32 kHz external crystal oscillator.
The following peripheral drivers are affected by DFS, so applications need to acquire or release locks themselves.
- Timer Group