EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1356 background imageLoading...
Page #1356 background image
Chapter 4. API Guides
Development Mode
During development, you can encrypt flash using either an ESP32-S2 generated key or external host-generated key.
Using ESP32-S2 Generated Key Development mode allows you to download multiple plaintext images using
Firmware Download mode.
To test flash encryption process, take the following steps:
1. Ensure that you have an ESP32-S2 device with default flash encryption eFuse settings as shown in Relevant
eFuses.
See how to check ESP32-S2 Flash Encryption Status.
2. In Project Configuration Menu, do the following:
Enable flash encryption on boot
Select encryption mode (Development mode by default)
Select UART ROM download mode (enabled by default.)
Set Size of generated AES-XTS key
Select the appropriate bootloader log verbosity
Save the configuration and exit.
Enabling flash encryption will increase the size of bootloader, which might require updating partition table offset.
See Bootloader Size.
3. Run the command given below to build and flash the complete images.
idf.py flash monitor
Note: This command does not include any user files which should be written to the partitions on the
flash memory. Please write them manually before running this command otherwise the files should be
encrypted separately before writing.
This command will write to flash memory unencrypted images: the firmware bootloader, the partition
table and applications. Once the flashing is complete, ESP32-S2 will reset. On the next boot, the
firmware bootloader encrypts: the firmware bootloader, application partitions and partitions marked as
encrypted then resets. Encrypting in-place can take time, up to a minute for large partitions. After
that, the application is decrypted at runtime and executed.
A sample output of the first ESP32-S2 boot after enabling flash encryption is given below:
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6260,len:0x78
load:0x3ffe62d8,len:0x231c
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x3cf8
entry 0x4004c1ec
I (48) boot: ESP-IDF qa-test-v4.3-20201113-777-gd8e1 2nd stage bootloader
I (48) boot: compile time 11:24:04
I (48) boot: chip revision: 0
I (52) boot.esp32s2: SPI Speed : 80MHz
I (57) boot.esp32s2: SPI Mode : DIO
I (62) boot.esp32s2: SPI Flash Size : 2MB
I (66) boot: Enabling RNG early entropy source...
I (72) boot: Partition Table:
I (75) boot: ## Label Usage Type ST Offset Length
(continues on next page)
Espressif Systems 1345
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish