ota: fix ota with flash encryption

This commit is contained in:
Cao Sen Miao
2021-02-19 11:50:27 +08:00
parent 48cda62bcf
commit 6fbf61493c
5 changed files with 13 additions and 6 deletions

View File

@@ -32,6 +32,7 @@ static inline void IRAM_ATTR spi_flash_guard_end(void)
}
}
extern void IRAM_ATTR flash_rom_init(void);
esp_rom_spiflash_result_t IRAM_ATTR spi_flash_write_encrypted_chip(size_t dest_addr, const void *src, size_t size)
{
const uint8_t *ssrc = (const uint8_t *)src;
@@ -73,6 +74,7 @@ esp_rom_spiflash_result_t IRAM_ATTR spi_flash_write_encrypted_chip(size_t dest_a
}
spi_flash_guard_start();
flash_rom_init();
rc = esp_rom_spiflash_write_encrypted(row_addr, (uint32_t *)encrypt_buf, 32);
spi_flash_guard_end();
if (rc != ESP_ROM_SPIFLASH_RESULT_OK) {