fix(psram): make IDF-15875 backport build clean on v5.5

Guard external-cache suspend for pure-ram apps where esp_cache_utils is
not linked, and move esp32p4-only xip_psram sdkconfig options into a
target-specific file to avoid unknown-kconfig failures on other chips.
This commit is contained in:
Michael.B
2026-08-27 03:41:30 +08:00
parent c8b2947a7a
commit 72b6e8e8e3
3 changed files with 8 additions and 3 deletions
@@ -99,9 +99,14 @@ void IRAM_ATTR esp_rtc_init(void)
*/
static void IRAM_ATTR esp_clk_cpu_freq_set_config_isolated(const rtc_cpu_freq_config_t *config)
{
/* esp_cache_utils.c is not built for pure-ram apps. */
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
esp_cache_suspend_ext_mem_cache();
#endif
rtc_clk_cpu_freq_set_config(config);
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
esp_cache_resume_ext_mem_cache();
#endif
}
__attribute__((weak)) void esp_clk_init(void)
@@ -2,10 +2,7 @@
# Places .ext_ram.bss in external PSRAM so a boot-time CPU frequency switch
# under PSRAM-XIP can be exercised; without the fix the external .bss is
# corrupted during boot.
# On esp32p4, CONFIG_CACHE_L2_CACHE_LINE_128B is required to reproduce.
CONFIG_CACHE_L2_CACHE_LINE_128B=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
CONFIG_SPIRAM_SPEED_250M=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
@@ -0,0 +1,3 @@
# On esp32p4, CONFIG_CACHE_L2_CACHE_LINE_128B is required to reproduce IDF-15875.
CONFIG_CACHE_L2_CACHE_LINE_128B=y
CONFIG_SPIRAM_SPEED_250M=y