SPI Flash API ESP-IDF version vs Chip-ROM version
There is a set of SPI Flash drivers in Chip-ROM which you can use by enabling CONFIG_SPI_FLASH_ROM_IMPL. Most of the ESP-IDF SPI Flash driver code are in internal RAM, therefore enabling this option will free some internal RAM usage. Note if you enable this option, this means some SPI Flash driver features and bugfixes that are done in ESP-IDF might not be included in the Chip-ROM version.
Feature Supported by ESP-IDF but not in Chip-ROM
Octal Flash chip support. See OPI flash support for details.
32-bit-address support for GD25Q256. See 32-bit Address Flash Chips for details.
TH Flash chip support.
Kconfig option CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED.
CONFIG_SPI_FLASH_VERIFY_WRITE, enabling this option helps you detect bad writing.
CONFIG_SPI_FLASH_LOG_FAILED_WRITE, enabling this option will print the bad writing.
CONFIG_SPI_FLASH_WARN_SETTING_ZERO_TO_ONE, enabling this option will check if you're writing zero to one.
CONFIG_SPI_FLASH_DANGEROUS_WRITE, enabling this option will check for flash programming to certain protected regions like bootloader, partition table or application itself.
CONFIG_SPI_FLASH_ENABLE_COUNTERS, enabling this option to collect performance data for ESP-IDF SPI Flash driver APIs.
Bugfixes Introduced in ESP-IDF but not in Chip-ROM
Detected Flash physical size correctly, for larger than 256MBit Flash chips. (Commit ID: b4964279d44f73cce7cfd5cf684567fbdfd6fd9e)
Improved SPI1 cs setup timing, otherwise issue may happen on ZB32Q128. (Commit ID: 08f1bbe0c75382f1702e40c941e93314285105d4)
Fixed issue that only 128KB virtual address ranges can be mapped to instructions on Flash.