Function esp_idf_svc::hal::sys::esp_ota_set_boot_partition

source ·
pub unsafe extern "C" fn esp_ota_set_boot_partition(
    partition: *const esp_partition_t,
) -> i32
Expand description

@brief Configure OTA data for a new boot partition

@note If this function returns ESP_OK, calling esp_restart() will boot the newly configured app partition.

@param partition Pointer to info for partition containing app image to boot.

@return

  • ESP_OK: OTA data updated, next reboot will use specified partition.
  • ESP_ERR_INVALID_ARG: partition argument was NULL or didn’t point to a valid OTA partition of type “app”.
  • ESP_ERR_OTA_VALIDATE_FAILED: Partition contained invalid app image. Also returned if secure boot is enabled and signature validation failed.
  • ESP_ERR_NOT_FOUND: OTA data partition not found.
  • ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash erase or write failed.