From a82f33c9b5fb796b52095f233004794dc42752c8 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Fri, 16 Jul 2021 17:44:03 +0800 Subject: [PATCH] fix rtc register read error and add workaround for rtc bus isolate issue --- components/esp_hw_support/Kconfig | 4 ++++ components/esp_hw_support/sleep_modes.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/components/esp_hw_support/Kconfig b/components/esp_hw_support/Kconfig index 22b4b6a56f..bf8443b296 100644 --- a/components/esp_hw_support/Kconfig +++ b/components/esp_hw_support/Kconfig @@ -29,5 +29,9 @@ menu "Hardware Settings" This option will in fact consider VDD_SDIO auto power value (ESP_PD_OPTION_AUTO) as OFF. Also, it is possible to force a power domain to stay ON during light sleep by using esp_sleep_pd_config() function. + + config ESP_SLEEP_RTC_BUS_ISO_WORKAROUND + bool + default y if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 endmenu endmenu diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 2d3671d01f..ee68b21f0c 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -699,6 +699,10 @@ esp_err_t esp_light_sleep_start(void) // Decide which power domains can be powered down uint32_t pd_flags = get_power_down_flags(); +#ifdef CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND + pd_flags &= ~RTC_SLEEP_PD_RTC_PERIPH; +#endif + // Re-calibrate the RTC Timer clock #ifdef CONFIG_ESP_SYSTEM_RTC_EXT_XTAL uint64_t time_per_us = 1000000ULL;