spi_flash: RAM loadable ELF should have dangerous writes option allowed

For RAM loadable ELF case, there is no application or the bootloader on
the flash. And hence the check for getting current running OTA partition
or looking up partition table fails during dangerous writes option.

We are disabling the dangerous writes option for RAM loadable ELF case
and allowing writes to entire flash memory.
This commit is contained in:
Mahavir Jain 2023-03-17 09:39:43 +05:30
parent 159edc5d86
commit bad4cd7072
No known key found for this signature in database
GPG Key ID: 99324EF4A00734E0
2 changed files with 2 additions and 0 deletions

View File

@ -74,6 +74,7 @@ menu "SPI Flash driver"
choice SPI_FLASH_DANGEROUS_WRITE
bool "Writing to dangerous flash regions"
default SPI_FLASH_DANGEROUS_WRITE_ALLOWED if APP_BUILD_TYPE_RAM
default SPI_FLASH_DANGEROUS_WRITE_ABORTS
help
SPI flash APIs can optionally abort or return a failure code

View File

@ -19,6 +19,7 @@ Feature Supported by ESP-IDF but not in Chip-ROM
- :ref:`CONFIG_SPI_FLASH_VERIFY_WRITE`, enabling this option helps you detect bad writing.
- :ref:`CONFIG_SPI_FLASH_LOG_FAILED_WRITE`, enabling this option will print the bad writing.
- :ref:`CONFIG_SPI_FLASH_WARN_SETTING_ZERO_TO_ONE`, enabling this option will check if you're writing zero to one.
- :ref:`CONFIG_SPI_FLASH_DANGEROUS_WRITE`, enabling this option will check for flash programming to certain protected regions like bootloader, partition table or application itself.
:esp32h2 or esp32c6: - Flash MMAP driver isn't ready in Chip-ROM.