Merge branch 'contrib/github_pr_18705' into 'master'

esp_psram: Set missing PSRAM errors to warnings if "ignore not found" is configured. (GitHub PR)

Closes IDFGH-17789

See merge request espressif/esp-idf!49503
This commit is contained in:
C.S.M
2026-06-11 10:23:29 +08:00
7 changed files with 13 additions and 6 deletions
@@ -462,7 +462,7 @@ esp_err_t esp_psram_impl_enable(void)
s_init_psram_mode_reg(PSRAM_CTRLR_LL_MSPI_ID_3, &mode_reg);
if (s_check_psram_connected(PSRAM_CTRLR_LL_MSPI_ID_3) != ESP_OK) {
ESP_EARLY_LOGE(TAG, "PSRAM chip is not connected");
PSRAM_LOG_NOTFOUND(TAG, "PSRAM chip is not connected");
return ESP_ERR_NOT_SUPPORTED;
}
@@ -356,7 +356,7 @@ esp_err_t esp_psram_impl_enable(void)
psram_disable_qio_mode(PSRAM_CTRLR_LL_MSPI_ID_1);
if (s_check_psram_connected(PSRAM_CTRLR_LL_MSPI_ID_1) != ESP_OK) {
ESP_EARLY_LOGE(TAG, "PSRAM chip is not connected, or wrong PSRAM line mode");
PSRAM_LOG_NOTFOUND(TAG, "PSRAM chip is not connected, or wrong PSRAM line mode");
return ESP_ERR_NOT_SUPPORTED;
}
@@ -36,6 +36,13 @@ extern "C" {
#define PSRAM_HALFSLEEP_RESUME_CODE_ATTR
#endif
// Downgrade "PSRAM not found" errors to warning if ignoring missing SPIRAM
#if CONFIG_SPIRAM_IGNORE_NOTFOUND
#define PSRAM_LOG_NOTFOUND ESP_EARLY_LOGW
#else
#define PSRAM_LOG_NOTFOUND ESP_EARLY_LOGE
#endif
/**
* @brief To get the physical psram size in bytes.
*
@@ -988,7 +988,7 @@ esp_err_t IRAM_ATTR esp_psram_impl_enable(void) //psram init
*/
psram_read_id(spi_num, &s_psram_id);
if (!PSRAM_IS_VALID(s_psram_id)) {
ESP_EARLY_LOGE(TAG, "PSRAM ID read error: 0x%08" PRIx32 ", PSRAM chip not found or not supported", (uint32_t)s_psram_id);
PSRAM_LOG_NOTFOUND(TAG, "PSRAM ID read error: 0x%08" PRIx32 ", PSRAM chip not found or not supported", (uint32_t)s_psram_id);
return ESP_ERR_NOT_SUPPORTED;
}
}
@@ -359,7 +359,7 @@ esp_err_t esp_psram_impl_enable(void)
s_init_psram_mode_reg(1, &mode_reg);
if (s_check_psram_connected(1) != ESP_OK) {
ESP_EARLY_LOGE(TAG, "PSRAM chip is not connected, or wrong PSRAM line mode");
PSRAM_LOG_NOTFOUND(TAG, "PSRAM chip is not connected, or wrong PSRAM line mode");
return ESP_ERR_NOT_SUPPORTED;
}
@@ -219,7 +219,7 @@ static esp_err_t s_psram_chip_init(void)
ret = esp_psram_impl_enable();
if (ret != ESP_OK) {
#if CONFIG_SPIRAM_IGNORE_NOTFOUND
ESP_EARLY_LOGE(TAG, "PSRAM enabled but initialization failed. Bailing out.");
ESP_EARLY_LOGW(TAG, "PSRAM enabled but initialization failed. Bailing out.");
#endif
return ret;
}
+1 -1
View File
@@ -657,7 +657,7 @@ MSPI_INIT_ATTR void mspi_init(void)
#if CONFIG_SPIRAM_BOOT_HW_INIT
if (esp_psram_chip_init() != ESP_OK) {
#if CONFIG_SPIRAM_IGNORE_NOTFOUND
ESP_DRAM_LOGE(TAG, "Failed to init external RAM; continuing without it.");
ESP_DRAM_LOGW(TAG, "Failed to init external RAM; continuing without it.");
#else
ESP_DRAM_LOGE(TAG, "Failed to init external RAM!");
abort();