Merge branch 'refactor/move_flash_error_code' into 'master'

refactor(flash): move flash error code to the driver layer

Closes IDF-15740

See merge request espressif/esp-idf!49140
This commit is contained in:
morris
2026-06-02 13:33:10 +08:00
8 changed files with 8 additions and 10 deletions

View File

@@ -38,5 +38,3 @@ idf_component_register(
REQUIRES soc hal esp_hal_gpspi esp_hal_clock # TODO: IDF-15106 remove esp_hal_clock dependency
PRIV_REQUIRES esp_hal_gpio
)
idf_define_esp_err_codes(HEADERS include/hal/esp_flash_err.h)

View File

@@ -6,9 +6,9 @@
#pragma once
#include <esp_types.h>
#include <esp_bit_defs.h>
#include "esp_flash_err.h"
#include "esp_types.h"
#include "esp_err.h"
#include "esp_bit_defs.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -71,8 +71,7 @@ static void PSRAM_ISR_ATTR mspi_psram_isr_handler_wrapper(void *arg)
uint32_t intr_events = psram_ctrlr_ll_get_intr_raw(PSRAM_CTRLR_LL_MSPI_ID_SYSTEM);
psram_ctrlr_ll_clear_intr(PSRAM_CTRLR_LL_MSPI_ID_SYSTEM, intr_events);
ESP_DRAM_LOGE(TAG, "MSPI PSRAM error");
ESP_DRAM_LOGD(TAG, "intr_events: 0x%" PRIx32, intr_events);
ESP_DRAM_LOGE(TAG, "MSPI PSRAM error, intr_events: 0x%" PRIx32, intr_events);
mspi_psram_isr_handler(arg, intr_events);

View File

@@ -72,7 +72,7 @@ idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS include
LDFRAGMENTS linker.lf)
idf_define_esp_err_codes(HEADERS include/spi_flash_mmap.h)
idf_define_esp_err_codes(HEADERS include/spi_flash_mmap.h include/esp_flash_err.h)
# Avoid cache miss by unexpected inlineing when built by -Os
set_source_files_properties(${cache_srcs} PROPERTIES COMPILE_FLAGS "-fno-inline-functions")

View File

@@ -9,6 +9,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "hal/spi_flash_types.h"
#include "esp_flash_err.h"
#include "esp_blockdev.h"
#include "esp_bit_defs.h"

View File

@@ -10,7 +10,7 @@
#include "esp_log.h"
#include "esp_memory_utils.h"
#include "hal/mspi_ll.h"
#include "esp_flash_err.h"
#include "esp_flash_partitions.h"
#include "esp_flash_chips/spi_flash_defs.h"
#include "esp_private/cache_utils.h"

View File

@@ -217,7 +217,6 @@ INPUT = \
$(PROJECT_PATH)/components/esp_hal_ledc/include/hal/ledc_types.h \
$(PROJECT_PATH)/components/esp_hal_parlio/include/hal/parlio_types.h \
$(PROJECT_PATH)/components/esp_hal_mcpwm/include/hal/mcpwm_types.h \
$(PROJECT_PATH)/components/esp_hal_mspi/include/hal/esp_flash_err.h \
$(PROJECT_PATH)/components/esp_hal_mspi/include/hal/spi_flash_types.h \
$(PROJECT_PATH)/components/esp_hal_pcnt/include/hal/pcnt_types.h \
$(PROJECT_PATH)/components/esp_hal_rmt/include/hal/rmt_types.h \
@@ -364,6 +363,7 @@ INPUT = \
$(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/uart_pins.h \
$(PROJECT_PATH)/components/spi_flash/include/esp_flash_spi_init.h \
$(PROJECT_PATH)/components/spi_flash/include/esp_flash.h \
$(PROJECT_PATH)/components/spi_flash/include/esp_flash_err.h \
$(PROJECT_PATH)/components/spi_flash/include/spi_flash_mmap.h \
$(PROJECT_PATH)/components/spi_flash/include/esp_spi_flash_counters.h \
$(PROJECT_PATH)/components/spiffs/include/esp_spiffs.h \