Espressif Systems ESP32 Series Product manual

ESP32 Technical Reference Manual
Espressif Systems
August 31, 2016

About This Manual
ESP32 Technical Reference Manual targets application developers. The manual provides detailed and
complete information on how to use the ESP32 memory and peripherals.
Release Notes
Date Version Release notes
2016.08 V1.0 Initial release.
Disclaimer and Copyright Notice
Information in this document, including URL references, is subject to change without notice. THIS DOCUMENT
IS PROVIDED AS IS WITH NO WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF
MERCHANTABILITY, NON-INFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY
OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE.
All liability, including liability for infringement of any proprietary rights, relating to use of information in this
document is disclaimed. No licenses express or implied, by estoppel or otherwise, to any intellectual property
rights are granted herein. The Wi-Fi Alliance Member logo is a trademark of the Wi-Fi Alliance. The Bluetooth
logo is a registered trademark of Bluetooth SIG.
All trade names, trademarks and registered trademarks mentioned in this document are property of their
respective owners, and are hereby acknowledged.
Copyright © 2016 Espressif Inc. All rights reserved.

Contents
1 System and Memory 8
1.1 Introduction 8
1.2 Features 8
1.3 Functional Description 10
1.3.1 Address Mapping 10
1.3.2 Embedded Memory 10
1.3.2.1 Internal ROM 0 11
1.3.2.2 Internal ROM 1 11
1.3.2.3 Internal SRAM 0 12
1.3.2.4 Internal SRAM 1 12
1.3.2.5 Internal SRAM 2 13
1.3.2.6 DMA 13
1.3.2.7 RTC FAST Memory 13
1.3.2.8 RTC SLOW Memory 13
1.3.3 External Memory 13
1.3.4 Peripherals 14
1.3.4.1 Asymmetric PID Controller Peripheral 15
1.3.4.2 Non-Contiguous Peripheral Memory Ranges 15
1.3.4.3 Memory Speed 16
2 Interrupt Matrix 17
2.1 Introduction 17
2.2 Features 17
2.3 Functional Description 17
2.3.1 Peripheral Interrupt Source 17
2.3.2 CPU Interrupt 20
2.3.3 Allocate Peripheral Interrupt Sources to Peripheral Interrupt on CPU 20
2.3.4 CPU NMI Interrupt Mask 21
2.3.5 Query Current Interrupt Status of Peripheral Interrupt Source 21
3 Reset and Clock 22
3.1 System Reset 22
3.1.1 Introduction 22
3.1.2 Reset Source 22
3.2 System Clock 23
3.2.1 Introduction 23
3.2.2 Clock Source 24
3.2.3 CPU Clock 24
3.2.4 Peripheral Clock 25
3.2.4.1 APB_CLK Source 25
3.2.4.2 REF_TICK Source 26
3.2.4.3 LEDC_SCLK Source 26
3.2.4.4 APLL_SCLK Source 26
3.2.4.5 PLL_D2_CLK Source 26

3.2.4.6 Clock Source Considerations 27
3.2.5 Wi-Fi BT Clock 27
3.2.6 RTC Clock 27
4 IO_MUX and GPIO Matrix 28
4.1 Introduction 28
4.2 Peripheral Input via GPIO Matrix 29
4.2.1 Summary 29
4.2.2 Functional Description 29
4.2.3 Simple GPIO Input 30
4.3 Peripheral Output via GPIO Matrix 30
4.3.1 Summary 30
4.3.2 Functional Description 30
4.3.3 Simple GPIO Output 31
4.4 Direct I/O via IO_MUX 31
4.4.1 Summary 31
4.4.2 Functional Description 32
4.5 RTC IO_MUX for Low Power and Analog I/O 32
4.5.1 Summary 32
4.5.2 Functional Description 32
4.6 Light-sleep Mode Pin Functions 32
4.7 Pad Hold Feature 33
4.8 I/O Pad Power Supply 33
4.8.1 VDD_SDIO Power Domain 33
4.9 Peripheral Signal List 34
4.10 IO_MUX Pad List 38
4.11 RTC_MUX Pin List 39
4.12 Register Summary 40
4.13 Registers 45
5 LED_PWM 66
5.1 Introduction 66
5.2 Functional Description 66
5.2.1 Architecture 66
5.2.2 Timers 67
5.2.3 Channels 67
5.2.4 Interrupts 68
5.3 Register Summary 68
5.4 Registers 71
6 Remote Controller Peripheral 81
6.1 Introduction 81
6.2 Functional Description 81
6.2.1 RMT Architecture 81
6.2.2 RMT RAM 82
6.2.3 Clock 82
6.2.4 Transmitter 82

