mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
spi_flash: add configuration option to select flash write chunk size
Flash write operation is broken down into smaller chunk writes. Size of this chunk was previously set to 8K but that in-turn meant cache and non-IRAM resident interrupts could stay disabled upto ~24msec for 8K flash write operation. If chunk size is brought down to 256 (typical flash page size) then it brings down cache and non-IRAM interrupts disable duration to ~1msec. Fix here keeps defaults same but provides configuration option to tweak the setting based on application requirement.
This commit is contained in:
@@ -28,7 +28,12 @@
|
||||
|
||||
static const char TAG[] = "spi_flash";
|
||||
|
||||
#ifdef CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE
|
||||
#define MAX_WRITE_CHUNK CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE /* write in chunks */
|
||||
#else
|
||||
#define MAX_WRITE_CHUNK 8192 /* write in chunks */
|
||||
#endif // CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE
|
||||
|
||||
#define MAX_READ_CHUNK 16384
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user