Chapter 4. API Guides
Note: If the flashed ciphertext file is not recognized by the ESP32-S2 when it boots, check that the keys match and
that the command line arguments match exactly, including the correct offset.
The command espsecure.py decrypt_flash_data can be used with the same options (and different
input/output files), to decrypt ciphertext flash contents or a previously encrypted file.
4.13.14 External RAM
When Flash Encryption is enabled any data read from and written to external SPI RAM through the cache will also be
encrypted/decrypted. This happens the same way and with the same key as for Flash Encryption. If Flash Encryption
is enabled then encryption for external SPI RAM is also always enabled, it is not possible to separately control this
functionality.
4.13.15 Technical Details
The following sections provide some reference information about the operation of flash encryption.
Flash Encryption Algorithm
• ESP32-S2 use the XTS-AES block cipher mode with 256 bit or 512 bit key size for flash encryption.
• XTS-AES is a block cipher mode specifically designed for disc encryption and addresses the weaknesses other
potential modes (e.g. AES-CTR) have for this use case. A detailed description of the XTS-AES algorithm can
be found in IEEE Std 1619-2007.
• The flash encryption key is stored in one or two BLOCK_KEYN eFuses and, by default, is protected from further
writes or software readout.
• To see the full flash encryption algorithm implemented in Python, refer to the _flash_encryption_operation()
function in the espsecure.py source code.
4.14 ESP-IDF FreeRTOS (SMP)
Note: This document assumes that the reader has a requisite understanding of Vanilla FreeRTOS (its features,
behavior, and API usage). Refer to the Vanilla FreeRTOS documentation for more details.
This document describes the API and behavioral differences between Vanilla FreeRTOS and ESP-IDF FreeRTOS
that were made in order to support Symmetric Multiprocessing (SMP). This document is split into the following parts.
Contents
• ESP-IDF FreeRTOS (SMP)
– Overview
– Symmetric Multiprocessing
* Basic Concepts
* SMP on an ESP Target
– Tasks
* Creation
* Execution
* Deletion
– SMP Scheduler
* Fixed Priority
Espressif Systems 1357
Submit Document Feedback
Release v4.4