Error Codes Reference

This section lists various error code constants defined in ESP-IDF.

For general information about error codes in ESP-IDF, see Error Handling.

ESP_FAIL (-1): Generic esp_err_t code indicating failure

ESP_OK (0): esp_err_t value indicating success (no error)

ESP_ERR_NO_MEM (0x101): Out of memory

ESP_ERR_INVALID_ARG (0x102): Invalid argument

ESP_ERR_INVALID_STATE (0x103): Invalid state

ESP_ERR_INVALID_SIZE (0x104): Invalid size

ESP_ERR_NOT_FOUND (0x105): Requested resource not found

ESP_ERR_NOT_SUPPORTED (0x106): Operation or feature not supported

ESP_ERR_TIMEOUT (0x107): Operation timed out

ESP_ERR_INVALID_RESPONSE (0x108): Received response was invalid

ESP_ERR_INVALID_CRC (0x109): CRC or checksum was invalid

ESP_ERR_INVALID_VERSION (0x10a): Version was invalid

ESP_ERR_INVALID_MAC (0x10b): MAC address was invalid

ESP_ERR_NVS_BASE (0x1100): Starting number of error codes

ESP_ERR_NVS_NOT_INITIALIZED (0x1101): The storage driver is not initialized

ESP_ERR_NVS_NOT_FOUND (0x1102): Id namespace doesn’t exist yet and mode is NVS_READONLY

ESP_ERR_NVS_TYPE_MISMATCH (0x1103): The type of set or get operation doesn’t match the type of value stored in NVS

ESP_ERR_NVS_READ_ONLY (0x1104): Storage handle was opened as read only

ESP_ERR_NVS_NOT_ENOUGH_SPACE (0x1105): There is not enough space in the underlying storage to save the value

ESP_ERR_NVS_INVALID_NAME (0x1106): Namespace name doesn’t satisfy constraints

ESP_ERR_NVS_INVALID_HANDLE (0x1107): Handle has been closed or is NULL

ESP_ERR_NVS_REMOVE_FAILED (0x1108): The value wasn’t updated because flash write operation has failed. The value was written however, and update will be finished after re-initialization of nvs, provided that flash operation doesn’t fail again.

ESP_ERR_NVS_KEY_TOO_LONG (0x1109): Key name is too long

ESP_ERR_NVS_PAGE_FULL (0x110a): Internal error; never returned by nvs API functions

ESP_ERR_NVS_INVALID_STATE (0x110b): NVS is in an inconsistent state due to a previous error. Call nvs_flash_init and nvs_open again, then retry.

ESP_ERR_NVS_INVALID_LENGTH (0x110c): String or blob length is not sufficient to store data

ESP_ERR_NVS_NO_FREE_PAGES (0x110d): NVS partition doesn’t contain any empty pages. This may happen if NVS partition was truncated. Erase the whole partition and call nvs_flash_init again.

ESP_ERR_NVS_VALUE_TOO_LONG (0x110e): String or blob length is longer than supported by the implementation

ESP_ERR_NVS_PART_NOT_FOUND (0x110f): Partition with specified name is not found in the partition table

ESP_ERR_NVS_NEW_VERSION_FOUND (0x1110): NVS partition contains data in new format and cannot be recognized by this version of code

ESP_ERR_NVS_XTS_ENCR_FAILED (0x1111): XTS encryption failed while writing NVS entry

ESP_ERR_NVS_XTS_DECR_FAILED (0x1112): XTS decryption failed while reading NVS entry

ESP_ERR_NVS_XTS_CFG_FAILED (0x1113): XTS configuration setting failed

ESP_ERR_NVS_XTS_CFG_NOT_FOUND (0x1114): XTS configuration not found

ESP_ERR_NVS_ENCR_NOT_SUPPORTED (0x1115): NVS encryption is not supported in this version

ESP_ERR_NVS_KEYS_NOT_INITIALIZED (0x1116): NVS key partition is uninitialized

ESP_ERR_NVS_CORRUPT_KEY_PART (0x1117): NVS key partition is corrupt

ESP_ERR_ULP_BASE (0x1200): Offset for ULP-related error codes

