Chapter 2. API Reference
Header File
• components/esp_common/include/esp_idf_version.h
Functions
const char *esp_get_idf_version(void)
Return full IDF version string, same as ‘git describe’output.
Note If you are printing the ESP-IDF version in a log file or other information, this function provides more
information than using the numerical version macros. For example, numerical version macros don’t
differentiate between development, pre-release and release versions, but the output of this function does.
Return constant string from IDF_VER
Macros
ESP_IDF_VERSION_MAJOR
Major version number (X.x.x)
ESP_IDF_VERSION_MINOR
Minor version number (x.X.x)
ESP_IDF_VERSION_PATCH
Patch version number (x.x.X)
ESP_IDF_VERSION_VAL(major, minor, patch)
Macro to convert IDF version number into an integer
To be used in comparisons, such as ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
ESP_IDF_VERSION
Current IDF version, as an integer
To be used in comparisons, such as ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
2.6.19 Over The Air Updates (OTA)
OTA Process Overview
The OTA update mechanism allows a device to update itself based on data received while the normal firmware is
running (for example, over Wi-Fi or Bluetooth.)
OTA requires configuring the Partition Table of the device with at least two “OTA app slot”partitions (i.e. ota_0
and ota_1) and an “OTA Data Partition”.
The OTA operation functions write a new app firmware image to whichever OTA app slot that is currently not selected
for booting. Once the image is verified, the OTA Data partition is updated to specify that this image should be used
for the next boot.
OTA Data Partition
An OTA data partition (type data, subtype ota) must be included in the Partition Table of any project which uses
the OTA functions.
For factory boot settings, the OTA data partition should contain no data (all bytes erased to 0xFF). In this case the
esp-idf software bootloader will boot the factory app if it is present in the the partition table. If no factory app is
included in the partition table, the first available OTA slot (usually ota_0) is booted.
After the first OTA update, the OTA data partition is updated to specify which OTA app slot partition should be
booted next.
The OTA data partition is two flash sectors (0x2000 bytes) in size, to prevent problems if there is a power failure
while it is being written. Sectors are independently erased and written with matching data, and if they disagree a
counter field is used to determine which sector was written more recently.
Espressif Systems 1016
Submit Document Feedback
Release v4.4