6.2.5 Receiver 83
6.2.6 Interrupts 83
6.3 Register Summary 84
6.4 Registers 85
7 PULSE_CNT 90
7.1 Introduction 90
7.2 Functional Description 90
7.2.1 Architecture 90
7.2.2 Counter Channel Inputs 90
7.2.3 Watchpoints 91
7.2.4 Examples 92
7.2.5 Interrupts 92
7.3 Register Summary 92
7.4 Registers 94
8 64-bit Timers 98
8.1 Introduction 98
8.2 Functional Description 98
8.2.1 16-bit Prescaler 98
8.2.2 64-bit Time-base Counter 98
8.2.3 Alarm Generation 99
8.2.4 MWDT 99
8.2.5 Interrupts 99
8.3 Register summary 99
8.4 Registers 101
9 Watchdog Timers 108
9.1 Introduction 108
9.2 Features 108
9.3 Functional Description 108
9.3.1 Clock 108
9.3.1.1 Operating Procedure 109
9.3.1.2 Write Protection 109
9.3.1.3 Flash Boot Protection 109
9.3.1.4 Registers 110
10 AES Accelerator 111
10.1 Introduction 111
10.2 Features 111
10.3 Functional Description 111
10.3.1 AES Algorithm Operations 111
10.3.2 Key, Plaintext and Ciphertext 111
10.3.3 Endianness 112
10.3.4 Encryption and Decryption Operations 114
10.3.5 Speed 114
10.4 Register summary 114

List of Tables
1 Address Mapping 10
2 Embedded Memory Address Mapping 11
3 Module with DMA 13
4 External Memory Address Mapping 14
5 Peripheral Address Mapping 14
6 PRO_CPU, APP_CPU interrupt configuration 18
7 CPU Interrupts 20
8 PRO_CPU and APP_CPU reset reason values 22
9 CPU_CLK Source 24
10 CPU_CLK Derivation 25
11 Peripheral Clock Usage 25
12 APB_CLK Derivation 26
13 REF_TICK Derivation 26
14 LEDC_SCLK Derivation 26
15 IO_MUX Light-sleep Pin Function Registers 32
16 GPIO Matrix Peripheral Signals 34
17 IO_MUX Pad Summary 38
18 RTC_MUX Pin Summary 39
26 Operation Mode 111
27 AES Text Endianness 112
28 AES-128 Key Endianness 113
29 AES-192 Key Endianness 113
30 AES-256 Key Endianness 113

List of Figures
1 System Structure 9
2 System Address Mapping 9
3 Interrupt Matrix Structure 17
4 System Reset 22
5 System Clock 23
6 IO_MUX, RTC IO_MUX and GPIO Matrix Overview 28
7 Peripheral Input via IO_MUX, GPIO Matrix 29
8 Output via GPIO Matrix 31
9 ESP32 I/O Pad Power Sources 33
10 LED_PWM Architecture 66
11 LED_PWM High-speed Channel Diagram 66
12 LED PWM Output Signal Diagram 67
13 Output Signal Diagram of Gradient Duty Cycle 68
14 RMT Architecture 81
15 Data Structure 82
16 PULSE_CNT Architecture 90
17 PULSE_CNT Upcounting Diagram 92
18 PULSE_CNT Downcounting Diagram 92

