mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-27 11:58:55 +00:00
spi_flash: No CPU release time for an erase operation when OS is not running
During the early start, the virtual eFuse mode can call erase operations when OS is not yet running. Possible workaround: CONFIG_SPI_FLASH_YIELD_DURING_ERASE=n Fixed for the legacy flash driver as well.
This commit is contained in:
committed by
Cao Sen Miao
parent
173f7e87aa
commit
b0c1ceca06
@@ -50,6 +50,7 @@
|
||||
#include "esp_flash.h"
|
||||
#include "esp_attr.h"
|
||||
#include "bootloader_flash.h"
|
||||
#include "esp_compiler.h"
|
||||
|
||||
esp_rom_spiflash_result_t IRAM_ATTR spi_flash_write_encrypted_chip(size_t dest_addr, const void *src, size_t size);
|
||||
|
||||
@@ -230,7 +231,9 @@ static inline void IRAM_ATTR spi_flash_guard_op_unlock(void)
|
||||
static void IRAM_ATTR spi_flash_os_yield(void)
|
||||
{
|
||||
#ifdef CONFIG_SPI_FLASH_YIELD_DURING_ERASE
|
||||
vTaskDelay(CONFIG_SPI_FLASH_ERASE_YIELD_TICKS);
|
||||
if (likely(xTaskGetSchedulerState() == taskSCHEDULER_RUNNING)) {
|
||||
vTaskDelay(CONFIG_SPI_FLASH_ERASE_YIELD_TICKS);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user