flash_encryption: return more clear error codes when bootloader encryption fails

This commit is contained in:
Felipe Neves
2020-03-31 16:09:31 -03:00
parent b3d8847406
commit 6f27992430
3 changed files with 3 additions and 4 deletions

View File

@@ -233,7 +233,7 @@ static esp_err_t encrypt_bootloader(void)
image_length += FLASH_SECTOR_SIZE;
if (ESP_BOOTLOADER_OFFSET + image_length > ESP_PARTITION_TABLE_OFFSET) {
ESP_LOGE(TAG, "Bootloader is too large to fit Secure Boot V2 signature sector and partition table (configured offset 0x%x)", ESP_PARTITION_TABLE_OFFSET);
return ESP_ERR_INVALID_STATE;
return ESP_ERR_INVALID_SIZE;
}
#endif // CONFIG_SECURE_BOOT_V2_ENABLED
@@ -248,7 +248,7 @@ static esp_err_t encrypt_bootloader(void)
}
else {
ESP_LOGW(TAG, "no valid bootloader was found");
return ESP_ERR_INVALID_STATE;
return ESP_ERR_NOT_FOUND;
}
}