With the esp-ota Update Module, Mender leverages ESP-IDF's OTA mechanism and bootloader to enable atomic updates on microcontrollers. The device has two OTA app partitions: the active partition holds the currently running image, and the inactive partition receives the update. When an update is deployed, the new firmware is written into the inactive partition and set as the boot partition. If the new firmware fails to boot or isn't confirmed as valid, the bootloader reverts to the previous image to ensure the device recovers and is not bricked.
For Mender's ESP-IDF integration:
MENDER_ESP_OTA_UPDATE_MODULE, enabled by default) automatically enables the bootloader's rollback support (BOOTLOADER_APP_ROLLBACK_ENABLE).otadata partition and two OTA app partitions, ota_0 and ota_1. See Board integration.