mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
flash:patch for clearing WEL in ROM
This commit is contained in:
parent
87bc33f7df
commit
f448e97fea
@ -101,11 +101,13 @@ esp_rom_spiflash_result_t esp_rom_spiflash_unlock(void)
|
|||||||
while (REG_READ(SPI_CMD_REG(SPI_IDX)) != 0) {
|
while (REG_READ(SPI_CMD_REG(SPI_IDX)) != 0) {
|
||||||
}
|
}
|
||||||
esp_rom_spiflash_wait_idle(&g_rom_spiflash_chip);
|
esp_rom_spiflash_wait_idle(&g_rom_spiflash_chip);
|
||||||
if (esp_rom_spiflash_write_status(&g_rom_spiflash_chip, new_status) != ESP_ROM_SPIFLASH_RESULT_OK) {
|
esp_rom_spiflash_result_t ret = esp_rom_spiflash_write_status(&g_rom_spiflash_chip, new_status);
|
||||||
return ESP_ROM_SPIFLASH_RESULT_ERR;
|
// WEL bit should be cleared after operations regardless of writing succeed or not.
|
||||||
|
esp_rom_spiflash_wait_idle(&g_rom_spiflash_chip);
|
||||||
|
REG_WRITE(SPI_CMD_REG(SPI_IDX), SPI_FLASH_WRDI);
|
||||||
|
while (REG_READ(SPI_CMD_REG(SPI_IDX)) != 0) {
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return ESP_ROM_SPIFLASH_RESULT_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
#if CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
||||||
|
Loading…
Reference in New Issue
Block a user