mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(mspi): fixed mspi dma burst timing issue
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "esp_private/esp_psram_extram.h"
|
||||
#include "esp_private/esp_mmu_map_private.h"
|
||||
#include "esp_private/esp_psram_impl.h"
|
||||
#include "esp_private/esp_psram_mspi.h"
|
||||
#include "esp_private/startup_internal.h"
|
||||
#if SOC_SPIRAM_XIP_SUPPORTED
|
||||
#include "esp_private/mmu_psram_flash.h"
|
||||
@@ -113,6 +114,8 @@ static const DRAM_ATTR char TAG[] = "esp_psram";
|
||||
|
||||
ESP_SYSTEM_INIT_FN(add_psram_to_heap, CORE, BIT(0), 103)
|
||||
{
|
||||
esp_err_t ret = ESP_FAIL;
|
||||
|
||||
#if CONFIG_SPIRAM_BOOT_INIT && (CONFIG_SPIRAM_USE_CAPS_ALLOC || CONFIG_SPIRAM_USE_MALLOC)
|
||||
|
||||
#if (CONFIG_IDF_TARGET_ESP32C5 && CONFIG_ESP32C5_REV_MIN_FULL <= 100) || (CONFIG_IDF_TARGET_ESP32C61 && CONFIG_ESP32C61_REV_MIN_FULL <= 100)
|
||||
@@ -120,17 +123,24 @@ ESP_SYSTEM_INIT_FN(add_psram_to_heap, CORE, BIT(0), 103)
|
||||
ESP_EARLY_LOGW(TAG, "Please avoid using PSRAM for security sensitive data e.g., TLS stack allocations (CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC)");
|
||||
#endif
|
||||
if (esp_psram_is_initialized()) {
|
||||
esp_err_t r = esp_psram_extram_add_to_heap_allocator();
|
||||
if (r != ESP_OK) {
|
||||
ret = esp_psram_extram_add_to_heap_allocator();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_EARLY_LOGE(TAG, "External RAM could not be added to heap!");
|
||||
abort();
|
||||
return ret;
|
||||
}
|
||||
#if CONFIG_SPIRAM_USE_MALLOC
|
||||
heap_caps_malloc_extmem_enable(CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return ESP_OK;
|
||||
|
||||
ret = esp_psram_mspi_mb_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_EARLY_LOGE(TAG, "Failed to initialize PSRAM MSPI memory barrier!");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
|
||||
Reference in New Issue
Block a user