EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1317 background imageLoading...
Page #1317 background image
Chapter 4. API Guides
Example:
sdmmc_card_t* card = calloc(1, sizeof(sdmmc_card_t));
if (card == NULL) {
return ESP_ERR_NO_MEM;
}
esp_err_t err = sdmmc_card_init(host, &card);
if (err != ESP_OK) {
// Clean up
free(card);
// Propagate the error to the upper layer (e.g. to notify the user).
// Alternatively, application can define and return custom error code.
return err;
}
3. Convert into unrecoverable error, for example using ESP_ERROR_CHECK. See ESP_ERROR_CHECK macro
section for details.
Terminating the application in case of an error is usually undesirable behaviour for middleware components,
but is sometimes acceptable at application level.
Many ESP-IDF examples use ESP_ERROR_CHECK to handle errors from various APIs. This is not the best
practice for applications, and is done to make example code more concise.
Example:
ESP_ERROR_CHECK(spi_bus_initialize(host, bus_config, dma_chan));
4.7.12 C++ Exceptions
Support for C++ Exceptions in ESP-IDF is disabled by default, but can be enabled using CON-
FIG_COMPILER_CXX_EXCEPTIONS option.
Enabling exception handling normally increases application binary size by a few kB. Additionally it may be necessary
to reserve some amount of RAM for exception emergency pool. Memory from this pool will be used if it is not
possible to allocate exception object from the heap. Amount of memory in the emergency pool can be set using
CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE variable.
If an exception is thrown, but there is no catch block, the program will be terminated by abort function, and
backtrace will be printed. See Fatal Errors for more information about backtraces.
See cxx/exceptions for an example of C++ exception handling.
4.8 ESP-WIFI-MESH
This guide provides information regarding the ESP-WIFI-MESH protocol. Please see the ESP-WIFI-MESH API
Reference for more information about API usage.
4.8.1 Overview
ESP-WIFI-MESH is a networking protocol built atop the Wi-Fi protocol. ESP-WIFI-MESH allows numerous de-
vices (henceforth referred to as nodes) spread over a large physical area (both indoors and outdoors) to be intercon-
nected under a single WLAN (Wireless Local-Area Network). ESP-WIFI-MESH is self-organizing and self-healing
meaning the network can be built and maintained autonomously.
The ESP-WIFI-MESH guide is split into the following sections:
1. Introduction
2. ESP-WIFI-MESH Concepts
3. Building a Network
4. Managing a Network
5. Data Transmission
Espressif Systems 1306
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish