mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-27 20:04:21 +00:00
spi_flash: move the unlock patch to bootloader and add support for GD
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include "cache_utils.h"
|
||||
#include "esp_flash.h"
|
||||
#include "esp_attr.h"
|
||||
#include "bootloader_flash.h"
|
||||
|
||||
esp_rom_spiflash_result_t IRAM_ATTR spi_flash_write_encrypted_chip(size_t dest_addr, const void *src, size_t size);
|
||||
|
||||
@@ -239,11 +240,8 @@ static esp_rom_spiflash_result_t IRAM_ATTR spi_flash_unlock(void)
|
||||
static bool unlocked = false;
|
||||
if (!unlocked) {
|
||||
spi_flash_guard_start();
|
||||
esp_rom_spiflash_result_t rc = esp_rom_spiflash_unlock();
|
||||
bootloader_flash_unlock();
|
||||
spi_flash_guard_end();
|
||||
if (rc != ESP_ROM_SPIFLASH_RESULT_OK) {
|
||||
return rc;
|
||||
}
|
||||
unlocked = true;
|
||||
}
|
||||
return ESP_ROM_SPIFLASH_RESULT_OK;
|
||||
|
||||
Reference in New Issue
Block a user