1 SYSTEM AND MEMORY
1. System and Memory
1.1 Introduction
The ESP32 is a dual-core system with two Harvard Architecture Xtensa LX6 CPUs. All embedded memory,
external memory and peripherals are located on the data bus and/or the instruction bus of these CPUs.
With some minor exceptions (see below), the address mapping of two CPUs is symmetric, meaning they use the
same addresses to access the same memory. Multiple peripherals in the system can access embedded memory
via DMA.
The two CPUs are named “PRO_CPU” and “APP_CPU” (for “protocol” and “application”), however for most
purposes the two CPUs are interchangeable.
1.2 Features
• Address Space
–Symmetric address mapping
–4 GB (32-bit) address space for both data bus and instruction bus
–1296 KB embedded memory address space
–19704 KB external memory address space
–512 KB peripheral address space
–Some embedded and external memory regions can be accessed by either data bus or instruction bus
–328 KB DMA address space
• Embedded Memory
–448 KB Internal ROM
–520 KB Internal SRAM
–8 KB RTC FAST Memory
–8 KB RTC SLOW Memory
• External Memory
Off-chip SPI memory can be mapped into the available address space as external memory. Parts of the
embedded memory can be used as transparent cache for this external memory.
–Supports up to 16 MB off-Chip SPI Flash.
–Supports up to 8 MB off-Chip SPI SRAM.
• Peripherals
–41 peripherals
• DMA
–13 modules are capable of DMA operation
Espressif Systems 8 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
1.3 Functional Description
1.3.1 Address Mapping
Each of the two Harvard Architecture Xtensa LX6 CPUs has 4 GB (32-bit) address space. Address spaces are
symmetric between the two CPUs.
Addresses below 0x4000_0000 are serviced using the data bus. Addresses in the range 0x4000_0000 ~
0x4FFF_FFFF are serviced using the instruction bus. Finally, addresses over and including 0x5000_0000 are
shared by the data and instruction bus.
The data bus and instruction bus are both little-endian: for example, byte addresses 0x0, 0x1, 0x2, 0x3 access
the least significant, second least significant, second most significant, and most significant bytes of the 32-bit
word stored at address 0x0, respectively. The CPU can access data bus addresses via aligned or non-aligned
byte, half-word and word read and write operations. The CPU can read and write data through the instruction
bus, but only in a word aligned manner; non-word-aligned access will cause a CPU exception.
Each CPU can directly access embedded memory through both the data bus and the instruction bus, external
memory which is mapped into the address space (via transparent caching & MMU) and peripherals. Table 1
illustrates address ranges that can be accessed by each CPU’s data bus and instruction bus.
Some embedded memories and some external memories can be accessed via the data bus or the instruction
bus. In these cases, the same memory is available to either of the CPUs at two address ranges.
Table 1: Address Mapping
Boundary Address
Bus Type Low Address High Address Size Target
0x0000_0000 0x3F3F_FFFF Reserved
Data 0x3F40_0000 0x3F7F_FFFF 4 MB External Memory
Data 0x3F80_0000 0x3FBF_FFFF 4 MB External Memory
0x3FC0_0000 0x3FEF_FFFF 3 MB Reserved
Data 0x3FF0_0000 0x3FF7_FFFF 512 KB Peripheral
Data 0x3FF8_0000 0x3FFF_FFFF 512 KB Embedded Memory
Instruction 0x4000_0000 0x400C_1FFF 776 KB Embedded Memory
Instruction 0x400C_2000 0x40BF_FFFF 11512 KB External Memory
0x40C0_0000 0x4FFF_FFFF 244 MB Reserved
Data Instruction 0x5000_0000 0x5000_1FFF 8 KB Embedded Memory
0x5000_2000 0xFFFF_FFFF Reserved
1.3.2 Embedded Memory
The Embedded Memory consists of four segments: internal ROM (448 KB), internal SRAM (520 KB), RTC FAST
memory (8 KB) and RTC SLOW memory (8 KB).
The 448 KB internal ROM is divided into two parts: Internal ROM 0 (384 KB) and Internal ROM 1 (64 KB).
The 520 KB internal SRAM is divided into three parts: Internal SRAM 0 (192 KB), Internal SRAM 1 (128 KB), and
Internal SRAM 2 (200 KB).
RTC FAST Memory and RTC SLOW Memory are both implemented as SRAM.
Table 2lists all embedded memories and their address ranges on the data and instruction buses.
Espressif Systems 10 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
Table 2: Embedded Memory Address Mapping
Boundary Address
Bus Type Low Address High Address Size Target Comment
Data 0x3FF8_0000 0x3FF8_1FFF 8 KB RTC FAST Memory PRO_CPU Only
0x3FF8_2000 0x3FF8_FFFF 56 KB Reserved -
Data 0x3FF9_0000 0x3FF9_FFFF 64 KB Internal ROM 1 -
0x3FFA_0000 0x3FFA_DFFF 56 KB Reserved -
Data 0x3FFA_E000 0x3FFD_FFFF 200 KB Internal SRAM 2 DMA
Data 0x3FFE_0000 0x3FFF_FFFF 128 KB Internal SRAM 1 DMA
Boundary Address
Bus Type Low Address High Address Size Target Comment
Instruction 0x4000_0000 0x4000_7FFF 32 KB Internal ROM 0 Remap
Instruction 0x4000_8000 0x4005_FFFF 352 KB Internal ROM 0 -
0x4006_0000 0x4006_FFFF 64 KB Reserved -
Instruction 0x4007_0000 0x4007_FFFF 64 KB Internal SRAM 0 Cache
Instruction 0x4008_0000 0x4009_FFFF 128 KB Internal SRAM 0 -
Instruction 0x400A_0000 0x400A_FFFF 64 KB Internal SRAM 1 -
Instruction 0x400B_0000 0x400B_7FFF 32 KB Internal SRAM 1 Remap
Instruction 0x400B_8000 0x400B_FFFF 32 KB Internal SRAM 1 -
Instruction 0x400C_0000 0x400C_1FFF 8 KB RTC FAST Memory PRO_CPU Only
Boundary Address
Bus Type Low Address High Address Size Target Comment
Data Instruc-
tion 0x5000_0000 0x5000_1FFF 8 KB RTC SLOW Memory -
1.3.2.1 Internal ROM 0
The capacity of Internal ROM 0 is 384 KB, It is accessible by both CPUs through the address range
0x4000_0000 ~0x4005_FFFF, which is on the instruction bus.
The address range of the first 32 KB of the ROM 0 (0x4000_0000 ~0x4000_7FFF) can be re-mapped to access
a part of Internal SRAM 1 that normally resides in the memory range 0x400B_0000 ~0x400B_7FFF instead.
While remapping, such 32 KB SRAM can not be accessed by address range 0x400B_0000 ~0x400B_7FFF any
more, but it can still be accessible through the data bus (0x3FFE_8000 ~0x3FFE_FFFF). This can be done on a
per-CPU basis: setting bit 0 of register DPORT_PRO_BOOT_REMAP_CTRL_REG or
DPORT_APP_BOOT_REMAP_CTRL_REG will remap SRAM for the PRO_CPU and APP_CPU,
respectively.
1.3.2.2 Internal ROM 1
The capacity of Internal ROM 1 is 64 KB. It can be read by either CPU at address range 0x3FF9_0000 ~
0x3FF9_FFFF of the data bus.
Espressif Systems 11 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
1.3.2.3 Internal SRAM 0
The capacity of Internal SRAM 0 is 192 KB. Hardware can be configured to use the first 64KB to cache external
memory access. When not used as cache, the first 64KB can be read and written by either CPU at addresses
0x4007_0000 ~0x4007_7FFF of the instruction bus. The remaining 128 KB can always be read and written by
either CPU at addresses 0x4007_8000 ~0x4007_FFFF of instruction bus.
1.3.2.4 Internal SRAM 1
The capacity of Internal SRAM 1 is 128 KB. Either CPU can read and write this memory at addresses
0x3FFE_0000 ~0x3FFF_FFFF of the data bus, and also at addresses 0x400A_0000 ~0x400B_FFFF of the
instruction bus.
The address range accessed via the instruction bus is in reverse order (word-wise) compared to access via the
data bus. That is to say, address
0x3FFE_0000 and 0x400B_FFFC access the same word
0x3FFE_0004 and 0x400B_FFF8 access the same word
0x3FFE_0008 and 0x400B_FFF4 access the same word
……
0x3FFF_FFF4 and 0x400A_0008 access the same word
0x3FFF_FFF8 and 0x400A_0004 access the same word
0x3FFF_FFFC and 0x400A_0000 access the same word
The data bus and instruction bus of the CPU are still both little endian, so the byte order of individual words is not
reversed between address spaces. For example, address
0x3FFE_0000 accesses the least significant byte in the word accessed by 0x400B_FFFC.
0x3FFE_0001 accesses the second least significant byte in the word accessed by 0x400B_FFFC.
0x3FFE_0002 accesses the second most significant byte in the word accessed by 0x400B_FFFC.
0x3FFE_0003 accesses the most significant byte in the word accessed by 0x400B_FFFC.
0x3FFE_0004 accesses the least significant byte in the word accessed by 0x400B_FFF8.
0x3FFE_0005 accesses the second least significant byte in the word accessed by 0x400B_FFF8.
0x3FFE_0006 accesses the second most significant byte in the word accessed by 0x400B_FFF8.
0x3FFE_0007 accesses the most significant byte in the word accessed by 0x400B_FFF8.
……
0x3FFF_FFF8 accesses the least significant byte in the word accessed by 0x400A_0004.
0x3FFF_FFF9 accesses the second least significant byte in the word accessed by 0x400A_0004.
0x3FFF_FFFA accesses the second most significant byte in the word accessed by 0x400A_0004.
0x3FFF_FFFB accesses the most significant byte in the word accessed by 0x400A_0004.
0x3FFF_FFFC accesses the least significant byte in the word accessed by 0x400A_0000.
0x3FFF_FFFD accesses the second most significant byte in the word accessed by 0x400A_0000.
0x3FFF_FFFE accesses the second most significant byte in the word accessed by 0x400A_0000.
0x3FFF_FFFF accesses the most significant byte in the word accessed by 0x400A_0000.
Part of this memory can be remapped to the ROM 0 address space. See Internal Rom 0 for more
information.
Espressif Systems 12 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
1.3.2.5 Internal SRAM 2
The capacity of Internal SRAM 2 is 200 KB. It can be read and written by either CPU at addresses 0x3FFA_E000
~0x3FFD_FFFF on the data bus.
1.3.2.6 DMA
DMA uses the same addressing as the CPU data bus to read and write Internal SRAM 1 and Internal SRAM 2.
This means DMA uses address range 0x3FFE_0000 ~0x3FFF_FFFF to read and write Internal SRAM 1 and
address range 0x3FFA_E000 ~0x3FFD_FFFF to read and write Internal SRAM 2.
In the ESP32, 13 peripherals are equipped with DMA. Table 3lists these peripherals.
Table 3: Module with DMA
UART0 UART1 UART2
SPI1 SPI2 SPI3
I2S0 I2S1
SDIO Slave SDMMC
EMAC
BT WIFI
1.3.2.7 RTC FAST Memory
RTC FAST Memory is 8 KB of SRAM. It can be read and written by PRO_CPU only at address range
0x3FF8_0000 ~0x3FF8_1FFF on the data bus or address range 0x400C_0000 ~0x400C_1FFF on the
instruction bus. Unlike most other memory regions, RTC FAST memory cannot be accessed by the
APP_CPU.
The two address ranges of PRO_CPU access RTC FAST Memory in the same order, so for example, address
0x3FF8_0000 and 0x400C_0000 access the same word. On the APP_CPU, these address ranges do not
provide access to RTC FAST Memory or any other memory location.
1.3.2.8 RTC SLOW Memory
RTC SLOW Memory is 8 KB of SRAM which can be read from and written by either CPU at address range
0x5000_0000 ~0x5000_1FFF. This address range is shared by both the data bus and the instruction bus.
1.3.3 External Memory
The ESP32 can access external SPI flash and SPI SRAM as external memory. Table 4provides a list of external
memories that can be accessed by either CPU at a range of addresses on the data and instruction buses. When
a CPU accesses external memory through the Cache and MMU, the cache will map the CPU’s address to an
external physical memory address (in the external memory’s address space), according to the MMU settings. Due
to this address mapping, the ESP32 can address up to 16 MB External Flash and 8 MB External SRAM.
Espressif Systems 13 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
Table 4: External Memory Address Mapping
Boundary Address
Bus Type Low Address High Address Size Target Comment
Data 0x3F40_0000 0x3F7F_FFFF 4 MB External Flash Read
Data 0x3F80_0000 0x3FBF_FFFF 4 MB External SRAM Read and Write
Boundary Address
Bus Type Low Address High Address Size Target Comment
Instruction 0x400C_2000 0x40BF_FFFF 11512 KB External Flash Read
1.3.4 Peripherals
The ESP32 has 41 peripherals. Table 5specifically describes the peripherals their respective address ranges.
Almost all peripheral modules can be accessed by either CPU at the same address, the only exception being the
PID Controller.
Table 5: Peripheral Address Mapping
Boundary Address
Bus Type Low Address High Address Size Target Comment
Data 0x3FF0_0000 0x3FF0_0FFF 4 KB DPort Register
Data 0x3FF0_1000 0x3FF0_1FFF 4 KB AES Accelerator
Data 0x3FF0_2000 0x3FF0_2FFF 4 KB RSA Accelerator
Data 0x3FF0_3000 0x3FF0_3FFF 4 KB SHA Accelerator
Data 0x3FF0_4000 0x3FF0_4FFF 4 KB Secure Boot
0x3FF0_5000 0x3FF0_FFFF 44 KB Reserved
Data 0x3FF1_0000 0x3FF1_3FFF 16 KB Cache MMU Table
0x3FF1_4000 0x3FF1_EFFF 44 KB Reserved
Data 0x3FF1_F000 0x3FF1_FFFF 4 KB PID Controller Per-CPU peripheral
0x3FF2_0000 0x3FF3_FFFF 128 KB Reserved
Data 0x3FF4_0000 0x3FF4_0FFF 4 KB UART0
0x3FF4_1000 0x3FF4_1FFF 4 KB Reserved
Data 0x3FF4_2000 0x3FF4_2FFF 4 KB SPI1
Data 0x3FF4_3000 0x3FF4_3FFF 4 KB SPI0
Data 0x3FF4_4000 0x3FF4_4FFF 4 KB GPIO
0x3FF4_5000 0x3FF4_7FFF 12 KB Reserved
Data 0x3FF4_8000 0x3FF4_8FFF 4 KB RTC
Data 0x3FF4_9000 0x3FF4_9FFF 4 KB IO MUX
0x3FF4_A000 0x3FF4_AFFF 4 KB Reserved
Data 0x3FF4_B000 0x3FF4_BFFF 4 KB SDIO Slave One of three parts
Data 0x3FF4_C000 0x3FF4_CFFF 4 KB UDMA1
0x3FF4_D000 0x3FF4_EFFF 8 KB Reserved
Data 0x3FF4_F000 0x3FF4_FFFF 4 KB I2S0
Data 0x3FF5_0000 0x3FF5_0FFF 4 KB UART1
0x3FF5_1000 0x3FF5_2FFF 8 KB Reserved
Data 0x3FF5_3000 0x3FF5_3FFF 4 KB I2C0
Data 0x3FF5_4000 0x3FF5_4FFF 4 KB UDMA0
Espressif Systems 14 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
Boundary Address
Bus Type Low Address High Address Size Target Comment
Data 0x3FF5_5000 0x3FF5_5FFF 4 KB SDIO Slave One of three parts
Data 0x3FF5_6000 0x3FF5_6FFF 4 KB RMT
Data 0x3FF5_7000 0x3FF5_7FFF 4 KB PCNT
Data 0x3FF5_8000 0x3FF5_8FFF 4 KB SDIO Slave One of three parts
Data 0x3FF5_9000 0x3FF5_9FFF 4 KB LED PWM
Data 0x3FF5_A000 0x3FF5_AFFF 4 KB Efuse Controller
Data 0x3FF5_B000 0x3FF5_BFFF 4 KB Flash Encryption
0x3FF5_C000 0x3FF5_DFFF 8 KB Reserved
Data 0x3FF5_E000 0x3FF5_EFFF 4 KB PWM0
Data 0x3FF5_F000 0x3FF5_FFFF 4 KB TIMG0
Data 0x3FF6_0000 0x3FF6_0FFF 4 KB TIMG1
0x3FF6_1000 0x3FF6_3FFF 12 KB Reserved
Data 0x3FF6_4000 0x3FF6_4FFF 4 KB SPI2
Data 0x3FF6_5000 0x3FF6_5FFF 4 KB SPI3
Data 0x3FF6_6000 0x3FF6_6FFF 4 KB SYSCON
Data 0x3FF6_7000 0x3FF6_7FFF 4 KB I2C1
Data 0x3FF6_8000 0x3FF6_8FFF 4 KB SDMMC
Data 0x3FF6_9000 0x3FF6_AFFF 8 KB EMAC
0x3FF6_B000 0x3FF6_BFFF 4 KB Reserved
Data 0x3FF6_C000 0x3FF6_CFFF 4 KB PWM1
Data 0x3FF6_D000 0x3FF6_DFFF 4 KB I2S1
Data 0x3FF6_E000 0x3FF6_EFFF 4 KB UART2
Data 0x3FF6_F000 0x3FF6_FFFF 4 KB PWM2
Data 0x3FF7_0000 0x3FF7_0FFF 4 KB PWM3
0x3FF7_1000 0x3FF7_4FFF 16 KB Reserved
Data 0x3FF7_5000 0x3FF7_5FFF 4 KB RNG
0x3FF7_6000 0x3FF7_FFFF 40 KB Reserved
1.3.4.1 Asymmetric PID Controller Peripheral
There are two PID Controllers in the system. They serve the PRO_CPU and the APP_CPU, respectively. The
PRO_CPU and the APP_CPU can only access their own PID Controller and not their counterpart’s PID
Controller. Each CPU uses the same memory range 0x3FF1_F000 ~3FF1_FFFF to access its own PID
Controller.
1.3.4.2 Non-Contiguous Peripheral Memory Ranges
The SDIO Slave peripheral consists of three parts and the two CPUs use non-contiguous addresses to access
these. The three parts are accessed at the address ranges 0x3FF4_B000 ~3FF4_BFFF, 0x3FF5_5000 ~
3FF5_5FFF and 0x3FF5_8000 ~3FF5_8FFF of each CPU’s data bus. Similar to other peripherals, access to this
peripheral is identical for both CPUs.
Espressif Systems 15 ESP32 Technical Reference Manual V1.0

