Espressif ESP32-S2 Programming Manual page 1023

Table of Contents

Advertisement

Chapter 2. API Reference
Heap memory
Two heap memory related functions are provided:
esp_get_free_heap_size()
esp_get_minimum_free_heap_size()
available during program execution.
Note that ESP-IDF supports multiple heaps with different capabilities. Functions mentioned in this section return the
size of heap memory which can be allocated using malloc family of functions. For further information about heap
memory see
Heap Memory
MAC Address
These APIs allow querying and customizing MAC addresses for different network interfaces that supported (e.g.
Wi-Fi, Bluetooth, Ethernet).
To fetch MAC address for a specific interface (e.g.
esp_read_mac() function.
In ESP-IDF these addresses are calculated from a single Base MAC address. By default, the Espressif base MAC
address is used. This MAC is pre-programmed into ESP32-S2 eFuse from the factory.
Interface
MAC address (2 universally admin-
istered, default)
Wi-Fi
Sta-
base_mac
tion
Wi-Fi
Sof-
base_mac, +1 to the last octet
tAP
Ethernet (see
Local MAC
note)
tAP MAC
Note: The default
configuration
Espressif-provided MAC addresses.
Note: ESP32-S2 has no integrated Ethernet MAC, but it's still possible to calculate an Ethernet MAC address.
This MAC address can only be used with an external interface such as a SPI-Ethernet device, see Ethernet.
Custom Base MAC
The default Base MAC is pre-programmed by Espressif in eFuse BLK1. To set a custom
Base MAC instead, call the function esp_base_mac_addr_set() before initializing any network interfaces
or calling the esp_read_mac() function. The customized MAC address can be stored in any supported storage
device (e.g. Flash, NVS, etc).
The custom base MAC addresses should be allocated such that derived MAC addresses will not overlap. Configure
the option
CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES
that can be derived from the custom base MAC, according to the table above.
Note: It is also possible to call the function
interface, after network initialization. It's recommended to use the Base MAC approach documented here instead,
to avoid the possibility of the original MAC address briefly appearing on the network before it is changed.
Espressif Systems
returns the current size of free heap memory
Allocation.
(derived from Wi-Fi Sof-
is 2 universally administered MAC addresses, and this is recommended when using
esp_netif_set_mac()
Submit Document Feedback
returns the minimum size of free heap memory that was
Wi-Fi Station, Wi-Fi SoftAP), call the function
MAC address (1 universally administered)
base_mac
Local MAC
(derived from Wi-Fi Station MAC)
Local MAC
(derived from base_mac with +1 to last
octet. Not recommended.)
to set the number of valid universal MAC addresses
to set the specific MAC used by a network
1012
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF