mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_deep_sleep_crash_when_psram_high_freq_5.0' into 'release/v5.0'
mspi: turn down freq to fix crash when sleep (v5.0) See merge request espressif/esp-idf!22841
This commit is contained in:
commit
d8d6d3da5b
@ -65,6 +65,7 @@
|
||||
#include "esp32s3/rom/rtc.h"
|
||||
#include "soc/extmem_reg.h"
|
||||
#include "esp_private/sleep_mac_bb.h"
|
||||
#include "esp_private/spi_flash_os.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
#include "esp32c3/rom/cache.h"
|
||||
#include "esp32c3/rom/rtc.h"
|
||||
@ -415,6 +416,11 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
|
||||
pd_flags &= ~RTC_SLEEP_PD_INT_8M;
|
||||
}
|
||||
|
||||
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
||||
// Turn down mspi clock speed
|
||||
spi_timing_change_speed_mode_cache_safe(true);
|
||||
#endif
|
||||
|
||||
// Save current frequency and switch to XTAL
|
||||
rtc_cpu_freq_config_t cpu_freq_config;
|
||||
rtc_clk_cpu_freq_get_config(&cpu_freq_config);
|
||||
@ -549,6 +555,11 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
|
||||
// Restore CPU frequency
|
||||
rtc_clk_cpu_freq_set_config(&cpu_freq_config);
|
||||
|
||||
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
||||
// Restore mspi clock freq
|
||||
spi_timing_change_speed_mode_cache_safe(false);
|
||||
#endif
|
||||
|
||||
if (!deep_sleep) {
|
||||
s_config.ccount_ticks_record = esp_cpu_get_cycle_count();
|
||||
misc_modules_wake_prepare();
|
||||
|
Loading…
Reference in New Issue
Block a user