ESP_ERR_ULP_SIZE_TOO_BIG (0x1201): Program doesn’t fit into RTC memory reserved for the ULP

ESP_ERR_ULP_INVALID_LOAD_ADDR (0x1202): Load address is outside of RTC memory reserved for the ULP

ESP_ERR_ULP_DUPLICATE_LABEL (0x1203): More than one label with the same number was defined

ESP_ERR_ULP_UNDEFINED_LABEL (0x1204): Branch instructions references an undefined label

ESP_ERR_ULP_BRANCH_OUT_OF_RANGE (0x1205): Branch target is out of range of B instruction (try replacing with BX)

ESP_ERR_OTA_BASE (0x1500): Base error code for ota_ops api

ESP_ERR_OTA_PARTITION_CONFLICT (0x1501): Error if request was to write or erase the current running partition

ESP_ERR_OTA_SELECT_INFO_INVALID (0x1502): Error if OTA data partition contains invalid content

ESP_ERR_OTA_VALIDATE_FAILED (0x1503): Error if OTA app image is invalid

ESP_ERR_IMAGE_BASE (0x2000)

ESP_ERR_IMAGE_FLASH_FAIL (0x2001)

ESP_ERR_IMAGE_INVALID (0x2002)

ESP_ERR_WIFI_BASE (0x3000): Starting number of WiFi error codes

ESP_ERR_WIFI_NOT_INIT (0x3001): WiFi driver was not installed by esp_wifi_init

ESP_ERR_WIFI_NOT_STARTED (0x3002): WiFi driver was not started by esp_wifi_start

ESP_ERR_WIFI_NOT_STOPPED (0x3003): WiFi driver was not stopped by esp_wifi_stop

ESP_ERR_WIFI_IF (0x3004): WiFi interface error

ESP_ERR_WIFI_MODE (0x3005): WiFi mode error

ESP_ERR_WIFI_STATE (0x3006): WiFi internal state error

ESP_ERR_WIFI_CONN (0x3007): WiFi internal control block of station or soft-AP error

ESP_ERR_WIFI_NVS (0x3008): WiFi internal NVS module error

ESP_ERR_WIFI_MAC (0x3009): MAC address is invalid

ESP_ERR_WIFI_SSID (0x300a): SSID is invalid

ESP_ERR_WIFI_PASSWORD (0x300b): Password is invalid

ESP_ERR_WIFI_TIMEOUT (0x300c): Timeout error

ESP_ERR_WIFI_WAKE_FAIL (0x300d): WiFi is in sleep state(RF closed) and wakeup fail

ESP_ERR_WIFI_WOULD_BLOCK (0x300e): The caller would block

ESP_ERR_WIFI_NOT_CONNECT (0x300f): Station still in disconnect status

ESP_ERR_WIFI_POST (0x3012): Failed to post the event to WiFi task

ESP_ERR_WIFI_INIT_STATE (0x3013): Invalod WiFi state when init/deinit is called

ESP_ERR_WIFI_STOP_STATE (0x3014): Returned when WiFi is stopping

ESP_ERR_WIFI_REGISTRAR (0x3033): WPS registrar is not supported

ESP_ERR_WIFI_WPS_TYPE (0x3034): WPS type error

ESP_ERR_WIFI_WPS_SM (0x3035): WPS state machine is not initialized

ESP_ERR_ESPNOW_BASE (0x3064): ESPNOW error number base.

ESP_ERR_ESPNOW_NOT_INIT (0x3065): ESPNOW is not initialized.

ESP_ERR_ESPNOW_ARG (0x3066): Invalid argument

ESP_ERR_ESPNOW_NO_MEM (0x3067): Out of memory

ESP_ERR_ESPNOW_FULL (0x3068): ESPNOW peer list is full

ESP_ERR_ESPNOW_NOT_FOUND (0x3069): ESPNOW peer is not found

ESP_ERR_ESPNOW_INTERNAL (0x306a): Internal error

ESP_ERR_ESPNOW_EXIST (0x306b): ESPNOW peer has existed

ESP_ERR_ESPNOW_IF (0x306c): Interface error

ESP_ERR_MESH_BASE (0x4000): Starting number of MESH error codes

