When using a custom MAC address scheme, it is possible that not all interfaces can be assigned with a universally administered MAC address. The table above shows how to calculate and derive the MAC address for a specific interface according to the base MAC address. Use a new API: call esp_iface_mac_addr_set() with the ESP_MAC_BASE argument.ĮSP32 comes pre-programmed with enough valid Espressif universally administered MAC addresses for all internal interfaces. Use an old API: call esp_base_mac_addr_set(). Once custom eFuse MAC address has been obtained (using esp_efuse_mac_get_custom() or esp_read_mac()), you need to set it as the base MAC address. If the 3/4 coding scheme is enabled, all eFuse fields in this block must be burnt at the same time. Based on the table above, users can configure the option CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES to set the number of valid universal MAC addresses that can be derived from the custom base MAC. The custom base MAC addresses should be allocated such that derived MAC addresses will not overlap. The custom MAC address can be stored in any supported storage device (e.g., flash, NVS). To set a custom base MAC instead, call the function esp_iface_mac_addr_set() with the ESP_MAC_BASE argument (or esp_base_mac_addr_set()) before initializing any network interfaces or calling the esp_read_mac() function. The default base MAC is pre-programmed by Espressif in eFuse BLK0. Once a MAC address has been set for a particular interface, it will not be affected when the base MAC address is changed. This function allows you to overwrite the MAC addresses of interfaces set (or not yet set) by the base MAC address. To set a custom interface MAC address, use the esp_iface_mac_addr_set() function. Sometimes you may need to define custom MAC addresses that are not generated from the base MAC address. The configuration configures the number of universally administered MAC addresses that are provided by Espressif. Local MAC (derived from Wi-Fi Station MAC) MAC Address (4 universally administered, default) This base MAC address is pre-programmed into the ESP32 eFuse in the factory during production. By default, the Espressif base MAC address is used. In ESP-IDF, the MAC addresses for the various network interfaces are calculated from a single base MAC address. To fetch the MAC address for a specific network interface (e.g., Wi-Fi, Bluetooth, Ethernet), call the function esp_read_mac(). These APIs allow querying and customizing MAC addresses for different supported network interfaces (e.g., Wi-Fi, Bluetooth, Ethernet). For further information about heap memory, see Heap Memory Allocation. The functions mentioned in this section return the size of heap memory that can be allocated using the malloc family of functions. Note that ESP-IDF supports multiple heaps with different capabilities. Two heap-memory-related functions are provided:Įsp_get_free_heap_size() returns the current size of free heap memory.Įsp_get_minimum_free_heap_size() returns the minimum size of free heap memory that has ever been available (i.e., the smallest size of free heap memory in the application’s lifetime). See description of esp_reset_reason_t for the list of possible reset reasons. To get the last reset reason, call esp_reset_reason() function. Reset Reason ĮSP-IDF applications can be started or restarted due to a variety of reasons. This is similar to the functionality of atexit POSIX function. When the function is called, execution of the program stops, both CPUs are reset, the application is loaded by the bootloader and starts execution again.Īdditionally, the esp_register_shutdown_handler() function can register a routine that will be automatically called before a restart (that is triggered by esp_restart()) occurs. To perform software reset of the chip, the esp_restart() function is provided.
0 Comments
Leave a Reply. |