From 5fe080ea5a04b8459c030ce7dab5c3cb4ca79150 Mon Sep 17 00:00:00 2001 From: Armando Date: Wed, 26 Jun 2024 16:05:44 +0800 Subject: [PATCH] fix(rtc): fixed non-iram rtc code in early stage on p4 leading xip_psram stuck --- components/esp_hw_support/linker.lf | 3 +++ components/esp_system/port/soc/esp32p4/clk.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/esp_hw_support/linker.lf b/components/esp_hw_support/linker.lf index 0ad8003c56..00bcae6634 100644 --- a/components/esp_hw_support/linker.lf +++ b/components/esp_hw_support/linker.lf @@ -21,6 +21,9 @@ entries: rtc_time (noflash_text) if SOC_PMU_SUPPORTED = y: pmu_sleep (noflash) + if SPIRAM_FLASH_LOAD_TO_PSRAM = y: + pmu_init (noflash) + pmu_param (noflash) if SOC_USB_SERIAL_JTAG_SUPPORTED = y: sleep_console (noflash) if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S2 = y: diff --git a/components/esp_system/port/soc/esp32p4/clk.c b/components/esp_system/port/soc/esp32p4/clk.c index 85332e67ae..49f9737e8e 100644 --- a/components/esp_system/port/soc/esp32p4/clk.c +++ b/components/esp_system/port/soc/esp32p4/clk.c @@ -41,7 +41,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); static const char *TAG = "clk"; -void esp_rtc_init(void) +void IRAM_ATTR esp_rtc_init(void) { #if SOC_PMU_SUPPORTED pmu_init();