

This function copies a universal MAC address and then sets the “locallyĪdministered” bit (bit 0x2) in the first octet, creating a locally administered MAC address. length: 6 bytes for MAC-48 8 bytes for EUI-64(used for IEEE 802.15.4)ĮSP_OK on success esp_err_t esp_derive_local_mac ( uint8_t * local_mac, const uint8_t * universal_mac ) ĭerive local MAC address from universal MAC address. Mac – base MAC address, length: 6 bytes/8 bytes. Then calculates the MAC address of the specific interface requested, refer to ESP-IDF Programming Guide for the algorithm. This function first get base MAC address using esp_base_mac_addr_get(). Read base MAC address and set MAC address of the interface. ParametersĮSP_OK on success ESP_ERR_INVALID_ARG mac is NULL esp_err_t esp_read_mac ( uint8_t * mac, esp_mac_type_t type ) Return base MAC address which is factory-programmed by Espressif in EFUSE. length: 6 bytes for MAC-48 8 bytes for EUI-64(used for IEEE 802.15.4) ReturnsĮSP_OK on success ESP_ERR_INVALID_ARG mac is NULL ESP_ERR_INVALID_MAC CUSTOM_MAC address has not been set, all zeros (for esp32-xx) ESP_ERR_INVALID_VERSION An invalid MAC version field was read from BLK3 of EFUSE (for esp32) ESP_ERR_INVALID_CRC An invalid MAC CRC was read from BLK3 of EFUSE (for esp32) esp_err_t esp_efuse_mac_get_default ( uint8_t * mac ) This function is currently only supported on ESP32. uint32_t esp_get_free_heap_size ( void ) See description of esp_reset_reason_t for explanation of each value. esp_reset_reason_t esp_reset_reason ( void )

Peripherals (except for Wi-Fi, BT, UART0, SPI1, and legacy timers) are not reset. After successful restart, CPU reset reason will be SW_CPU_RESET.
REASON FOR MAC FREE TO PRO
This function can be called both from PRO and APP CPUs. This function allows you to unregister a handler which was previously registered using esp_register_shutdown_handler function.ĮSP_ERR_INVALID_STATE if the given handler hasn’t been registered before Handle – function to execute on restart ReturnsĮSP_ERR_INVALID_STATE if the handler has already been registeredĮSP_ERR_NO_MEM if no more shutdown handler slots are availableĮsp_err_t esp_unregister_shutdown_handler ( shutdown_handler_t handle ) This function allows you to register a handler that gets invoked before the application is restarted using esp_restart function. Application can make use of this by calling esp_ota_get_app_description() or esp_ota_get_partition_description() functions.įunctions esp_err_t esp_register_shutdown_handler ( shutdown_handler_t handle ) If neither is available, PROJECT_VER will be set to “1”. Otherwise, if the PROJECT_VER variable is not set in the project, it will be retrieved either from the $(PROJECT_PATH)/version.txt file (if present) or using git command git describe. If the CONFIG_APP_PROJECT_VER_FROM_CONFIG option is set, the value of CONFIG_APP_PROJECT_VER will be used. In application CMakeLists.txt, put set(PROJECT_VER "0.1.0.1") before including project.cmake. To set the version in your project manually, you need to set the PROJECT_VER variable in the CMakeLists.txt of your project.

The type of the field version is string and it has a maximum length of 32 chars. The structure is located after esp_image_header_t and esp_image_segment_header_t structures. It is located in DROM sector and has a fixed offset from the beginning of the binary file. The application version is stored in esp_app_desc_t structure. If this bit is already set in the supplied universal MAC address (i.e., the supplied “universal” MAC address was in fact already a local MAC address), then the first octet of the local MAC address is XORed with 0x4. The U/L bit (bit value 0x2) is set in the first octet of the universal MAC address, creating a local MAC address. See this article for the definition of locally and universally administered MAC addresses.įunction esp_derive_local_mac() is called internally to derive a local MAC address from a universal MAC address. Note that these addresses are intended for use on a single local network only. In these cases, a locally administered MAC address is assigned. When using a custom MAC address scheme, it is possible that not all interfaces can be assigned with a universally administered MAC address.
REASON FOR MAC FREE TO HOW TO
The table above shows how to calculate and derive the MAC address for a specific interface according to the base MAC address.

ESP32 comes pre-programmed with enough valid Espressif universally administered MAC addresses for all internal interfaces.
