From ff0a0951efae1d4c72c1ac68b023d574d21a8178 Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Wed, 8 Mar 2023 01:32:11 +0800 Subject: [PATCH] esp_psram: Use efuse_ll instead of efuse API When the virt efuse mode is on and psram is on as well then efuse buffer is not filled by efuses (it is filled by 0). So the psram init func gets wrong pkg_ver = 0. Closes https://github.com/espressif/esp-idf/issues/10925 Close IDFGH-9576 --- components/esp32/spiram_psram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp32/spiram_psram.c b/components/esp32/spiram_psram.c index c2ee78e7e9..d64c49ef1f 100644 --- a/components/esp32/spiram_psram.c +++ b/components/esp32/spiram_psram.c @@ -35,6 +35,7 @@ #include "soc/chip_revision.h" #include "driver/gpio.h" #include "hal/efuse_hal.h" +#include "hal/efuse_ll.h" #include "hal/gpio_hal.h" #include "driver/spi_common_internal.h" #include "driver/periph_ctrl.h" @@ -831,7 +832,7 @@ bool psram_is_32mbit_ver0(void) esp_err_t IRAM_ATTR psram_enable(psram_cache_mode_t mode, psram_vaddr_mode_t vaddrmode) //psram init { psram_io_t psram_io={0}; - uint32_t pkg_ver = esp_efuse_get_pkg_ver(); + uint32_t pkg_ver = efuse_ll_get_chip_ver_pkg(); if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5) { ESP_EARLY_LOGI(TAG, "This chip is ESP32-D2WD"); rtc_vddsdio_config_t cfg = rtc_vddsdio_get_config();