1.3 Functional Description 1 SYSTEM AND MEMORY
1.3.4.3 Memory Speed
The ROM as well as the SRAM are both clocked from CPU_CLK and can be accessed by the CPU in a single
cycle. The RTC FAST memory is clocked from the APB_CLOCK and the RTC SLOW memory from the
FAST_CLOCK, so access to these memories may be slower. DMA uses the APB_CLK to access memory.
Internally, the SRAM is organized in 32K-sized banks. Each CPU and DMA channel can access the SRAM at full
speed and simultaneously, provided they access address different memory banks.
Espressif Systems 16 ESP32 Technical Reference Manual V1.0

2 INTERRUPT MATRIX
2. Interrupt Matrix
2.1 Introduction
The Interrupt Matrix embedded in the ESP32 independently allocates peripheral interrupt sources to the two
CPUs’ peripheral interrupts. This configuration is highly flexible in order to meet many different needs.
2.2 Features
• Accepts 71 peripheral interrupt sources as input.
• Generates 26 peripheral interrupt sources per CPU as output (52 total).
• CPU NMI Interrupt Mask.
• Queries current interrupt status of peripheral interrupt sources.
The structure of the Interrupt Matrix is shown in Figure 3.
Figure 3: Interrupt Matrix Structure
2.3 Functional Description
2.3.1 Peripheral Interrupt Source
ESP32 has 71 peripheral interrupt sources in total. All peripheral interrupt sources are listed in table 6. 67 of 71
ESP32 peripheral interrupt sources can be allocated to either CPU.
The four remaining peripheral interrupt sources are CPU-specific, two per CPU. GPIO_INTERRUPT_PRO and
GPIO_INTERRUPT_PRO_NMI can only be allocated to PRO_CPU. GPIO_INTERRUPT_APP and
GPIO_INTERRUPT_APP_NMI can only be allocated to APP_CPU. As a result, PRO_CPU and APP_CPU each
have 69 peripheral interrupt sources.
Espressif Systems 17 ESP32 Technical Reference Manual V1.0

