Skip to content

Commit 35cdecb

Browse files
committed
Merge branch 'fix/fix_pm_trace_rtc_domain_keeping' into 'master'
fix(esp_pm): enable RTC_PERIPH domain once in esp_pm_trace_init See merge request espressif/esp-idf!35979
2 parents 55955a5 + a48dfae commit 35cdecb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

components/esp_pm/pm_impl.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,6 @@ void IRAM_ATTR vApplicationSleep( TickType_t xExpectedIdleTime )
824824
#endif
825825
if (sleep_time_us >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP * portTICK_PERIOD_MS * 1000LL) {
826826
esp_sleep_enable_timer_wakeup(sleep_time_us - LIGHT_SLEEP_EARLY_WAKEUP_US);
827-
#if CONFIG_PM_TRACE && SOC_PM_SUPPORT_RTC_PERIPH_PD
828-
/* to force tracing GPIOs to keep state */
829-
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
830-
#endif
831827
/* Enter sleep */
832828
ESP_PM_TRACE_ENTER(SLEEP, core_id);
833829
int64_t sleep_start = esp_timer_get_time();

components/esp_pm/pm_trace.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
2-
* SPDX-FileCopyrightText: 2016-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2016-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
#include "esp_attr.h"
8+
#include "esp_sleep.h"
89
#include "esp_private/pm_trace.h"
910
#include "driver/gpio.h"
1011
#include "soc/soc.h"
@@ -55,6 +56,10 @@ void esp_pm_trace_init(void)
5556
}
5657
gpio_set_direction(io - 1, GPIO_MODE_OUTPUT);
5758
}
59+
#if SOC_PM_SUPPORT_RTC_PERIPH_PD
60+
/* to force tracing GPIOs to keep state */
61+
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
62+
#endif
5863
}
5964

6065
void IRAM_ATTR esp_pm_trace_enter(esp_pm_trace_event_t event, int core_id)

0 commit comments

Comments
 (0)