esp_err_to_name.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. //Do not edit this file because it is autogenerated by gen_esp_err_to_name.py
  2. #include <string.h>
  3. #if __has_include("soc/soc.h")
  4. #include "soc/soc.h"
  5. #endif
  6. #if __has_include("esp32/ulp.h")
  7. #include "esp32/ulp.h"
  8. #endif
  9. #if __has_include("esp_efuse.h")
  10. #include "esp_efuse.h"
  11. #endif
  12. #if __has_include("esp_err.h")
  13. #include "esp_err.h"
  14. #endif
  15. #if __has_include("esp_http_client.h")
  16. #include "esp_http_client.h"
  17. #endif
  18. #if __has_include("esp_http_server.h")
  19. #include "esp_http_server.h"
  20. #endif
  21. #if __has_include("esp_https_ota.h")
  22. #include "esp_https_ota.h"
  23. #endif
  24. #if __has_include("esp_image_format.h")
  25. #include "esp_image_format.h"
  26. #endif
  27. #if __has_include("esp_mesh.h")
  28. #include "esp_mesh.h"
  29. #endif
  30. #if __has_include("esp_now.h")
  31. #include "esp_now.h"
  32. #endif
  33. #if __has_include("esp_ota_ops.h")
  34. #include "esp_ota_ops.h"
  35. #endif
  36. #if __has_include("esp_ping.h")
  37. #include "esp_ping.h"
  38. #endif
  39. #if __has_include("esp_spi_flash.h")
  40. #include "esp_spi_flash.h"
  41. #endif
  42. #if __has_include("esp_wifi.h")
  43. #include "esp_wifi.h"
  44. #endif
  45. #if __has_include("esp_wps.h")
  46. #include "esp_wps.h"
  47. #endif
  48. #if __has_include("nvs.h")
  49. #include "nvs.h"
  50. #endif
  51. #if __has_include("tcpip_adapter.h")
  52. #include "tcpip_adapter.h"
  53. #endif
  54. #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
  55. #define ERR_TBL_IT(err) {err, #err}
  56. typedef struct {
  57. esp_err_t code;
  58. const char *msg;
  59. } esp_err_msg_t;
  60. static const esp_err_msg_t esp_err_msg_table[] = {
  61. // components/esp32/include/esp_err.h
  62. # ifdef ESP_FAIL
  63. ERR_TBL_IT(ESP_FAIL), /* -1 Generic esp_err_t code indicating failure */
  64. # endif
  65. # ifdef ESP_OK
  66. ERR_TBL_IT(ESP_OK), /* 0 esp_err_t value indicating success (no error) */
  67. # endif
  68. # ifdef ESP_ERR_NO_MEM
  69. ERR_TBL_IT(ESP_ERR_NO_MEM), /* 257 0x101 Out of memory */
  70. # endif
  71. # ifdef ESP_ERR_INVALID_ARG
  72. ERR_TBL_IT(ESP_ERR_INVALID_ARG), /* 258 0x102 Invalid argument */
  73. # endif
  74. # ifdef ESP_ERR_INVALID_STATE
  75. ERR_TBL_IT(ESP_ERR_INVALID_STATE), /* 259 0x103 Invalid state */
  76. # endif
  77. # ifdef ESP_ERR_INVALID_SIZE
  78. ERR_TBL_IT(ESP_ERR_INVALID_SIZE), /* 260 0x104 Invalid size */
  79. # endif
  80. # ifdef ESP_ERR_NOT_FOUND
  81. ERR_TBL_IT(ESP_ERR_NOT_FOUND), /* 261 0x105 Requested resource not found */
  82. # endif
  83. # ifdef ESP_ERR_NOT_SUPPORTED
  84. ERR_TBL_IT(ESP_ERR_NOT_SUPPORTED), /* 262 0x106 Operation or feature not supported */
  85. # endif
  86. # ifdef ESP_ERR_TIMEOUT
  87. ERR_TBL_IT(ESP_ERR_TIMEOUT), /* 263 0x107 Operation timed out */
  88. # endif
  89. # ifdef ESP_ERR_INVALID_RESPONSE
  90. ERR_TBL_IT(ESP_ERR_INVALID_RESPONSE), /* 264 0x108 Received response was invalid */
  91. # endif
  92. # ifdef ESP_ERR_INVALID_CRC
  93. ERR_TBL_IT(ESP_ERR_INVALID_CRC), /* 265 0x109 CRC or checksum was invalid */
  94. # endif
  95. # ifdef ESP_ERR_INVALID_VERSION
  96. ERR_TBL_IT(ESP_ERR_INVALID_VERSION), /* 266 0x10a Version was invalid */
  97. # endif
  98. # ifdef ESP_ERR_INVALID_MAC
  99. ERR_TBL_IT(ESP_ERR_INVALID_MAC), /* 267 0x10b MAC address was invalid */
  100. # endif
  101. // components/nvs_flash/include/nvs.h
  102. # ifdef ESP_ERR_NVS_BASE
  103. ERR_TBL_IT(ESP_ERR_NVS_BASE), /* 4352 0x1100 Starting number of error codes */
  104. # endif
  105. # ifdef ESP_ERR_NVS_NOT_INITIALIZED
  106. ERR_TBL_IT(ESP_ERR_NVS_NOT_INITIALIZED), /* 4353 0x1101 The storage driver is not initialized */
  107. # endif
  108. # ifdef ESP_ERR_NVS_NOT_FOUND
  109. ERR_TBL_IT(ESP_ERR_NVS_NOT_FOUND), /* 4354 0x1102 Id namespace doesn’t exist yet and mode is
  110. NVS_READONLY */
  111. # endif
  112. # ifdef ESP_ERR_NVS_TYPE_MISMATCH
  113. ERR_TBL_IT(ESP_ERR_NVS_TYPE_MISMATCH), /* 4355 0x1103 The type of set or get operation doesn't
  114. match the type of value stored in NVS */
  115. # endif
  116. # ifdef ESP_ERR_NVS_READ_ONLY
  117. ERR_TBL_IT(ESP_ERR_NVS_READ_ONLY), /* 4356 0x1104 Storage handle was opened as read only */
  118. # endif
  119. # ifdef ESP_ERR_NVS_NOT_ENOUGH_SPACE
  120. ERR_TBL_IT(ESP_ERR_NVS_NOT_ENOUGH_SPACE), /* 4357 0x1105 There is not enough space in the underlying
  121. storage to save the value */
  122. # endif
  123. # ifdef ESP_ERR_NVS_INVALID_NAME
  124. ERR_TBL_IT(ESP_ERR_NVS_INVALID_NAME), /* 4358 0x1106 Namespace name doesn’t satisfy constraints */
  125. # endif
  126. # ifdef ESP_ERR_NVS_INVALID_HANDLE
  127. ERR_TBL_IT(ESP_ERR_NVS_INVALID_HANDLE), /* 4359 0x1107 Handle has been closed or is NULL */
  128. # endif
  129. # ifdef ESP_ERR_NVS_REMOVE_FAILED
  130. ERR_TBL_IT(ESP_ERR_NVS_REMOVE_FAILED), /* 4360 0x1108 The value wasn’t updated because flash write
  131. operation has failed. The value was written
  132. however, and update will be finished after
  133. re-initialization of nvs, provided that
  134. flash operation doesn’t fail again. */
  135. # endif
  136. # ifdef ESP_ERR_NVS_KEY_TOO_LONG
  137. ERR_TBL_IT(ESP_ERR_NVS_KEY_TOO_LONG), /* 4361 0x1109 Key name is too long */
  138. # endif
  139. # ifdef ESP_ERR_NVS_PAGE_FULL
  140. ERR_TBL_IT(ESP_ERR_NVS_PAGE_FULL), /* 4362 0x110a Internal error; never returned by nvs API
  141. functions */
  142. # endif
  143. # ifdef ESP_ERR_NVS_INVALID_STATE
  144. ERR_TBL_IT(ESP_ERR_NVS_INVALID_STATE), /* 4363 0x110b NVS is in an inconsistent state due to a
  145. previous error. Call nvs_flash_init and
  146. nvs_open again, then retry. */
  147. # endif
  148. # ifdef ESP_ERR_NVS_INVALID_LENGTH
  149. ERR_TBL_IT(ESP_ERR_NVS_INVALID_LENGTH), /* 4364 0x110c String or blob length is not sufficient to
  150. store data */
  151. # endif
  152. # ifdef ESP_ERR_NVS_NO_FREE_PAGES
  153. ERR_TBL_IT(ESP_ERR_NVS_NO_FREE_PAGES), /* 4365 0x110d NVS partition doesn't contain any empty
  154. pages. This may happen if NVS partition was
  155. truncated. Erase the whole partition and
  156. call nvs_flash_init again. */
  157. # endif
  158. # ifdef ESP_ERR_NVS_VALUE_TOO_LONG
  159. ERR_TBL_IT(ESP_ERR_NVS_VALUE_TOO_LONG), /* 4366 0x110e String or blob length is longer than
  160. supported by the implementation */
  161. # endif
  162. # ifdef ESP_ERR_NVS_PART_NOT_FOUND
  163. ERR_TBL_IT(ESP_ERR_NVS_PART_NOT_FOUND), /* 4367 0x110f Partition with specified name is not found
  164. in the partition table */
  165. # endif
  166. # ifdef ESP_ERR_NVS_NEW_VERSION_FOUND
  167. ERR_TBL_IT(ESP_ERR_NVS_NEW_VERSION_FOUND), /* 4368 0x1110 NVS partition contains data in new format
  168. and cannot be recognized by this version of
  169. code */
  170. # endif
  171. # ifdef ESP_ERR_NVS_XTS_ENCR_FAILED
  172. ERR_TBL_IT(ESP_ERR_NVS_XTS_ENCR_FAILED), /* 4369 0x1111 XTS encryption failed while writing NVS entry */
  173. # endif
  174. # ifdef ESP_ERR_NVS_XTS_DECR_FAILED
  175. ERR_TBL_IT(ESP_ERR_NVS_XTS_DECR_FAILED), /* 4370 0x1112 XTS decryption failed while reading NVS entry */
  176. # endif
  177. # ifdef ESP_ERR_NVS_XTS_CFG_FAILED
  178. ERR_TBL_IT(ESP_ERR_NVS_XTS_CFG_FAILED), /* 4371 0x1113 XTS configuration setting failed */
  179. # endif
  180. # ifdef ESP_ERR_NVS_XTS_CFG_NOT_FOUND
  181. ERR_TBL_IT(ESP_ERR_NVS_XTS_CFG_NOT_FOUND), /* 4372 0x1114 XTS configuration not found */
  182. # endif
  183. # ifdef ESP_ERR_NVS_ENCR_NOT_SUPPORTED
  184. ERR_TBL_IT(ESP_ERR_NVS_ENCR_NOT_SUPPORTED), /* 4373 0x1115 NVS encryption is not supported in this version */
  185. # endif
  186. # ifdef ESP_ERR_NVS_KEYS_NOT_INITIALIZED
  187. ERR_TBL_IT(ESP_ERR_NVS_KEYS_NOT_INITIALIZED), /* 4374 0x1116 NVS key partition is uninitialized */
  188. # endif
  189. # ifdef ESP_ERR_NVS_CORRUPT_KEY_PART
  190. ERR_TBL_IT(ESP_ERR_NVS_CORRUPT_KEY_PART), /* 4375 0x1117 NVS key partition is corrupt */
  191. # endif
  192. // components/ulp/include/esp32/ulp.h
  193. # ifdef ESP_ERR_ULP_BASE
  194. ERR_TBL_IT(ESP_ERR_ULP_BASE), /* 4608 0x1200 Offset for ULP-related error codes */
  195. # endif
  196. # ifdef ESP_ERR_ULP_SIZE_TOO_BIG
  197. ERR_TBL_IT(ESP_ERR_ULP_SIZE_TOO_BIG), /* 4609 0x1201 Program doesn't fit into RTC memory reserved
  198. for the ULP */
  199. # endif
  200. # ifdef ESP_ERR_ULP_INVALID_LOAD_ADDR
  201. ERR_TBL_IT(ESP_ERR_ULP_INVALID_LOAD_ADDR), /* 4610 0x1202 Load address is outside of RTC memory
  202. reserved for the ULP */
  203. # endif
  204. # ifdef ESP_ERR_ULP_DUPLICATE_LABEL
  205. ERR_TBL_IT(ESP_ERR_ULP_DUPLICATE_LABEL), /* 4611 0x1203 More than one label with the same number was
  206. defined */
  207. # endif
  208. # ifdef ESP_ERR_ULP_UNDEFINED_LABEL
  209. ERR_TBL_IT(ESP_ERR_ULP_UNDEFINED_LABEL), /* 4612 0x1204 Branch instructions references an undefined label */
  210. # endif
  211. # ifdef ESP_ERR_ULP_BRANCH_OUT_OF_RANGE
  212. ERR_TBL_IT(ESP_ERR_ULP_BRANCH_OUT_OF_RANGE), /* 4613 0x1205 Branch target is out of range of B
  213. instruction (try replacing with BX) */
  214. # endif
  215. // components/app_update/include/esp_ota_ops.h
  216. # ifdef ESP_ERR_OTA_BASE
  217. ERR_TBL_IT(ESP_ERR_OTA_BASE), /* 5376 0x1500 Base error code for ota_ops api */
  218. # endif
  219. # ifdef ESP_ERR_OTA_PARTITION_CONFLICT
  220. ERR_TBL_IT(ESP_ERR_OTA_PARTITION_CONFLICT), /* 5377 0x1501 Error if request was to write or erase the
  221. current running partition */
  222. # endif
  223. # ifdef ESP_ERR_OTA_SELECT_INFO_INVALID
  224. ERR_TBL_IT(ESP_ERR_OTA_SELECT_INFO_INVALID), /* 5378 0x1502 Error if OTA data partition contains invalid
  225. content */
  226. # endif
  227. # ifdef ESP_ERR_OTA_VALIDATE_FAILED
  228. ERR_TBL_IT(ESP_ERR_OTA_VALIDATE_FAILED), /* 5379 0x1503 Error if OTA app image is invalid */
  229. # endif
  230. # ifdef ESP_ERR_OTA_SMALL_SEC_VER
  231. ERR_TBL_IT(ESP_ERR_OTA_SMALL_SEC_VER), /* 5380 0x1504 Error if the firmware has a secure version
  232. less than the running firmware. */
  233. # endif
  234. # ifdef ESP_ERR_OTA_ROLLBACK_FAILED
  235. ERR_TBL_IT(ESP_ERR_OTA_ROLLBACK_FAILED), /* 5381 0x1505 Error if flash does not have valid firmware
  236. in passive partition and hence rollback is
  237. not possible */
  238. # endif
  239. # ifdef ESP_ERR_OTA_ROLLBACK_INVALID_STATE
  240. ERR_TBL_IT(ESP_ERR_OTA_ROLLBACK_INVALID_STATE), /* 5382 0x1506 Error if current active firmware is still
  241. marked in pending validation state
  242. (ESP_OTA_IMG_PENDING_VERIFY), essentially
  243. first boot of firmware image post upgrade
  244. and hence firmware upgrade is not possible */
  245. # endif
  246. // components/efuse/include/esp_efuse.h
  247. # ifdef ESP_ERR_EFUSE
  248. ERR_TBL_IT(ESP_ERR_EFUSE), /* 5632 0x1600 Base error code for efuse api. */
  249. # endif
  250. # ifdef ESP_OK_EFUSE_CNT
  251. ERR_TBL_IT(ESP_OK_EFUSE_CNT), /* 5633 0x1601 OK the required number of bits is set. */
  252. # endif
  253. # ifdef ESP_ERR_EFUSE_CNT_IS_FULL
  254. ERR_TBL_IT(ESP_ERR_EFUSE_CNT_IS_FULL), /* 5634 0x1602 Error field is full. */
  255. # endif
  256. # ifdef ESP_ERR_EFUSE_REPEATED_PROG
  257. ERR_TBL_IT(ESP_ERR_EFUSE_REPEATED_PROG), /* 5635 0x1603 Error repeated programming of programmed
  258. bits is strictly forbidden. */
  259. # endif
  260. # ifdef ESP_ERR_CODING
  261. ERR_TBL_IT(ESP_ERR_CODING), /* 5636 0x1604 Error while a encoding operation. */
  262. # endif
  263. // components/bootloader_support/include/esp_image_format.h
  264. # ifdef ESP_ERR_IMAGE_BASE
  265. ERR_TBL_IT(ESP_ERR_IMAGE_BASE), /* 8192 0x2000 */
  266. # endif
  267. # ifdef ESP_ERR_IMAGE_FLASH_FAIL
  268. ERR_TBL_IT(ESP_ERR_IMAGE_FLASH_FAIL), /* 8193 0x2001 */
  269. # endif
  270. # ifdef ESP_ERR_IMAGE_INVALID
  271. ERR_TBL_IT(ESP_ERR_IMAGE_INVALID), /* 8194 0x2002 */
  272. # endif
  273. // components/esp32/include/esp_err.h
  274. # ifdef ESP_ERR_WIFI_BASE
  275. ERR_TBL_IT(ESP_ERR_WIFI_BASE), /* 12288 0x3000 Starting number of WiFi error codes */
  276. # endif
  277. // components/esp32/include/esp_wifi.h
  278. # ifdef ESP_ERR_WIFI_NOT_INIT
  279. ERR_TBL_IT(ESP_ERR_WIFI_NOT_INIT), /* 12289 0x3001 WiFi driver was not installed by esp_wifi_init */
  280. # endif
  281. # ifdef ESP_ERR_WIFI_NOT_STARTED
  282. ERR_TBL_IT(ESP_ERR_WIFI_NOT_STARTED), /* 12290 0x3002 WiFi driver was not started by esp_wifi_start */
  283. # endif
  284. # ifdef ESP_ERR_WIFI_NOT_STOPPED
  285. ERR_TBL_IT(ESP_ERR_WIFI_NOT_STOPPED), /* 12291 0x3003 WiFi driver was not stopped by esp_wifi_stop */
  286. # endif
  287. # ifdef ESP_ERR_WIFI_IF
  288. ERR_TBL_IT(ESP_ERR_WIFI_IF), /* 12292 0x3004 WiFi interface error */
  289. # endif
  290. # ifdef ESP_ERR_WIFI_MODE
  291. ERR_TBL_IT(ESP_ERR_WIFI_MODE), /* 12293 0x3005 WiFi mode error */
  292. # endif
  293. # ifdef ESP_ERR_WIFI_STATE
  294. ERR_TBL_IT(ESP_ERR_WIFI_STATE), /* 12294 0x3006 WiFi internal state error */
  295. # endif
  296. # ifdef ESP_ERR_WIFI_CONN
  297. ERR_TBL_IT(ESP_ERR_WIFI_CONN), /* 12295 0x3007 WiFi internal control block of station or
  298. soft-AP error */
  299. # endif
  300. # ifdef ESP_ERR_WIFI_NVS
  301. ERR_TBL_IT(ESP_ERR_WIFI_NVS), /* 12296 0x3008 WiFi internal NVS module error */
  302. # endif
  303. # ifdef ESP_ERR_WIFI_MAC
  304. ERR_TBL_IT(ESP_ERR_WIFI_MAC), /* 12297 0x3009 MAC address is invalid */
  305. # endif
  306. # ifdef ESP_ERR_WIFI_SSID
  307. ERR_TBL_IT(ESP_ERR_WIFI_SSID), /* 12298 0x300a SSID is invalid */
  308. # endif
  309. # ifdef ESP_ERR_WIFI_PASSWORD
  310. ERR_TBL_IT(ESP_ERR_WIFI_PASSWORD), /* 12299 0x300b Password is invalid */
  311. # endif
  312. # ifdef ESP_ERR_WIFI_TIMEOUT
  313. ERR_TBL_IT(ESP_ERR_WIFI_TIMEOUT), /* 12300 0x300c Timeout error */
  314. # endif
  315. # ifdef ESP_ERR_WIFI_WAKE_FAIL
  316. ERR_TBL_IT(ESP_ERR_WIFI_WAKE_FAIL), /* 12301 0x300d WiFi is in sleep state(RF closed) and wakeup fail */
  317. # endif
  318. # ifdef ESP_ERR_WIFI_WOULD_BLOCK
  319. ERR_TBL_IT(ESP_ERR_WIFI_WOULD_BLOCK), /* 12302 0x300e The caller would block */
  320. # endif
  321. # ifdef ESP_ERR_WIFI_NOT_CONNECT
  322. ERR_TBL_IT(ESP_ERR_WIFI_NOT_CONNECT), /* 12303 0x300f Station still in disconnect status */
  323. # endif
  324. # ifdef ESP_ERR_WIFI_POST
  325. ERR_TBL_IT(ESP_ERR_WIFI_POST), /* 12306 0x3012 Failed to post the event to WiFi task */
  326. # endif
  327. # ifdef ESP_ERR_WIFI_INIT_STATE
  328. ERR_TBL_IT(ESP_ERR_WIFI_INIT_STATE), /* 12307 0x3013 Invalid WiFi state when init/deinit is called */
  329. # endif
  330. # ifdef ESP_ERR_WIFI_STOP_STATE
  331. ERR_TBL_IT(ESP_ERR_WIFI_STOP_STATE), /* 12308 0x3014 Returned when WiFi is stopping */
  332. # endif
  333. // components/esp32/include/esp_wps.h
  334. # ifdef ESP_ERR_WIFI_REGISTRAR
  335. ERR_TBL_IT(ESP_ERR_WIFI_REGISTRAR), /* 12339 0x3033 WPS registrar is not supported */
  336. # endif
  337. # ifdef ESP_ERR_WIFI_WPS_TYPE
  338. ERR_TBL_IT(ESP_ERR_WIFI_WPS_TYPE), /* 12340 0x3034 WPS type error */
  339. # endif
  340. # ifdef ESP_ERR_WIFI_WPS_SM
  341. ERR_TBL_IT(ESP_ERR_WIFI_WPS_SM), /* 12341 0x3035 WPS state machine is not initialized */
  342. # endif
  343. // components/esp32/include/esp_now.h
  344. # ifdef ESP_ERR_ESPNOW_BASE
  345. ERR_TBL_IT(ESP_ERR_ESPNOW_BASE), /* 12388 0x3064 ESPNOW error number base. */
  346. # endif
  347. # ifdef ESP_ERR_ESPNOW_NOT_INIT
  348. ERR_TBL_IT(ESP_ERR_ESPNOW_NOT_INIT), /* 12389 0x3065 ESPNOW is not initialized. */
  349. # endif
  350. # ifdef ESP_ERR_ESPNOW_ARG
  351. ERR_TBL_IT(ESP_ERR_ESPNOW_ARG), /* 12390 0x3066 Invalid argument */
  352. # endif
  353. # ifdef ESP_ERR_ESPNOW_NO_MEM
  354. ERR_TBL_IT(ESP_ERR_ESPNOW_NO_MEM), /* 12391 0x3067 Out of memory */
  355. # endif
  356. # ifdef ESP_ERR_ESPNOW_FULL
  357. ERR_TBL_IT(ESP_ERR_ESPNOW_FULL), /* 12392 0x3068 ESPNOW peer list is full */
  358. # endif
  359. # ifdef ESP_ERR_ESPNOW_NOT_FOUND
  360. ERR_TBL_IT(ESP_ERR_ESPNOW_NOT_FOUND), /* 12393 0x3069 ESPNOW peer is not found */
  361. # endif
  362. # ifdef ESP_ERR_ESPNOW_INTERNAL
  363. ERR_TBL_IT(ESP_ERR_ESPNOW_INTERNAL), /* 12394 0x306a Internal error */
  364. # endif
  365. # ifdef ESP_ERR_ESPNOW_EXIST
  366. ERR_TBL_IT(ESP_ERR_ESPNOW_EXIST), /* 12395 0x306b ESPNOW peer has existed */
  367. # endif
  368. # ifdef ESP_ERR_ESPNOW_IF
  369. ERR_TBL_IT(ESP_ERR_ESPNOW_IF), /* 12396 0x306c Interface error */
  370. # endif
  371. // components/esp32/include/esp_err.h
  372. # ifdef ESP_ERR_MESH_BASE
  373. ERR_TBL_IT(ESP_ERR_MESH_BASE), /* 16384 0x4000 Starting number of MESH error codes */
  374. # endif
  375. // components/esp32/include/esp_mesh.h
  376. # ifdef ESP_ERR_MESH_WIFI_NOT_START
  377. ERR_TBL_IT(ESP_ERR_MESH_WIFI_NOT_START), /* 16385 0x4001 */
  378. # endif
  379. # ifdef ESP_ERR_MESH_NOT_INIT
  380. ERR_TBL_IT(ESP_ERR_MESH_NOT_INIT), /* 16386 0x4002 */
  381. # endif
  382. # ifdef ESP_ERR_MESH_NOT_CONFIG
  383. ERR_TBL_IT(ESP_ERR_MESH_NOT_CONFIG), /* 16387 0x4003 */
  384. # endif
  385. # ifdef ESP_ERR_MESH_NOT_START
  386. ERR_TBL_IT(ESP_ERR_MESH_NOT_START), /* 16388 0x4004 */
  387. # endif
  388. # ifdef ESP_ERR_MESH_NOT_SUPPORT
  389. ERR_TBL_IT(ESP_ERR_MESH_NOT_SUPPORT), /* 16389 0x4005 */
  390. # endif
  391. # ifdef ESP_ERR_MESH_NOT_ALLOWED
  392. ERR_TBL_IT(ESP_ERR_MESH_NOT_ALLOWED), /* 16390 0x4006 */
  393. # endif
  394. # ifdef ESP_ERR_MESH_NO_MEMORY
  395. ERR_TBL_IT(ESP_ERR_MESH_NO_MEMORY), /* 16391 0x4007 */
  396. # endif
  397. # ifdef ESP_ERR_MESH_ARGUMENT
  398. ERR_TBL_IT(ESP_ERR_MESH_ARGUMENT), /* 16392 0x4008 */
  399. # endif
  400. # ifdef ESP_ERR_MESH_EXCEED_MTU
  401. ERR_TBL_IT(ESP_ERR_MESH_EXCEED_MTU), /* 16393 0x4009 */
  402. # endif
  403. # ifdef ESP_ERR_MESH_TIMEOUT
  404. ERR_TBL_IT(ESP_ERR_MESH_TIMEOUT), /* 16394 0x400a */
  405. # endif
  406. # ifdef ESP_ERR_MESH_DISCONNECTED
  407. ERR_TBL_IT(ESP_ERR_MESH_DISCONNECTED), /* 16395 0x400b */
  408. # endif
  409. # ifdef ESP_ERR_MESH_QUEUE_FAIL
  410. ERR_TBL_IT(ESP_ERR_MESH_QUEUE_FAIL), /* 16396 0x400c */
  411. # endif
  412. # ifdef ESP_ERR_MESH_QUEUE_FULL
  413. ERR_TBL_IT(ESP_ERR_MESH_QUEUE_FULL), /* 16397 0x400d */
  414. # endif
  415. # ifdef ESP_ERR_MESH_NO_PARENT_FOUND
  416. ERR_TBL_IT(ESP_ERR_MESH_NO_PARENT_FOUND), /* 16398 0x400e */
  417. # endif
  418. # ifdef ESP_ERR_MESH_NO_ROUTE_FOUND
  419. ERR_TBL_IT(ESP_ERR_MESH_NO_ROUTE_FOUND), /* 16399 0x400f */
  420. # endif
  421. # ifdef ESP_ERR_MESH_OPTION_NULL
  422. ERR_TBL_IT(ESP_ERR_MESH_OPTION_NULL), /* 16400 0x4010 */
  423. # endif
  424. # ifdef ESP_ERR_MESH_OPTION_UNKNOWN
  425. ERR_TBL_IT(ESP_ERR_MESH_OPTION_UNKNOWN), /* 16401 0x4011 */
  426. # endif
  427. # ifdef ESP_ERR_MESH_XON_NO_WINDOW
  428. ERR_TBL_IT(ESP_ERR_MESH_XON_NO_WINDOW), /* 16402 0x4012 */
  429. # endif
  430. # ifdef ESP_ERR_MESH_INTERFACE
  431. ERR_TBL_IT(ESP_ERR_MESH_INTERFACE), /* 16403 0x4013 */
  432. # endif
  433. # ifdef ESP_ERR_MESH_DISCARD_DUPLICATE
  434. ERR_TBL_IT(ESP_ERR_MESH_DISCARD_DUPLICATE), /* 16404 0x4014 */
  435. # endif
  436. # ifdef ESP_ERR_MESH_DISCARD
  437. ERR_TBL_IT(ESP_ERR_MESH_DISCARD), /* 16405 0x4015 */
  438. # endif
  439. # ifdef ESP_ERR_MESH_VOTING
  440. ERR_TBL_IT(ESP_ERR_MESH_VOTING), /* 16406 0x4016 */
  441. # endif
  442. # ifdef ESP_ERR_MESH_XMIT
  443. ERR_TBL_IT(ESP_ERR_MESH_XMIT), /* 16407 0x4017 */
  444. # endif
  445. # ifdef ESP_ERR_MESH_QUEUE_READ
  446. ERR_TBL_IT(ESP_ERR_MESH_QUEUE_READ), /* 16408 0x4018 */
  447. # endif
  448. # ifdef ESP_ERR_MESH_RECV_RELEASE
  449. ERR_TBL_IT(ESP_ERR_MESH_RECV_RELEASE), /* 16410 0x401a */
  450. # endif
  451. // components/tcpip_adapter/include/tcpip_adapter.h
  452. # ifdef ESP_ERR_TCPIP_ADAPTER_BASE
  453. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_BASE), /* 20480 0x5000 */
  454. # endif
  455. # ifdef ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS
  456. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS), /* 20481 0x5001 */
  457. # endif
  458. # ifdef ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY
  459. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY), /* 20482 0x5002 */
  460. # endif
  461. # ifdef ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED
  462. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED), /* 20483 0x5003 */
  463. # endif
  464. # ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED
  465. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED), /* 20484 0x5004 */
  466. # endif
  467. # ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED
  468. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED), /* 20485 0x5005 */
  469. # endif
  470. # ifdef ESP_ERR_TCPIP_ADAPTER_NO_MEM
  471. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_NO_MEM), /* 20486 0x5006 */
  472. # endif
  473. # ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED
  474. ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED), /* 20487 0x5007 */
  475. # endif
  476. // components/lwip/include/apps/esp_ping.h
  477. # ifdef ESP_ERR_PING_BASE
  478. ERR_TBL_IT(ESP_ERR_PING_BASE), /* 24576 0x6000 */
  479. # endif
  480. # ifdef ESP_ERR_PING_INVALID_PARAMS
  481. ERR_TBL_IT(ESP_ERR_PING_INVALID_PARAMS), /* 24577 0x6001 */
  482. # endif
  483. # ifdef ESP_ERR_PING_NO_MEM
  484. ERR_TBL_IT(ESP_ERR_PING_NO_MEM), /* 24578 0x6002 */
  485. # endif
  486. // components/esp_http_client/include/esp_http_client.h
  487. # ifdef ESP_ERR_HTTP_BASE
  488. ERR_TBL_IT(ESP_ERR_HTTP_BASE), /* 28672 0x7000 Starting number of HTTP error codes */
  489. # endif
  490. # ifdef ESP_ERR_HTTP_MAX_REDIRECT
  491. ERR_TBL_IT(ESP_ERR_HTTP_MAX_REDIRECT), /* 28673 0x7001 The error exceeds the number of HTTP redirects */
  492. # endif
  493. # ifdef ESP_ERR_HTTP_CONNECT
  494. ERR_TBL_IT(ESP_ERR_HTTP_CONNECT), /* 28674 0x7002 Error open the HTTP connection */
  495. # endif
  496. # ifdef ESP_ERR_HTTP_WRITE_DATA
  497. ERR_TBL_IT(ESP_ERR_HTTP_WRITE_DATA), /* 28675 0x7003 Error write HTTP data */
  498. # endif
  499. # ifdef ESP_ERR_HTTP_FETCH_HEADER
  500. ERR_TBL_IT(ESP_ERR_HTTP_FETCH_HEADER), /* 28676 0x7004 Error read HTTP header from server */
  501. # endif
  502. # ifdef ESP_ERR_HTTP_INVALID_TRANSPORT
  503. ERR_TBL_IT(ESP_ERR_HTTP_INVALID_TRANSPORT), /* 28677 0x7005 There are no transport support for the input
  504. scheme */
  505. # endif
  506. # ifdef ESP_ERR_HTTP_CONNECTING
  507. ERR_TBL_IT(ESP_ERR_HTTP_CONNECTING), /* 28678 0x7006 HTTP connection hasn't been established yet */
  508. # endif
  509. # ifdef ESP_ERR_HTTP_EAGAIN
  510. ERR_TBL_IT(ESP_ERR_HTTP_EAGAIN), /* 28679 0x7007 Mapping of errno EAGAIN to esp_err_t */
  511. # endif
  512. // components/esp_http_server/include/esp_http_server.h
  513. # ifdef ESP_ERR_HTTPD_BASE
  514. ERR_TBL_IT(ESP_ERR_HTTPD_BASE), /* 32768 0x8000 Starting number of HTTPD error codes */
  515. # endif
  516. # ifdef ESP_ERR_HTTPD_HANDLERS_FULL
  517. ERR_TBL_IT(ESP_ERR_HTTPD_HANDLERS_FULL), /* 32769 0x8001 All slots for registering URI handlers have
  518. been consumed */
  519. # endif
  520. # ifdef ESP_ERR_HTTPD_HANDLER_EXISTS
  521. ERR_TBL_IT(ESP_ERR_HTTPD_HANDLER_EXISTS), /* 32770 0x8002 URI handler with same method and target URI
  522. already registered */
  523. # endif
  524. # ifdef ESP_ERR_HTTPD_INVALID_REQ
  525. ERR_TBL_IT(ESP_ERR_HTTPD_INVALID_REQ), /* 32771 0x8003 Invalid request pointer */
  526. # endif
  527. # ifdef ESP_ERR_HTTPD_RESULT_TRUNC
  528. ERR_TBL_IT(ESP_ERR_HTTPD_RESULT_TRUNC), /* 32772 0x8004 Result string truncated */
  529. # endif
  530. # ifdef ESP_ERR_HTTPD_RESP_HDR
  531. ERR_TBL_IT(ESP_ERR_HTTPD_RESP_HDR), /* 32773 0x8005 Response header field larger than supported */
  532. # endif
  533. # ifdef ESP_ERR_HTTPD_RESP_SEND
  534. ERR_TBL_IT(ESP_ERR_HTTPD_RESP_SEND), /* 32774 0x8006 Error occured while sending response packet */
  535. # endif
  536. # ifdef ESP_ERR_HTTPD_ALLOC_MEM
  537. ERR_TBL_IT(ESP_ERR_HTTPD_ALLOC_MEM), /* 32775 0x8007 Failed to dynamically allocate memory for
  538. resource */
  539. # endif
  540. # ifdef ESP_ERR_HTTPD_TASK
  541. ERR_TBL_IT(ESP_ERR_HTTPD_TASK), /* 32776 0x8008 Failed to launch server task/thread */
  542. # endif
  543. // components/esp_https_ota/include/esp_https_ota.h
  544. # ifdef ESP_ERR_HTTPS_OTA_BASE
  545. ERR_TBL_IT(ESP_ERR_HTTPS_OTA_BASE), /* 36864 0x9000 */
  546. # endif
  547. # ifdef ESP_ERR_HTTPS_OTA_IN_PROGRESS
  548. ERR_TBL_IT(ESP_ERR_HTTPS_OTA_IN_PROGRESS), /* 36865 0x9001 */
  549. # endif
  550. // components/spi_flash/include/esp_spi_flash.h
  551. # ifdef ESP_ERR_FLASH_BASE
  552. ERR_TBL_IT(ESP_ERR_FLASH_BASE), /* 65552 0x10010 */
  553. # endif
  554. # ifdef ESP_ERR_FLASH_OP_FAIL
  555. ERR_TBL_IT(ESP_ERR_FLASH_OP_FAIL), /* 65553 0x10011 */
  556. # endif
  557. # ifdef ESP_ERR_FLASH_OP_TIMEOUT
  558. ERR_TBL_IT(ESP_ERR_FLASH_OP_TIMEOUT), /* 65554 0x10012 */
  559. # endif
  560. };
  561. #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
  562. static const char esp_unknown_msg[] =
  563. #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
  564. "ERROR";
  565. #else
  566. "UNKNOWN ERROR";
  567. #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
  568. const char *esp_err_to_name(esp_err_t code)
  569. {
  570. #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
  571. int i;
  572. for (i = 0; i < sizeof(esp_err_msg_table)/sizeof(esp_err_msg_table[0]); ++i) {
  573. if (esp_err_msg_table[i].code == code) {
  574. return esp_err_msg_table[i].msg;
  575. }
  576. }
  577. #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
  578. return esp_unknown_msg;
  579. }
  580. const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen)
  581. {
  582. #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
  583. int i;
  584. for (i = 0; i < sizeof(esp_err_msg_table)/sizeof(esp_err_msg_table[0]); ++i) {
  585. if (esp_err_msg_table[i].code == code) {
  586. strlcpy(buf, esp_err_msg_table[i].msg, buflen);
  587. return buf;
  588. }
  589. }
  590. #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
  591. if (strerror_r(code, buf, buflen) == 0) {
  592. return buf;
  593. }
  594. snprintf(buf, buflen, "%s 0x%x(%d)", esp_unknown_msg, code, code);
  595. return buf;
  596. }