Chapter 4. API Guides
This feature is enabled by default, but can be disabled to reduce application binary size.
FIG_ESP_ERR_TO_NAME_LOOKUP.
esp_err_to_name_r()
return UNKNOWN ERROR, and
where 0xXXXX and YYYYY are the hexadecimal and decimal representations of the error code, respectively.
4.7.4 ESP_ERROR_CHECK macro
ESP_ERROR_CHECK() macro serves similar purpose as assert, except that it checks
than a bool condition. If the argument of ESP_ERROR_CHECK() is not equal ESP_OK, then an error message
is printed on the console, and abort() is called.
Error message will typically look like this:
ESP_ERROR_CHECK failed: esp_err_t
file:
"/Users/user/esp/example/main/main.c"
func: app_main
expression: sdmmc_card_init(host, &card)
Backtrace:
0x40086e7c:0x3ffb4ff0 0x40087328:0x3ffb5010
0x400d0816:0x3ffb5050
→
Note: If
IDF monitor
is used, addresses in the backtrace will be converted to file names and line numbers.
• The first line mentions the error code as a hexadecimal value, and the identifier used for this error in source code.
The latter depends on
where error has occured is printed as well.
• Subsequent lines show the location in the program where ESP_ERROR_CHECK() macro was called, and the
expression which was passed to the macro as an argument.
• Finally, backtrace is printed. This is part of panic handler output common to all fatal errors. See
for more information about the backtrace.
4.7.5 ESP_ERROR_CHECK_WITHOUT_ABORT macro
ESP_ERROR_CHECK_WITHOUT_ABORT() macro serves similar purpose as ESP_ERROR_CHECK, except that
it won't call abort().
4.7.6 ESP_RETURN_ON_ERROR macro
ESP_RETURN_ON_ERROR() macro checks the error code, if the error code is not equal ESP_OK, it prints the
message and returns.
4.7.7 ESP_GOTO_ON_ERROR macro
ESP_GOTO_ON_ERROR() macro checks the error code, if the error code is not equal ESP_OK, it prints the
message, sets the local variable ret to the code, and then exits by jumping to goto_tag.
4.7.8 ESP_RETURN_ON_FALSE macro
ESP_RETURN_ON_FALSE() macro checks the condition, if the condition is not equal true, it prints the message
and returns with the supplied err_code.
Espressif Systems
When
this
are still defined and can be called. In this case,
esp_err_to_name_r()
0x107
(ESP_ERR_TIMEOUT) at
CONFIG_ESP_ERR_TO_NAME_LOOKUP
1304
Submit Document Feedback
feature
is
disabled,
esp_err_to_name()
will return Unknown error 0xXXXX(YYYYY),
line
20
0x400d1fdf:0x3ffb5030␣
option being set. Address in the program
See
CON-
esp_err_to_name()
esp_err_t
value rather
0x400d1fdf
Fatal Errors
Release v4.4
and
will
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?