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 #1024 background imageLoading...
Page #1024 background image
Chapter 2. API Reference
Custom MAC address in eFuse When reading custom MAC addresses from eFuse, ESP-IDF provides a helper
function esp_efuse_mac_get_custom(). This loads the MAC address from eFuse BLK3. This function
assumes that the custom base MAC address is stored in the following format:
Field # of bits Range of bits
MAC address 48 200:248
Note: The eFuse BLK3 uses RS-coding during a burn operation it means that all eFuse fields in this block must be
burnt at the same time.
Once MAC address has been obtained using esp_efuse_mac_get_custom(), call
esp_base_mac_addr_set() to set this MAC address as base MAC address.
Local vs Universal MAC addresses ESP32-S2 comes pre-programmed with enough valid Espressif universally
administered MAC addresses for all internal interfaces. The specific calculations to derive an interfaces MAC
address from the base MAC address is shown in the table above..
When using a custom MAC address scheme, its possible that not all interfaces can be assigned a universally ad-
ministered MAC address. In these cases, a locally administered MAC address is assigned. Note that these addresses
are intended for use on a single local network, only.
See this article for the definition of local and universally administered MAC addresses.
Function esp_derive_local_mac() is called internally to derive a local MAC address from a universal MAC
address. The process is as follows:
1. The U/L bit (bit value 0x2) is set in the first octet of the universal MAC address, creating a local MAC address.
2. If this bit is already set in the supplied universal MAC address (meaning: the supplied universalMAC
address was in fact already a local MAC address), then the first octet of the local MAC address is XORed with
0x4.
Chip version
esp_chip_info() function fills esp_chip_info_t structure with information about the chip. This includes
the chip revision, number of CPU cores, and a bit mask of features enabled in the chip.
SDK version
esp_get_idf_version() returns a string describing the IDF version which was used to compile the application.
This is the same value as the one available through IDF_VER variable of the build system. The version string generally
has the format of git describe output.
To get the version at build time, additional version macros are provided. They can be used to enable or disable parts
of the program depending on IDF version.
ESP_IDF_VERSION_MAJOR, ESP_IDF_VERSION_MINOR, ESP_IDF_VERSION_PATCH are de-
fined to integers representing major, minor, and patch version.
ESP_IDF_VERSION_VAL and ESP_IDF_VERSION can be used when implementing version checks:
#include "esp_idf_version.h"
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
// enable functionality present in IDF v4.0
#endif
Espressif Systems 1013
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