ESP_ERR_MESH_WIFI_NOT_START (0x4001)

ESP_ERR_MESH_NOT_INIT (0x4002)

ESP_ERR_MESH_NOT_CONFIG (0x4003)

ESP_ERR_MESH_NOT_START (0x4004)

ESP_ERR_MESH_NOT_SUPPORT (0x4005)

ESP_ERR_MESH_NOT_ALLOWED (0x4006)

ESP_ERR_MESH_NO_MEMORY (0x4007)

ESP_ERR_MESH_ARGUMENT (0x4008)

ESP_ERR_MESH_EXCEED_MTU (0x4009)

ESP_ERR_MESH_TIMEOUT (0x400a)

ESP_ERR_MESH_DISCONNECTED (0x400b)

ESP_ERR_MESH_QUEUE_FAIL (0x400c)

ESP_ERR_MESH_QUEUE_FULL (0x400d)

ESP_ERR_MESH_NO_PARENT_FOUND (0x400e)

ESP_ERR_MESH_NO_ROUTE_FOUND (0x400f)

ESP_ERR_MESH_OPTION_NULL (0x4010)

ESP_ERR_MESH_OPTION_UNKNOWN (0x4011)

ESP_ERR_MESH_XON_NO_WINDOW (0x4012)

ESP_ERR_MESH_INTERFACE (0x4013)

ESP_ERR_MESH_DISCARD_DUPLICATE (0x4014)

ESP_ERR_MESH_DISCARD (0x4015)

ESP_ERR_MESH_VOTING (0x4016)

ESP_ERR_MESH_XMIT (0x4017)

ESP_ERR_MESH_QUEUE_READ (0x4018)

ESP_ERR_MESH_RECV_RELEASE (0x401a)

ESP_ERR_TCPIP_ADAPTER_BASE (0x5000)

ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS (0x5001)

ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY (0x5002)

ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED (0x5003)

ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED (0x5004)

ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED (0x5005)

ESP_ERR_TCPIP_ADAPTER_NO_MEM (0x5006)

ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED (0x5007)

ESP_ERR_PING_BASE (0x6000)

ESP_ERR_PING_INVALID_PARAMS (0x6001)

ESP_ERR_PING_NO_MEM (0x6002)

ESP_ERR_HTTP_BASE (0x7000): Starting number of HTTP error codes

ESP_ERR_HTTP_MAX_REDIRECT (0x7001): The error exceeds the number of HTTP redirects

ESP_ERR_HTTP_CONNECT (0x7002): Error open the HTTP connection

ESP_ERR_HTTP_WRITE_DATA (0x7003): Error write HTTP data

ESP_ERR_HTTP_FETCH_HEADER (0x7004): Error read HTTP header from server

ESP_ERR_HTTP_INVALID_TRANSPORT (0x7005): There are no transport support for the input scheme

ESP_ERR_HTTP_CONNECTING (0x7006): HTTP connection hasn’t been established yet

ESP_ERR_HTTP_EAGAIN (0x7007): Mapping of errno EAGAIN to esp_err_t

ESP_ERR_HTTPD_BASE (0x8000): Starting number of HTTPD error codes

ESP_ERR_HTTPD_HANDLERS_FULL (0x8001): All slots for registering URI handlers have been consumed

ESP_ERR_HTTPD_HANDLER_EXISTS (0x8002): URI handler with same method and target URI already registered

ESP_ERR_HTTPD_INVALID_REQ (0x8003): Invalid request pointer

ESP_ERR_HTTPD_RESULT_TRUNC (0x8004): Result string truncated

ESP_ERR_HTTPD_RESP_HDR (0x8005): Response header field larger than supported

ESP_ERR_HTTPD_RESP_SEND (0x8006): Error occured while sending response packet

ESP_ERR_HTTPD_ALLOC_MEM (0x8007): Failed to dynamically allocate memory for resource

ESP_ERR_HTTPD_TASK (0x8008): Failed to launch server task/thread

ESP_ERR_FLASH_BASE (0x10010)

ESP_ERR_FLASH_OP_FAIL (0x10011)

ESP_ERR_FLASH_OP_TIMEOUT (0x10012)