2016-09-23 00:44:45 +00:00
|
|
|
menu "SPI Flash driver"
|
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
config SPI_FLASH_VERIFY_WRITE
|
|
|
|
bool "Verify SPI flash writes"
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
If this option is enabled, any time SPI flash is written then the data will be read
|
|
|
|
back and verified. This can catch hardware problems with SPI flash, or flash which
|
|
|
|
was not erased before verification.
|
2017-10-06 04:38:01 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
config SPI_FLASH_LOG_FAILED_WRITE
|
|
|
|
bool "Log errors if verification fails"
|
|
|
|
depends on SPI_FLASH_VERIFY_WRITE
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
If this option is enabled, if SPI flash write verification fails then a log error line
|
|
|
|
will be written with the address, expected & actual values. This can be useful when
|
|
|
|
debugging hardware SPI flash problems.
|
2017-10-06 04:38:01 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
config SPI_FLASH_WARN_SETTING_ZERO_TO_ONE
|
|
|
|
bool "Log warning if writing zero bits to ones"
|
|
|
|
depends on SPI_FLASH_VERIFY_WRITE
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
If this option is enabled, any SPI flash write which tries to set zero bits in the flash to
|
|
|
|
ones will log a warning. Such writes will not result in the requested data appearing identically
|
|
|
|
in flash once written, as SPI NOR flash can only set bits to one when an entire sector is erased.
|
|
|
|
After erasing, individual bits can only be written from one to zero.
|
2017-11-29 03:26:57 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
Note that some software (such as SPIFFS) which is aware of SPI NOR flash may write one bits as an
|
|
|
|
optimisation, relying on the data in flash becoming a bitwise AND of the new data and any existing data.
|
|
|
|
Such software will log spurious warnings if this option is enabled.
|
2017-11-29 03:26:57 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
config SPI_FLASH_ENABLE_COUNTERS
|
|
|
|
bool "Enable operation counters"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
This option enables the following APIs:
|
2016-09-23 00:44:45 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
- spi_flash_reset_counters
|
|
|
|
- spi_flash_dump_counters
|
|
|
|
- spi_flash_get_counters
|
2017-03-09 07:29:00 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
These APIs may be used to collect performance data for spi_flash APIs
|
|
|
|
and to help understand behaviour of libraries which use SPI flash.
|
2017-10-25 07:22:30 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
config SPI_FLASH_ROM_DRIVER_PATCH
|
|
|
|
bool "Enable SPI flash ROM driver patched functions"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable this flag to use patched versions of SPI flash ROM driver functions.
|
|
|
|
This option is needed to write to flash on ESP32-D2WD, and any configuration
|
|
|
|
where external SPI flash is connected to non-default pins.
|
2017-10-25 07:22:30 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
choice SPI_FLASH_WRITING_DANGEROUS_REGIONS
|
|
|
|
bool "Writing to dangerous flash regions"
|
|
|
|
default SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
|
|
|
|
help
|
|
|
|
SPI flash APIs can optionally abort or return a failure code
|
|
|
|
if erasing or writing addresses that fall at the beginning
|
|
|
|
of flash (covering the bootloader and partition table) or that
|
|
|
|
overlap the app partition that contains the running app.
|
2017-10-25 07:22:30 +00:00
|
|
|
|
2019-01-25 16:10:53 +00:00
|
|
|
It is not recommended to ever write to these regions from an IDF app,
|
|
|
|
and this check prevents logic errors or corrupted firmware memory from
|
|
|
|
damaging these regions.
|
|
|
|
|
|
|
|
Note that this feature *does not* check calls to the esp_rom_xxx SPI flash
|
|
|
|
ROM functions. These functions should not be called directly from IDF
|
|
|
|
applications.
|
|
|
|
|
2019-06-11 08:32:59 +00:00
|
|
|
config SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
|
|
|
|
bool "Aborts"
|
|
|
|
config SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS
|
|
|
|
bool "Fails"
|
|
|
|
config SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
|
|
|
bool "Allowed"
|
2019-01-25 16:10:53 +00:00
|
|
|
endchoice
|
2017-10-25 07:22:30 +00:00
|
|
|
|
2016-09-23 00:44:45 +00:00
|
|
|
endmenu
|