diff --git a/components/openthread/src/port/esp_openthread_sleep.c b/components/openthread/src/port/esp_openthread_sleep.c index a5381625ca..8ca7504a6f 100644 --- a/components/openthread/src/port/esp_openthread_sleep.c +++ b/components/openthread/src/port/esp_openthread_sleep.c @@ -19,10 +19,12 @@ esp_err_t esp_openthread_sleep_init(void) { esp_err_t err = ESP_OK; - err = esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "ieee802154", &s_pm_lock); + // Here we use APB_MAX because modem requires MODEM_REQUIRED_MIN_APB_CLK_FREQ. + // No need for CPU_MAX to reduce current consumption during Rx window. + err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "ot_sleep", &s_pm_lock); if (err == ESP_OK) { esp_pm_lock_acquire(s_pm_lock); - ESP_LOGI(TAG, "Enable ieee802154 light sleep, the wake up source is ESP timer"); + ESP_LOGI(TAG, "Enable OpenThread light sleep, the wake up source is ESP timer"); } else { if (s_pm_lock != NULL) { esp_pm_lock_delete(s_pm_lock); diff --git a/examples/openthread/ot_sleepy_device/light_sleep/main/esp_ot_sleepy_device.c b/examples/openthread/ot_sleepy_device/light_sleep/main/esp_ot_sleepy_device.c index a7600f9c9a..d4e1892273 100644 --- a/examples/openthread/ot_sleepy_device/light_sleep/main/esp_ot_sleepy_device.c +++ b/examples/openthread/ot_sleepy_device/light_sleep/main/esp_ot_sleepy_device.c @@ -25,6 +25,7 @@ #include "esp_openthread_netif_glue.h" #include "esp_ot_sleepy_device_config.h" #include "esp_vfs_eventfd.h" +#include "esp_private/esp_clk.h" #include "driver/uart.h" #include "nvs_flash.h" #include "openthread/logging.h" @@ -192,7 +193,7 @@ static esp_err_t ot_power_save_init(void) esp_pm_config_t pm_config = { .max_freq_mhz = cur_cpu_freq_mhz, - .min_freq_mhz = cur_cpu_freq_mhz, + .min_freq_mhz = esp_clk_xtal_freq() / MHZ, #if CONFIG_FREERTOS_USE_TICKLESS_IDLE .light_sleep_enable = true #endif