diff --git a/components/esp_system/port/soc/esp32c5/clk.c b/components/esp_system/port/soc/esp32c5/clk.c index 32176e77f9..7c9aa3259f 100644 --- a/components/esp_system/port/soc/esp32c5/clk.c +++ b/components/esp_system/port/soc/esp32c5/clk.c @@ -96,7 +96,9 @@ __attribute__((weak)) void esp_clk_init(void) rtc_clk_fast_src_set(SOC_RTC_FAST_CLK_SRC_RC_FAST); #elif CONFIG_RTC_FAST_CLK_SRC_XTAL rtc_clk_fast_src_set(SOC_RTC_FAST_CLK_SRC_XTAL); - esp_sleep_sub_mode_config(ESP_SLEEP_RTC_FAST_USE_XTAL_MODE, true); + if (esp_sleep_sub_mode_dump_config(NULL)[ESP_SLEEP_RTC_FAST_USE_XTAL_MODE] == 0) { + esp_sleep_sub_mode_config(ESP_SLEEP_RTC_FAST_USE_XTAL_MODE, true); + } #else #error "No RTC fast clock source configured" #endif diff --git a/components/esp_system/port/soc/esp32p4/clk.c b/components/esp_system/port/soc/esp32p4/clk.c index bbefdaa9cd..c9f5440954 100644 --- a/components/esp_system/port/soc/esp32p4/clk.c +++ b/components/esp_system/port/soc/esp32p4/clk.c @@ -95,7 +95,9 @@ __attribute__((weak)) void esp_clk_init(void) rtc_clk_fast_src_set(SOC_RTC_FAST_CLK_SRC_RC_FAST); #elif CONFIG_RTC_FAST_CLK_SRC_XTAL rtc_clk_fast_src_set(SOC_RTC_FAST_CLK_SRC_XTAL); - esp_sleep_sub_mode_config(ESP_SLEEP_RTC_FAST_USE_XTAL_MODE, true); + if (esp_sleep_sub_mode_dump_config(NULL)[ESP_SLEEP_RTC_FAST_USE_XTAL_MODE] == 0) { + esp_sleep_sub_mode_config(ESP_SLEEP_RTC_FAST_USE_XTAL_MODE, true); + } #else #error "No RTC fast clock source configured" #endif