Chapter 2. API Reference
Intended to be called as a part of boot process if flash encryption is enabled but secure boot is not used. This
should protect against serial re-flashing of an unauthorised code in absence of secure boot.
Note On ESP32 V3 only, write protecting FLASH_CRYPT_CNT will also prevent disabling UART Down-
load Mode. If both are wanted, call esp_efuse_disable_rom_download_mode() before calling this func-
tion.
esp_flash_enc_mode_t esp_get_flash_encryption_mode(void)
Return the flash encryption mode.
The API is called during boot process but can also be called by application to check the current flash encryption
mode of ESP32
Return
void esp_flash_encryption_init_checks(void)
Check the flash encryption mode during startup.
Verifies the flash encryption config during startup:
Note This function is called automatically during app startup, it doesn’t need to be called from the app.
• Correct any insecure flash encryption settings if hardware Secure Boot is enabled.
• Log warnings if the efuse config doesn’t match the project config in any way
esp_err_t esp_flash_encryption_enable_secure_features(void)
Set all secure eFuse features related to flash encryption.
Return
• ESP_OK - Successfully
void esp_flash_encryption_set_release_mode(void)
Switches Flash Encryption from “Development”to “Release”.
If already in “Release”mode, the function will do nothing. If flash encryption efuse is not enabled yet then
abort. It burns:
• ”disable encrypt in dl mode”
• set FLASH_CRYPT_CNT efuse to max
Enumerations
enum esp_flash_enc_mode_t
Values:
ESP_FLASH_ENC_MODE_DISABLED
ESP_FLASH_ENC_MODE_DEVELOPMENT
ESP_FLASH_ENC_MODE_RELEASE
2.5.7 SPIFFS Filesystem
Overview
SPIFFS is a file system intended for SPI NOR flash devices on embedded targets. It supports wear levelling, file
system consistency checks, and more.
Notes
• Currently, SPIFFS does not support directories, it produces a flat structure. If SPIFFS is mounted under
/spiffs, then creating a file with the path /spiffs/tmp/myfile.txt will create a file called /tmp/
myfile.txt in SPIFFS, instead of myfile.txt in the directory /spiffs/tmp.
• It is not a real-time stack. One write operation might take much longer than another.
• For now, it does not detect or handle bad blocks.
Espressif Systems 764
Submit Document Feedback
Release v4.4