2.3 Functional Description 2 INTERRUPT MATRIX
Table 6: PRO_CPU, APP_CPU interrupt configuration
PRO_CPU APP_CPU
Peripheral Interrupt Source
Status Register Status Register
Peripheral Interrupt
Configuration Register Bit Name No. Name No. Name Bit
Peripheral Interrupt
Configuration Register
PRO_MAC_INTR_MAP_REG 0
PRO_INTR_STATUS_REG_0
0 MAC_INTR 0
APP_INTR_STATUS_REG_0
0 APP_MAC_INTR_MAP_REG
PRO_MAC_NMI_MAP_REG 1 1 MAC_NMI 1 1 APP_MAC_NMI_MAP_REG
PRO_BB_INT_MAP_REG 2 2 BB_INT 2 2 APP_BB_INT_MAP_REG
PRO_BT_MAC_INT_MAP_REG 3 3 BT_MAC_INT 3 3 APP_BT_MAC_INT_MAP_REG
PRO_BT_BB_INT_MAP_REG 4 4 BT_BB_INT 4 4 APP_BT_BB_INT_MAP_REG
PRO_BT_BB_NMI_MAP_REG 5 5 BT_BB_NMI 5 5 APP_BT_BB_NMI_MAP_REG
PRO_RWBT_IRQ_MAP_REG 6 6 RWBT_IRQ 6 6 APP_RWBT_IRQ_MAP_REG
PRO_BT_BB_NMI_MAP_REG 5 5 BT_BB_NMI 5 5 APP_BT_BB_NMI_MAP_REG
PRO_RWBT_IRQ_MAP_REG 6 6 RWBT_IRQ 6 6 APP_RWBT_IRQ_MAP_REG
PRO_RWBLE_IRQ_MAP_REG 7 7 RWBLE_IRQ 7 7 APP_RWBLE_IRQ_MAP_REG
PRO_RWBT_NMI_MAP_REG 8 8 RWBT_NMI 8 8 APP_RWBT_NMI_MAP_REG
PRO_RWBLE_NMI_MAP_REG 9 9 RWBLE_NMI 9 9 APP_RWBLE_NMI_MAP_REG
PRO_SLC0_INTR_MAP_REG 10 10 SLC0_INTR 10 10 APP_SLC0_INTR_MAP_REG
PRO_SLC1_INTR_MAP_REG 11 11 SLC1_INTR 11 11 APP_SLC1_INTR_MAP_REG
PRO_UHCI0_INTR_MAP_REG 12 12 UHCI0_INTR 12 12 APP_UHCI0_INTR_MAP_REG
PRO_UHCI1_INTR_MAP_REG 13 13 UHCI1_INTR 13 13 APP_UHCI1_INTR_MAP_REG
PRO_TG_T0_LEVEL_INT_MAP_REG 14 14 TG_T0_LEVEL_INT 14 14 APP_TG_T0_LEVEL_INT_MAP_REG
PRO_TG_T1_LEVEL_INT_MAP_REG 15 15 TG_T1_LEVEL_INT 15 15 APP_TG_T1_LEVEL_INT_MAP_REG
PRO_TG_WDT_LEVEL_INT_MAP_REG 16 16 TG_WDT_LEVEL_INT 16 16 APP_TG_WDT_LEVEL_INT_MAP_REG
PRO_TG_LACT_LEVEL_INT_MAP_REG 17 17 TG_LACT_LEVEL_INT 17 17 APP_TG_LACT_LEVEL_INT_MAP_REG
PRO_TG1_T0_LEVEL_INT_MAP_REG 18 18 TG1_T0_LEVEL_INT 18 18 APP_TG1_T0_LEVEL_INT_MAP_REG
PRO_TG1_T1_LEVEL_INT_MAP_REG 19 19 TG1_T1_LEVEL_INT 19 19 APP_TG1_T1_LEVEL_INT_MAP_REG
PRO_TG1_WDT_LEVEL_INT_MAP_REG 20 20 TG1_WDT_LEVEL_INT 20 20 APP_TG1_WDT_LEVEL_INT_MAP_REG
PRO_TG1_LACT_LEVEL_INT_MAP_REG 21 21 TG1_LACT_LEVEL_INT 21 21 APP_TG1_LACT_LEVEL_INT_MAP_REG
PRO_GPIO_INTERRUPT_PRO_MAP_REG 22 22 GPIO_INTERRUPT_PRO GPIO_INTERRUPT_APP 22 22 APP_GPIO_INTERRUPT_APP_MAP_REG
PRO_GPIO_INTERRUPT_PRO_NMI_MAP_REG 23 23 GPIO_INTERRUPT_PRO_NMI GPIO_INTERRUPT_APP_NMI 23 23 APP_GPIO_INTERRUPT_APP_NMI_MAP_REG
PRO_CPU_INTR_FROM_CPU_0_MAP_REG 24 24 CPU_INTR_FROM_CPU_0 24 24 APP_CPU_INTR_FROM_CPU_0_MAP_REG
PRO_CPU_INTR_FROM_CPU_1_MAP_REG 25 25 CPU_INTR_FROM_CPU_1 25 25 APP_CPU_INTR_FROM_CPU_1_MAP_REG
PRO_CPU_INTR_FROM_CPU_2_MAP_REG 26 26 CPU_INTR_FROM_CPU_2 26 26 APP_CPU_INTR_FROM_CPU_2_MAP_REG
PRO_CPU_INTR_FROM_CPU_3_MAP_REG 27 27 CPU_INTR_FROM_CPU_3 27 27 APP_CPU_INTR_FROM_CPU_3_MAP_REG
PRO_SPI_INTR_0_MAP_REG 28 28 SPI_INTR_0 28 28 APP_SPI_INTR_0_MAP_REG
PRO_SPI_INTR_1_MAP_REG 29 29 SPI_INTR_1 29 29 APP_SPI_INTR_1_MAP_REG
PRO_SPI_INTR_2_MAP_REG 30 30 SPI_INTR_2 30 30 APP_SPI_INTR_2_MAP_REG
PRO_SPI_INTR_3_MAP_REG 31 31 SPI_INTR_3 31 31 APP_SPI_INTR_3_MAP_REG
PRO_I2S0_INT_MAP_REG 0
PRO_INTR_STATUS_REG_1
32 I2S0_INT 32
APP_INTR_STATUS_REG_1
0 APP_I2S0_INT_MAP_REG
PRO_I2S1_INT_MAP_REG 1 33 I2S1_INT 33 1 APP_I2S1_INT_MAP_REG
PRO_UART_INTR_MAP_REG 2 34 UART_INTR 34 2 APP_UART_INTR_MAP_REG
PRO_UART1_INTR_MAP_REG 3 35 UART1_INTR 35 3 APP_UART1_INTR_MAP_REG
PRO_UART2_INTR_MAP_REG 4 36 UART2_INTR 36 4 APP_UART2_INTR_MAP_REG
PRO_SDIO_HOST_INTERRUPT_MAP_REG 5 37 SDIO_HOST_INTERRUPT 37 5 APP_SDIO_HOST_INTERRUPT_MAP_REG
PRO_EMAC_INT_MAP_REG 6 38 EMAC_INT 38 6 APP_EMAC_INT_MAP_REG
PRO_PWM0_INTR_MAP_REG 7 39 PWM0_INTR 39 7 APP_PWM0_INTR_MAP_REG
PRO_PWM1_INTR_MAP_REG 8 40 PWM1_INTR 40 8 APP_PWM1_INTR_MAP_REG
PRO_PWM2_INTR_MAP_REG 9 41 PWM2_INTR 41 9 APP_PWM2_INTR_MAP_REG
PRO_PWM3_INTR_MAP_REG 10 42 PWM3_INTR 42 10 APP_PWM3_INTR_MAP_REG
PRO_LEDC_INT_MAP_REG 11 43 LEDC_INT 43 11 APP_LEDC_INT_MAP_REG
PRO_EFUSE_INT_MAP_REG 12 44 EFUSE_INT 44 12 APP_EFUSE_INT_MAP_REG
PRO_CAN_INT_MAP_REG 13 45 CAN_INT 45 13 APP_CAN_INT_MAP_REG
PRO_RTC_CORE_INTR_MAP_REG 14 46 RTC_CORE_INTR 46 14 APP_RTC_CORE_INTR_MAP_REG
PRO_RMT_INTR_MAP_REG 15 47 RMT_INTR 47 15 APP_RMT_INTR_MAP_REG
PRO_PCNT_INTR_MAP_REG 16 48 PCNT_INTR 48 16 APP_PCNT_INTR_MAP_REG
PRO_I2C_EXT0_INTR_MAP_REG 17 49 I2C_EXT0_INTR 49 17 APP_I2C_EXT0_INTR_MAP_REG
PRO_I2C_EXT1_INTR_MAP_REG 18 50 I2C_EXT1_INTR 50 18 APP_I2C_EXT1_INTR_MAP_REG
PRO_RSA_INTR_MAP_REG 19 51 RSA_INTR 51 19 APP_RSA_INTR_MAP_REG
PRO_SPI1_DMA_INT_MAP_REG 20 52 SPI1_DMA_INT 52 20 APP_SPI1_DMA_INT_MAP_REG
Espressif Systems 18 ESP32 Technical Reference Manual V1.0

