feat(mspi): added mspi flash error (aligned with rom)

This commit is contained in:
armando
2026-06-05 11:34:11 +08:00
committed by Armando (Dou Yiwen)
parent 77807bfe6e
commit 90dd358dcb
6 changed files with 27 additions and 6 deletions

View File

@@ -13,8 +13,8 @@
#include "hal/efuse_ll.h"
#include "hal/efuse_hal.h"
#include "hal/spi_flash_types.h"
#include "hal/esp_flash_err.h"
#include "spi_flash_defs.h"
#include "spi_flash_err.h"
#if !NON_OS_BUILD
#include "spi_flash_mmap.h"

View File

@@ -83,6 +83,8 @@ idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS ${include_dirs}
LDFRAGMENTS ${ldfragments})
idf_define_esp_err_codes(HEADERS include/spi_flash_err.h)
if(NOT non_os_build AND NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP)
if(CONFIG_SPIRAM)
# esp_mspi_get_io() queries esp_psram_io_get_cs_io() for the PSRAM CS pin

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ESP_ERR_FLASH_OP_FAIL (ESP_ERR_FLASH_BASE+1) ///< aligned with rom
#define ESP_ERR_FLASH_OP_TIMEOUT (ESP_ERR_FLASH_BASE+2) ///< aligned with rom
#ifdef __cplusplus
}
#endif

View File

@@ -6,8 +6,7 @@ if(${target} STREQUAL "linux")
"linux/flash_mmap.c"
"spi_flash_blockdev.c"
INCLUDE_DIRS include
REQUIRES esp_hal_mspi esp_blockdev
PRIV_REQUIRES esp_mspi)
REQUIRES esp_hal_mspi esp_mspi esp_blockdev)
return()
endif()

View File

@@ -8,6 +8,7 @@
#include <stdint.h>
#include "esp_err.h"
#include "spi_flash_err.h"
#ifdef __cplusplus
extern "C" {
@@ -30,8 +31,6 @@ enum {
};
//The ROM code has already taken 1 and 2, to avoid possible conflicts, start from 3.
#define ESP_ERR_FLASH_OP_FAIL (ESP_ERR_FLASH_BASE+1) ///< aligned with rom
#define ESP_ERR_FLASH_OP_TIMEOUT (ESP_ERR_FLASH_BASE+2) ///< aligned with rom
#define ESP_ERR_FLASH_NOT_INITIALISED (ESP_ERR_FLASH_BASE+3) ///< esp_flash_chip_t structure not correctly initialised by esp_flash_init().
#define ESP_ERR_FLASH_UNSUPPORTED_HOST (ESP_ERR_FLASH_BASE+4) ///< Requested operation isn't supported via this host SPI bus (chip->spi field).
#define ESP_ERR_FLASH_UNSUPPORTED_CHIP (ESP_ERR_FLASH_BASE+5) ///< Requested operation isn't supported by this model of SPI flash chip.

View File

@@ -21,7 +21,7 @@
#include "esp_attr.h"
#include "sdkconfig.h"
#include "esp_spi_flash_counters.h"
#include "hal/esp_flash_err.h"
#include "esp_flash_err.h"
#ifdef __cplusplus
extern "C" {