From bc155478d01ffc5c784d2d8da4318509faf735da Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Thu, 20 Nov 2025 10:47:42 +0800 Subject: [PATCH] change(esp_hw_support): add kconfig option to put rtc clock module into iram --- components/esp_hw_support/Kconfig | 6 ++++++ components/esp_hw_support/linker.lf | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/esp_hw_support/Kconfig b/components/esp_hw_support/Kconfig index 2d4cf55755c..d0a0914af83 100644 --- a/components/esp_hw_support/Kconfig +++ b/components/esp_hw_support/Kconfig @@ -218,6 +218,12 @@ menu "Hardware Settings" menu "RTC Clock Config" orsource "./port/$IDF_TARGET/Kconfig.rtc" + + config RTC_CLK_FUNC_IN_IRAM + bool "Place RTC clock module functions into IRAM" + default y + help + Place RTC clock module (all rtc clock functions and const data) into IRAM. endmenu menu "Peripheral Control" diff --git a/components/esp_hw_support/linker.lf b/components/esp_hw_support/linker.lf index 6fb67bbb747..48ab825a3a6 100644 --- a/components/esp_hw_support/linker.lf +++ b/components/esp_hw_support/linker.lf @@ -13,15 +13,13 @@ entries: cpu: esp_cpu_compare_and_set (noflash) esp_memory_utils (noflash) clk_utils (noflash) - if IDF_TARGET_ESP32H4 = y || IDF_TARGET_ESP32H21 = y: - # IDF-13780 - rtc_clk (noflash) if PM_SLP_IRAM_OPT = y: - rtc_clk (noflash) rtc_time (noflash_text) esp_clk_tree: esp_clk_tree_enable_src (noflash) esp_clk_tree: esp_clk_tree_enable_power (noflash) esp_clk_tree: esp_clk_tree_is_power_on (noflash) + if RTC_CLK_FUNC_IN_IRAM = y: + rtc_clk (noflash) if IDF_TARGET_ESP32 = y: rtc_clk:rtc_clk_cpu_freq_to_pll_mhz (noflash) rtc_clk:rtc_clk_cpu_freq_to_xtal (noflash)