fix(esp_pm): fix psram access faild after pd_cpu wakeup

This commit is contained in:
wuzhenghui
2023-11-09 14:00:05 +08:00
committed by BOT
parent 841d75b3a3
commit c570105f36
2 changed files with 13 additions and 4 deletions

View File

@@ -439,8 +439,11 @@ esp_err_t esp_pm_configure(const void* vconfig)
min_freq_mhz,
config->light_sleep_enable ? "ENABLED" : "DISABLED");
portENTER_CRITICAL(&s_switch_lock);
// CPU & Modem power down initialization, which must be initialized before s_light_sleep_en set true,
// to avoid entering idle and sleep in this function.
esp_pm_sleep_configure(config);
portENTER_CRITICAL(&s_switch_lock);
bool res __attribute__((unused));
res = rtc_clk_cpu_freq_mhz_to_config(max_freq_mhz, &s_cpu_freq_by_mode[PM_MODE_CPU_MAX]);
assert(res);
@@ -453,8 +456,6 @@ esp_err_t esp_pm_configure(const void* vconfig)
s_config_changed = true;
portEXIT_CRITICAL(&s_switch_lock);
esp_pm_sleep_configure(config);
return ESP_OK;
}