esp_flash_err.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include "esp_err.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /*
  13. * Possible errors returned from esp flash internal functions, these error codes
  14. * should be consistent with esp_err_t codes. But in order to make the source
  15. * files less dependent to esp_err_t, they use the error codes defined in this
  16. * replacable header. This header should ensure the consistency to esp_err_t.
  17. */
  18. enum {
  19. /* These codes should be consistent with esp_err_t errors. However, error codes with the same values are not
  20. * allowed in ESP-IDF. This is a workaround in order to not introduce a dependency between the "soc" and
  21. * "esp_common" components. The disadvantage is that the output of esp_err_to_name(ESP_ERR_FLASH_SIZE_NOT_MATCH)
  22. * will be ESP_ERR_INVALID_SIZE. */
  23. ESP_ERR_FLASH_SIZE_NOT_MATCH = ESP_ERR_INVALID_SIZE, ///< The chip doesn't have enough space for the current partition table
  24. ESP_ERR_FLASH_NO_RESPONSE = ESP_ERR_INVALID_RESPONSE, ///< Chip did not respond to the command, or timed out.
  25. };
  26. //The ROM code has already taken 1 and 2, to avoid possible conflicts, start from 3.
  27. #define ESP_ERR_FLASH_NOT_INITIALISED (ESP_ERR_FLASH_BASE+3) ///< esp_flash_chip_t structure not correctly initialised by esp_flash_init().
  28. #define ESP_ERR_FLASH_UNSUPPORTED_HOST (ESP_ERR_FLASH_BASE+4) ///< Requested operation isn't supported via this host SPI bus (chip->spi field).
  29. #define ESP_ERR_FLASH_UNSUPPORTED_CHIP (ESP_ERR_FLASH_BASE+5) ///< Requested operation isn't supported by this model of SPI flash chip.
  30. #define ESP_ERR_FLASH_PROTECTED (ESP_ERR_FLASH_BASE+6) ///< Write operation failed due to chip's write protection being enabled.
  31. #ifdef __cplusplus
  32. }
  33. #endif