Kconfig 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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_DANGEROUS_WRITE
  47. bool "Writing to dangerous flash regions"
  48. default SPI_FLASH_DANGEROUS_WRITE_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_DANGEROUS_WRITE_ABORTS
  61. bool "Aborts"
  62. config SPI_FLASH_DANGEROUS_WRITE_FAILS
  63. bool "Fails"
  64. config SPI_FLASH_DANGEROUS_WRITE_ALLOWED
  65. bool "Allowed"
  66. endchoice
  67. config SPI_FLASH_USE_LEGACY_IMPL
  68. bool "Use the legacy implementation before IDF v4.0"
  69. default n
  70. help
  71. The implementation of SPI flash has been greatly changed in IDF v4.0.
  72. Enable this option to use the legacy implementation.
  73. config SPI_FLASH_SHARE_SPI1_BUS
  74. bool "Support other devices attached to SPI1 bus"
  75. default n
  76. # The bus lock on SPI1 is meaningless when the legacy implementation is used, or the SPI
  77. # driver does not support SPI1.
  78. depends on !SPI_FLASH_USE_LEGACY_IMPL && !IDF_TARGET_ESP32S2
  79. select FREERTOS_SUPPORT_STATIC_ALLOCATION
  80. help
  81. Each SPI bus needs a lock for arbitration among devices. This allows multiple
  82. devices on a same bus, but may reduce the speed of esp_flash driver access to the
  83. main flash chip.
  84. If you only need to use esp_flash driver to access the main flash chip, disable
  85. this option, and the lock will be bypassed on SPI1 bus. Otherwise if extra devices
  86. are needed to attach to SPI1 bus, enable this option.
  87. config SPI_FLASH_BYPASS_BLOCK_ERASE
  88. bool "Bypass a block erase and always do sector erase"
  89. default n
  90. help
  91. Some flash chips can have very high "max" erase times, especially for block erase (32KB or 64KB).
  92. This option allows to bypass "block erase" and always do sector erase commands.
  93. This will be much slower overall in most cases, but improves latency for other code to run.
  94. config SPI_FLASH_YIELD_DURING_ERASE
  95. bool "Enables yield operation during flash erase"
  96. default y
  97. help
  98. This allows to yield the CPUs between erase commands.
  99. Prevents starvation of other tasks.
  100. config SPI_FLASH_ERASE_YIELD_DURATION_MS
  101. int "Duration of erasing to yield CPUs (ms)"
  102. depends on SPI_FLASH_YIELD_DURING_ERASE
  103. default 20
  104. help
  105. If a duration of one erase command is large
  106. then it will yield CPUs after finishing a current command.
  107. config SPI_FLASH_ERASE_YIELD_TICKS
  108. int "CPU release time (tick)"
  109. depends on SPI_FLASH_YIELD_DURING_ERASE
  110. default 1
  111. help
  112. Defines how many ticks will be before returning to continue a erasing.
  113. config SPI_FLASH_SIZE_OVERRIDE
  114. bool "Override flash size in bootloader header by ESPTOOLPY_FLASHSIZE"
  115. default n
  116. help
  117. SPI Flash driver uses the flash size configured in bootloader header by default.
  118. Enable this option to override flash size with latest ESPTOOLPY_FLASHSIZE value from
  119. the app header if the size in the bootloader header is incorrect.
  120. menu "Auto-detect flash chips"
  121. config SPI_FLASH_SUPPORT_ISSI_CHIP
  122. bool "ISSI"
  123. default y
  124. help
  125. Enable this to support auto detection of ISSI chips if chip vendor not directly
  126. given by ``chip_drv`` member of the chip struct. This adds support for variant
  127. chips, however will extend detecting time.
  128. config SPI_FLASH_SUPPORT_MXIC_CHIP
  129. bool "MXIC"
  130. default y
  131. help
  132. Enable this to support auto detection of MXIC chips if chip vendor not directly
  133. given by ``chip_drv`` member of the chip struct. This adds support for variant
  134. chips, however will extend detecting time.
  135. config SPI_FLASH_SUPPORT_GD_CHIP
  136. bool "GigaDevice"
  137. default y
  138. help
  139. Enable this to support auto detection of GD (GigaDevice) chips if chip vendor not
  140. directly given by ``chip_drv`` member of the chip struct. If you are using Wrover
  141. modules, please don't disable this, otherwise your flash may not work in 4-bit
  142. mode.
  143. This adds support for variant chips, however will extend detecting time and image
  144. size. Note that the default chip driver supports the GD chips with product ID
  145. 60H.
  146. endmenu #auto detect flash chips
  147. config SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE
  148. bool "Enable encrypted partition read/write operations"
  149. default y
  150. help
  151. This option enables flash read/write operations to encrypted partition/s. This option
  152. is kept enabled irrespective of state of flash encryption feature. However, in case
  153. application is not using flash encryption feature and is in need of some additional
  154. memory from IRAM region (~1KB) then this config can be disabled.
  155. endmenu