2.3 Functional Description 2 INTERRUPT MATRIX
PRO_CPU APP_CPU
Peripheral Interrupt Source
Status Register Status Register
Peripheral Interrupt
Configuration Register Bit Name No. Name No. Name Bit
Peripheral Interrupt
Configuration Register
PRO_SPI2_DMA_INT_MAP_REG 21
PRO_INTR_STATUS_REG_1
53 SPI2_DMA_INT 53
APP_INTR_STATUS_REG_1
21 APP_SPI2_DMA_INT_MAP_REG
PRO_SPI3_DMA_INT_MAP_REG 22 54 SPI3_DMA_INT 54 22 APP_SPI3_DMA_INT_MAP_REG
PRO_WDG_INT_MAP_REG 23 55 WDG_INT 55 23 APP_WDG_INT_MAP_REG
PRO_TIMER_INT1_MAP_REG 24 56 TIMER_INT1 56 24 APP_TIMER_INT1_MAP_REG
PRO_TIMER_INT2_MAP_REG 25 57 TIMER_INT2 57 25 APP_TIMER_INT2_MAP_REG
PRO_TG_T0_EDGE_INT_MAP_REG 26 58 TG_T0_EDGE_INT 58 26 APP_TG_T0_EDGE_INT_MAP_REG
PRO_TG_T1_EDGE_INT_MAP_REG 27 59 TG_T1_EDGE_INT 59 27 APP_TG_T1_EDGE_INT_MAP_REG
PRO_TG_WDT_EDGE_INT_MAP_REG 28 60 TG_WDT_EDGE_INT 60 28 APP_TG_WDT_EDGE_INT_MAP_REG
PRO_TG_LACT_EDGE_INT_MAP_REG 29 61 TG_LACT_EDGE_INT 61 29 APP_TG_LACT_EDGE_INT_MAP_REG
PRO_TG1_T0_EDGE_INT_MAP_REG 30 62 TG1_T0_EDGE_INT 62 30 APP_TG1_T0_EDGE_INT_MAP_REG
PRO_TG1_T1_EDGE_INT_MAP_REG 31 63 TG1_T1_EDGE_INT 63 31 APP_TG1_T1_EDGE_INT_MAP_REG
PRO_TG1_WDT_EDGE_INT_MAP_REG 0
PRO_INTR_STATUS_REG_2
64 TG1_WDT_EDGE_INT 64
APP_INTR_STATUS_REG_2
0 APP_TG1_WDT_EDGE_INT_MAP_REG
PRO_TG1_LACT_EDGE_INT_MAP_REG 1 65 TG1_LACT_EDGE_INT 65 1 APP_TG1_LACT_EDGE_INT_MAP_REG
PRO_MMU_IA_INT_MAP_REG 2 66 MMU_IA_INT 66 2 APP_MMU_IA_INT_MAP_REG
PRO_MPU_IA_INT_MAP_REG 3 67 MPU_IA_INT 67 3 APP_MPU_IA_INT_MAP_REG
PRO_CACHE_IA_INT_MAP_REG 4 68 CACHE_IA_INT 68 4 APP_CACHE_IA_INT_MAP_REG
Espressif Systems 19 ESP32 Technical Reference Manual V1.0
Other manuals for ESP32 Series
6
Table of contents
Other Espressif Systems Computer Hardware manuals

Espressif Systems
Espressif Systems ESP32 Series Instruction Manual

Espressif Systems
Espressif Systems ESP32-S2-MINI-1 User manual

Espressif Systems
Espressif Systems ESP32-C3-MINI-1U User manual

Espressif Systems
Espressif Systems ESP32-LyraTD-MSC User manual

Espressif Systems
Espressif Systems ESP8684 Series Instruction Manual

Espressif Systems
Espressif Systems ESP32-S2-WROVER User manual

Espressif Systems
Espressif Systems ESP32-S3 Instruction Manual

Espressif Systems
Espressif Systems ESP32-S2-WROOM User manual