Добавил:
ИВТ (советую зайти в "Несортированное") Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
interfeysy_1 / ИДЗ_машинка / даташиты / esp32_technical_reference_manual_en.pdf
Скачиваний:
16
Добавлен:
26.01.2024
Размер:
9.62 Mб
Скачать

26External Memory Encryption and Decryption (FLASH)

During SPI Flash Boot

If the DPORT_SPI_ENCRYPT_ENABLE bit of register DPORT_SLAVE_SPI_CONFIG_REG is 1, the Flash Encryption block is operational. Otherwise, it is not.

During Download Boot

If the DPORT_SPI_ENCRYPT_ENABLE bit of register DPORT_SLAVE_SPI_CONFIG_REG is 1, and system parameter download_dis_encrypt is 0, the Flash Encryption block is operational. Otherwise, it is not.

Even though software participates in the whole process, it cannot directly read the encrypted codes. Instead, the encrypted codes are integrated into the off-chip flash. Even though the CPU can skip the cache and get the encrypted code directly by reading the off-chip flash, the software can by no means access Keye.

26.3.3 Flash Decryption Block

Flash Decryption is not a conventional peripheral, and is not equipped with registers. Therefore, the CPU cannot directly access the Flash Decryption block. The Peripheral DPort Register, system parameters and Booting Mode jointly control and configure the Flash Decryption block.

When the Flash Decryption block is operating, the CPU will read instructions and data from the off-chip flash via the cache. The Flash Decryption block automatically decrypts the instructions and data in the cache. The entire decryption process does not need software intervention and is transparent to the cache. The decryption algorithm can decrypt the code that has been encrypted by the Flash Encryption block. Software cannot access the key algorithm Keyd used.

When the Flash Decryption block is not operating, it does not have any effect on the contents stored in the off-chip flash, be they encrypted or unencrypted. What the CPU reads via the cache is the original information stored in the off-chip flash.

Flash Encryption Operating Conditions:

During SPI Flash Boot

In the efuse system parameter flash_crypt_cnt (7 bits wide), if the number of bits with value 1 is odd, the Flash Decryption block is operational. Otherwise, it is not.

During Download Boot

If the DPORT_SPI_DECRYPT_ENABLE bit in DPORT_SLAVE_SPI_CONFIG_REG is 1, and system parameter download_dis_decrypt is 0, the Flash Decryption block is operational. Otherwise, it is not.

26.4 Register Summary

 

Name

Description

Address

Access

 

 

FLASH_ENCRYPTION_BUFFER_0_REG

Flash encryption buffer register 0

0x3FF5B000

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_1_REG

Flash encryption buffer register 1

0x3FF5B004

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_2_REG

Flash encryption buffer register 2

0x3FF5B008

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_3_REG

Flash encryption buffer register 3

0x3FF5B00C

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_4_REG

Flash encryption buffer register 4

0x3FF5B010

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_5_REG

Flash encryption buffer register 5

0x3FF5B014

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_6_REG

Flash encryption buffer register 6

0x3FF5B018

WO

 

 

 

 

 

 

 

 

FLASH_ENCRYPTION_BUFFER_7_REG

Flash encryption buffer register 7

0x3FF5B01C

WO

 

 

 

 

 

 

 

Espressif Systems

601

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

26 External Memory Encryption and Decryption (FLASH)

Name

Description

Address

Access

FLASH_ENCRYPTION_START_REG

Encrypt operation control register

0x3FF5B020

WO

 

 

 

 

FLASH_ENCRYPTION_ADDRESS_REG

External flash address register

0x3FF5B024

WO

 

 

 

 

FLASH_ENCRYPTION_DONE_REG

Encrypt operation status register

0x3FF5B028

RO

 

 

 

 

26.5Register

The addresses in parenthesis besides register names are the register addresses relative to the FLASH base address provided in Table 1-6 Peripheral Address Mapping in Chapter 1 System and Memory. The absolute register addresses are listed in Section 26.4 Register Summary.

Register 26.1. FLASH_ENCRYPTION_BUFFER_n_REG (n: 0­7) (0x0+4*n)

31

0

 

 

 

Reset

 

 

0x000000000

 

FLASH_ENCRYPTION_BUFFER_n_REG Data buffers for encryption. (WO)

Register 26.2. FLASH_ENCRYPTION_START_REG (0x020)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(reserved)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

START

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FLASH

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

_

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

FLASH_START Set this bit to start encryption operation on data buffer. (WO)

Register 26.3. FLASH_ENCRYPTION_ADDRESS_REG (0x024)

31

0

 

 

 

Reset

 

 

0x000000000

 

FLASH_ENCRYPTION_ADDRESS_REG The physical address on the off-chip flash must be 8-word boundary aligned. (WO)

Register 26.4. FLASH_ENCRYPTION_DONE_REG (0x028)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(reserved)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DONE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FLASH

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

_

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

FLASH_DONE Set this bit when encryption operation is complete. (RO)

Espressif Systems

602

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

Соседние файлы в папке даташиты