Kconfig 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. menu "SPI Flash driver"
  2. config SPI_FLASH_VERIFY_WRITE
  3. bool "Verify SPI flash writes"
  4. default n
  5. help
  6. If this option is enabled, any time SPI flash is written then the data will be read
  7. back and verified. This can catch hardware problems with SPI flash, or flash which
  8. was not erased before verification.
  9. config SPI_FLASH_LOG_FAILED_WRITE
  10. bool "Log errors if verification fails"
  11. depends on SPI_FLASH_VERIFY_WRITE
  12. default n
  13. help
  14. If this option is enabled, if SPI flash write verification fails then a log error line
  15. will be written with the address, expected & actual values. This can be useful when
  16. debugging hardware SPI flash problems.
  17. config SPI_FLASH_WARN_SETTING_ZERO_TO_ONE
  18. bool "Log warning if writing zero bits to ones"
  19. depends on SPI_FLASH_VERIFY_WRITE
  20. default n
  21. help
  22. If this option is enabled, any SPI flash write which tries to set zero bits in the flash to
  23. ones will log a warning. Such writes will not result in the requested data appearing identically
  24. in flash once written, as SPI NOR flash can only set bits to one when an entire sector is erased.
  25. After erasing, individual bits can only be written from one to zero.
  26. Note that some software (such as SPIFFS) which is aware of SPI NOR flash may write one bits as an
  27. optimisation, relying on the data in flash becoming a bitwise AND of the new data and any existing data.
  28. Such software will log spurious warnings if this option is enabled.
  29. config SPI_FLASH_ENABLE_COUNTERS
  30. bool "Enable operation counters"
  31. default 0
  32. help
  33. This option enables the following APIs:
  34. - spi_flash_reset_counters
  35. - spi_flash_dump_counters
  36. - spi_flash_get_counters
  37. These APIs may be used to collect performance data for spi_flash APIs
  38. and to help understand behaviour of libraries which use SPI flash.
  39. config SPI_FLASH_ROM_DRIVER_PATCH
  40. bool "Enable SPI flash ROM driver patched functions"
  41. default y
  42. help
  43. Enable this flag to use patched versions of SPI flash ROM driver functions.
  44. This option is needed to write to flash on ESP32-D2WD, and any configuration
  45. where external SPI flash is connected to non-default pins.
  46. choice SPI_FLASH_WRITING_DANGEROUS_REGIONS
  47. bool "Writing to dangerous flash regions"
  48. default SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
  49. help
  50. SPI flash APIs can optionally abort or return a failure code
  51. if erasing or writing addresses that fall at the beginning
  52. of flash (covering the bootloader and partition table) or that
  53. overlap the app partition that contains the running app.
  54. It is not recommended to ever write to these regions from an IDF app,
  55. and this check prevents logic errors or corrupted firmware memory from
  56. damaging these regions.
  57. Note that this feature *does not* check calls to the esp_rom_xxx SPI flash
  58. ROM functions. These functions should not be called directly from IDF
  59. applications.
  60. config SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
  61. bool "Aborts"
  62. config SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS
  63. bool "Fails"
  64. config SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
  65. bool "Allowed"
  66. endchoice
  67. config SPI_FLASH_YIELD_DURING_ERASE
  68. bool "Enables yield operation during flash erase"
  69. default y
  70. help
  71. This allows to yield the CPUs between erase commands.
  72. Prevents starvation of other tasks.
  73. config SPI_FLASH_ERASE_YIELD_DURATION_MS
  74. int "Duration of erasing to yield CPUs (ms)"
  75. depends on SPI_FLASH_YIELD_DURING_ERASE
  76. default 20
  77. help
  78. If a duration of one erase command is large
  79. then it will yield CPUs after finishing a current command.
  80. config SPI_FLASH_ERASE_YIELD_TICKS
  81. int "CPU release time (tick)"
  82. depends on SPI_FLASH_YIELD_DURING_ERASE
  83. default 1
  84. help
  85. Defines how many ticks will be before returning to continue a erasing.
  86. endmenu