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