Esp32 Technical Reference Manual en
Esp32 Technical Reference Manual en
www.espressif.com
About This Manual
The ESP32 Technical Reference Manual is addressed to application developers. The manual provides detailed
and complete information on how to use the ESP32 memory and peripherals.
For pin definition, electrical characteristics, and package information, please see ESP32 Datasheet.
Document Updates
Please always refer to the latest version at https://www.espressif.com/en/support/download/documents.
Revision History
For any changes to this document over time, please refer to the last page.
Certification
Download certificates for Espressif products from www.espressif.com/en/certificates.
Contents
Contents
3.2.4.2 REF_TICK 43
3.2.4.3 LEDC_SCLK Source 44
3.2.4.4 APLL_SCLK Source 44
3.2.4.5 PLL_F160M_CLK Source 44
3.2.4.6 Clock Source Considerations 44
3.2.5 Wi-Fi BT Clock 44
3.2.6 RTC Clock 45
3.2.7 Audio PLL 45
3.3 Register Summary 45
3.4 Registers 46
5 DPort Registers 94
5.1 Introduction 94
5.2 Features 94
Glossary 732
Abbreviations for Peripherals 732
Abbreviations for Registers 732
List of Tables
1-1 Address Mapping 26
1-2 Embedded Memory Address Mapping 28
1-3 Module with DMA 30
1-4 External Memory Address Mapping 30
1-5 Cache memory mode 31
1-6 Peripheral Address Mapping 32
2-1 PRO_CPU, APP_CPU Interrupt Configuration 36
2-2 CPU Interrupts 38
3-1 PRO_CPU and APP_CPU Reset Reason Values 40
3-2 CPU_CLK Source 42
3-3 CPU_CLK Derivation 42
3-4 Peripheral Clock Usage 43
3-5 APB_CLK 43
3-6 REF_TICK 44
3-7 LEDC_SCLK Derivation 44
4-1 IO_MUX Light-sleep Pin Function Registers 54
4-2 GPIO Matrix Peripheral Signals 56
4-3 IO_MUX Pad Summary 61
4-4 RTC_MUX Pin Summary 62
4-8 Mapping of Bits to Pins 83
7-1 Mapping Between SPI Bus Signals and Pin Function Signals 127
7-2 Command Definitions Supported by GP-SPI Slave in Half-duplex Mode 129
7-3 Clock Polarity and Phase, and Corresponding SPI Register Values for SPI Master 131
7-4 Clock Polarity and Phase, and Corresponding SPI Register Values for SPI Slave 131
9-1 SD/MMC Signal Description 195
9-2 DES0 201
9-3 DES1 202
9-4 DES2 202
9-5 DES3 202
9-6 SD/MMC Timing Requirements 204
10-1 Destination Address Filtering 233
10-2 Source Address Filtering 233
10-3 Timing Parameters - Receiving Data 238
10-4 Timing Parameters – Transmitting Data 239
10-5 Transmit Descriptor 0 (TDES0) 240
10-6 Transmit Descriptor 1 (TDES1) 244
10-7 Transmit Descriptor 2 (TDES2) 244
10-8 Transmit Descriptor 3 (TDES3) 244
10-9 Receive Descriptor 0 (RDES0) 245
10-10 Receive Descriptor 1 (RDES1) 247
10-11 Receive Descriptor 2 (RDES2) 248
10-12 Receive Descriptor 3 (RDES3) 248
10-13 Receive Descriptor 4 (RDES4) 248
27-4 Page Mode of MMU for the Remaining 128 KB of Internal SRAM0 and SRAM2 614
27-5 Page Boundaries for SRAM0 MMU 615
27-6 Page Boundaries for SRAM2 MMU 615
27-7 DPORT_DMMU_TABLEn_REG & DPORT_IMMU_TABLEn_REG 616
27-8 MPU for DMA 617
27-9 Virtual Address for External Memory 619
27-10 MMU Entry Numbers for PRO_CPU 619
27-11 MMU Entry Numbers for APP_CPU 619
27-12 MMU Entry Numbers for PRO_CPU (Special Mode) 620
27-13 MMU Entry Numbers for APP_CPU (Special Mode) 620
27-14 Virtual Address Mode for External SRAM 621
27-15 Virtual Address for External SRAM ( Normal Mode ) 622
27-16 Virtual Address for External SRAM ( Low-High Mode ) 622
27-17 Virtual Address for External SRAM (Even-Odd Mode) 622
27-18 MMU Entry Numbers for External RAM 623
27-19 MPU for Peripheral 624
27-20 DPORT_AHBLITE_MPU_TABLE_X_REG 625
28-1 Interrupt Vector Entry Address 627
28-2 Configuration of PIDCTRL_LEVEL_REG 627
28-3 Configuration of PIDCTRL_FROM_n_REG 628
29-1 ESP32 Capacitive Sensing Touch Pads 638
29-2 Inputs of SAR ADC 643
29-3 ESP32 SAR ADC Controllers 643
29-4 Fields of the Pattern Table Register 645
29-5 Fields of Type I DMA Data Format 646
29-6 Fields of Type II DMA Data Format 646
30-1 ALU Operations Among Registers 667
30-2 ALU Operations with Immediate Value 668
30-3 ALU Operations with Stage Count Register 669
30-4 Input Signals Measured Using the ADC Instruction 673
31-1 RTC Power Domains 696
31-2 Wake-up Source 700
List of Figures
1-1 System Structure 25
1-2 System Address Mapping 25
1-3 Cache Block Diagram 31
2-1 Interrupt Matrix Structure 35
3-1 System Reset 40
3-2 System Clock 41
4-1 IO_MUX, RTC IO_MUX and GPIO Matrix Overview 49
4-2 Peripheral Input via IO_MUX, GPIO Matrix 50
4-3 Output via GPIO Matrix 52
4-4 ESP32 I/O Pad Power Sources (QFN 6*6, Top View) 55
4-5 ESP32 I/O Pad Power Sources (QFN 5*5, Top View) 56
6-1 DMA Engine Architecture 122
6-2 Linked List Structure 123
6-3 Data Transfer in UDMA Mode 124
6-4 SPI DMA 125
7-1 SPI Architecture 127
7-2 SPI Master and Slave Full-duplex/Half-duplex Communication 128
7-3 SPI Data Buffer 130
7-4 GP-SPI ������ 133
7-5 Parallel QSPI 133
7-6 Communication Format of Parallel QSPI 134
8-1 SDIO Slave Block Diagram 161
8-2 SDIO Bus Packet Transmission 162
8-3 CMD53 Content 162
8-4 SDIO Slave DMA Linked List Structure 163
8-5 SDIO Slave Linked List 163
8-6 Packet Sending Procedure (Initiated by Slave) 164
8-7 Packet Receiving Procedure (Initiated by Host) 165
8-8 Loading Receiving Buffer 166
8-9 Sampling Timing Diagram 166
8-10 Output Timing Diagram 167
9-1 SD/MMC Controller Topology 194
9-2 SD/MMC Controller External Interface Signals 195
9-3 SDIO Host Block Diagram 196
9-4 Command Path State Machine 197
9-5 Data Transmit State Machine 198
9-6 Data Receive State Machine 198
9-7 Descriptor Chain 200
9-8 The Structure of a Linked List 201
9-9 SD/MMC Timing in HS Mode 204
9-10 Clock Phase Selection 205
10-1 Ethernet MAC Functionality Overview 226
10-2 Ethernet Block Diagram 228
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 that 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
– 4 GB (32-bit) address space for both data bus and instruction bus
– Some embedded and external memory regions can be accessed by either data bus or instruction
bus
• Embedded 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.
• Peripherals
– 41 peripherals
• DMA
The block diagram in Figure 1-1 illustrates the system structure, and the block diagram in Figure 1-2 illustrates the
address map structure.
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 the most significant bytes of the
32-bit word stored at the 0x0 address, 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-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.
Boundary Address
Bus Type Size Target
Low Address High Address
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 Mem-
ory
Instruction 0x4000_0000 0x400C_1FFF 776 KB Embedded Mem-
ory
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 Mem-
ory
0x5000_2000 0xFFFF_FFFF Reserved
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 1-2 lists all embedded memories and their address ranges on the data and instruction buses.
Boundary Address
Bus Type Size Target Comment
Low Address High Address
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 Size Target Comment
Low Address High Address
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 Size Target Comment
Low Address High Address
Data Instruc-
0x5000_0000 0x5000_1FFF 8 KB RTC SLOW Memory -
tion
The address range of the first 32 KB of the ROM 0 (0x4000_0000 ~ 0x4000_7FFF) can be remapped in order
to access a part of Internal SRAM 1 that normally resides in a memory range of 0x400B_0000 ~ 0x400B_7FFF.
While remapping, the 32 KB SRAM cannot be accessed by an address range of 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.
0x4007_0000 ~ 0x4007_FFFF of the instruction bus. The remaining 128 KB can always be read and written by
either CPU at addresses 0x4008_0000 ~ 0x4009_FFFF of 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 onto the ROM 0 address space. See Internal Rom 0 for more informa-
tion.
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 an address range of 0x3FFE_0000 ~ 0x3FFF_FFFF to read and write Internal SRAM 1
and an address range of 0x3FFA_E000 ~ 0x3FFD_FFFF to read and write Internal SRAM 2.
In the ESP32, 13 peripherals are equipped with DMA. Table 1-3 lists these peripherals.
The two address ranges of PRO_CPU access RTC FAST Memory in the same order, so, for example, addresses
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.
Boundary Address
Bus Type Size Target Comment
Low Address High Address
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 Size Target Comment
Low Address High Address
1.3.4 Cache
As shown in Figure 1-3, each of the two CPUs in ESP32 has 32 KB of cache featuring a block size of 32 bytes for
accessing external storage. PRO CPU uses bit PRO_CACHE_ENABLE in register DPORT_PRO_CACHE_CTRL_REG
to enable the Cache, while APP CPU uses bit APP_CACHE_ENABLE in register DPORT_APP_CACHE_CTRL_REG
to enable the same function.
ESP32 uses a two-way set-associative cache. When the Cache function is to be used either by PRO CPU or APP
CPU, bit CACHE_MUX_MODE[1:0] in register DPORT_CACHE_MUX_MODE_REG can be set to select POOL0 or
POOL1 in the Internal SRAM0 as the cache memory. When both PRO CPU and APP CPU use the Cache function,
POOL0 and POOL1 in the Internal SRAM0 will be used simultaneously as the cache memory, while they can also
be used by the instruction bus. This is depicted in table 1-5 below.
As described in table 1-5, when bit CACHE_MUX_MODE is set to 1 or 2, PRO CPU and APP CPU cannot enable
the Cache function at the same time. When the Cache function is enabled, POOL0 or POOL1 can only be used
as the cache memory, and cannot be used by the instruction bus as well.
ESP32 Cache supports the Flush function. It is worth noting that when the Flush function is used, the data
written in the cache will be disposed rather than being rewritten into the External SRAM. To enable the Flush
function, first clear bit x_CACHE_FLUSH_ENA in register DPORT_x_CACHE_CTRL_REG, then set this bit to 1.
Afterwards, the system hardware will set bit x_CACHE_FLUSH_DONE to 1, where x can be ”PRO” or ”APP”,
indicating that the cache flush operation has been completed.
For more information about the address mapping of ESP32 Cache, please refer to Embedded Memory and
External Memory.
1.3.5 Peripherals
The ESP32 has 41 peripherals. Table 1-6 specifically describes the peripherals and their respective address
ranges. Nearly all peripheral modules can be accessed by either CPU at the same address with just a single
exception; this being the PID Controller.
Boundary Address
Bus Type Size Target Comment
Low Address High Address
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
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
Boundary Address
Bus Type Size Target Comment
Low Address High Address
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 MCPWM0
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
Data 0x3FF6_B000 0x3FF6_BFFF 4KB TWAI
Data 0x3FF6_C000 0x3FF6_CFFF 4 KB MCPWM1
Data 0x3FF6_D000 0x3FF6_DFFF 4 KB I2S1
Data 0x3FF6_E000 0x3FF6_EFFF 4 KB UART2
Data 0x3FF6_F000 0x3FF6_FFFF 4 KB Reserved
Data 0x3FF7_0000 0x3FF7_0FFF 4 KB Reserved
0x3FF7_1000 0x3FF7_4FFF 16 KB Reserved
Data 0x3FF7_5000 0x3FF7_5FFF 4 KB RNG
0x3FF7_6000 0x3FF7_FFFF 40 KB Reserved
Notice:
• Peripherals accessed by the CPU via 0x3FF40000 ~ 0x3FF7FFFF address space (DPORT address) can
also be accessed via 0x60000000 ~ 0x6003FFFF (AHB address). (0x3FF40000 + n) address and
(0x60000000 + n) address access the same content, where n = 0 ~ 0x3FFFF.
• The CPU can access peripherals via DPORT address more efficiently than via AHB address. However,
DPORT address is characterized by speculative reads, which means it cannot guarantee that each read
is valid. In addition, DPORT address will upset the order of r/w operations on the bus to improve perfor-
mance, which may cause programs that have strict requirements on the r/w order to crash. On the other
hand, using AHB address to read FIFO registers will cause unpredictable errors. To address above issues
please strictly follow the instructions documented in ESP32 ECO and Workarounds for Bugs, specifically
sections 3.3, 3.10, 3.16, and 3.17.
Internally, the SRAM is organized in 32K-sized banks. Each CPU and DMA channel can simultaneously access
the SRAM at full speed, provided they access addresses in different memory banks.
2.1 Overview
The Interrupt Matrix embedded in the ESP32 independently allocates peripheral interrupt sources to the two
CPUs’ peripheral interrupts. This configuration is made to be highly flexible in order to meet many different
needs.
2.2 Features
• Accepts 71 peripheral interrupt sources as input.
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.
• PRO_X_MAP_REG (or APP_X_MAP_REG) stands for any particular peripheral interrupt configuration reg-
ister of the PRO_CPU (or APP_CPU). The peripheral interrupt configuration register corresponds to the
peripheral interrupt source Source_X. In Table 2-1 the registers listed under “PRO_CPU (APP_CPU) - Pe-
ripheral Interrupt Configuration Register” correspond to the peripheral interrupt sources listed in “Peripheral
Interrupt Source - Name”.
• Interrupt_P stands for CPU peripheral interrupt, numbered as Num_P. Num_P can take the ranges 0 ~ 5,
8 ~ 10, 12 ~ 14, 17 ~ 28, 30 ~ 31.
• Interrupt_I stands for the CPU internal interrupt numbered as Num_I. Num_I can take values 6, 7, 11, 15, 16,
29.
Using this terminology, the possible operations of the Interrupt Matrix controller can be described as fol-
lows:
• Allocate multiple peripheral sources Source_Xn ORed to PRO_CPU (APP_CPU) peripheral interrupt
Set multiple PRO_Xn_MAP_REG (APP_Xn_MAP_REG) to the same Num_P. Any of these peripheral inter-
rupts will trigger CPU Interrupt_P.
2.4 Registers
The interrupt matrix registers are part of the DPORT registers and are described in Section 5.4 in Chapter 5 DPort
Registers.
• CPU reset: Only resets the registers of one or both of the CPU cores.
• Core reset: Resets all the digital registers, including CPU cores, external GPIO and digital GPIO. The RTC
is not reset.
• System reset: Resets all the registers on the chip, including those of the RTC.
– PLL_CLK is an internal PLL clock with a frequency of 320 MHz or 480 MHz.
– XTL_CLK is a clock signal generated using an external crystal with a frequency range of 2 ~ 40 MHz.
– RC_FAST_CLK is an internal clock with a default frequency of 8 MHz. This frequency is adjustable.
– RC_FAST_DIV_CLK is divided from RC_FAST_CLK. Its frequency is (RC_FAST_CLK / 256). With the
default RC_FAST_CLK frequency of 8 MHz, this clock runs at 31.250 KHz.
– RC_SLOW_CLK is an internal low power clock with a default frequency of 150 KHz. This frequency is
adjustable.
• Audio Clock
– APLL_CLK is an internal Audio PLL clock with a frequency range of 16 ~ 128 MHz.
The CPU_CLK clock source is determined by the RTC_CNTL_SOC_CLK_SEL register. PLL_CLK, APLL_CLK,
RC_FAST_CLK, and XTL_CLK can be set as the CPU_CLK source; see Table 3-2 and 3-3.
3.2.4.1 APB_CLK
The APB_CLK frequency is determined by CPU_CLK source, as detailed in Table 3-5.
3.2.4.2 REF_TICK
REF_TICK is derived from APB_CLK. The APB_CLK frequency is determined by CPU_CLK source. The REF_TICK
frequency should be fixed. When CPU_CLK source changes, users need to make sure the REF_TICK frequency
remains unchanged by setting a correct divider value.
For example, when CPU_CLK source is PLL_CLK and users need to keep the REF_TICK frequency at 1 MHz,
then they should set SYSCON_PLL_TICK_NUM to 79 (0x4F) so that the REF_TICK frequency = 80 MHz / (79+1)
= 1 MHz.
The LED PWM module can use RC_FAST_CLK as a clock source when APB_CLK is disabled. In other words,
when the system is in low-power consumption mode (see Power Management Chapter), normal peripherals will
be halted (APB_CLK is turned off), but the LED PWM can work normally via RC_FAST_CLK.
RTC_SLOW_CLK is used to clock the Power Management module. It can be sourced from RC_SLOW_CLK,
XTL32K_CLK or RC_FAST_DIV_CLK.
RTC_FAST_CLK is used to clock the On-chip Sensor module. It can be sourced from a divided XTL_CLK or from
RC_FAST_CLK.
Providing an integrated precision clock source can minimize system cost. To this end, ESP32 integrates an
audio PLL. The Audio PLL formula is as follows:
The operating frequency range of the numerator is 350 MHz ~ 500 MHz:
sdm1 sdm0
350M Hz < fxtal (sdm2 + + + 4) < 500M Hz
28 216
Please note that sdm1 and sdm0 are not available on revision0 of ESP32. Please consult the silicon revision in
ECO and Workarounds for Bugs in ESP32 for further details.
Audio PLL can be manually enabled or disabled via registers RTC_CNTL_PLLA_FORCE_PU and RTC_CNTL_PLLA
_FORCE_PD, respectively. Disabling it takes priority over enabling it. When RTC_CNTL_PLLA_FORCE_PU and
RTC_CNTL_PLLA_FORCE_PD are 0, PLL will follow the state of the system, i.e., when the system enters sleep
mode, PLL will be disabled automatically; when the system wakes up, PLL will be enabled automatically.
3.4 Registers
The addresses in this section are relative to the SYSCON base address provided in Table 1-6 Peripheral Address
Mapping in Chapter 1 System and Memory.
T
CN
IV_
_D
RE
_P
)
ed
ON
rv
SC
se
(re
SY
31 10 9 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x0 Reset
SYSCON_PRE_DIV_CNT Configures the divider value of CPU_CLK when the source of CPU_CLK
is XTL_CLK or RC_FAST_CLK. The value range is 0x0 ~ 0x3FF. CPU_CLK = XTL_CLK ( or
RC_FAST_CLK) / (the value of this field +1). (R/W)
M
NU
K_
IC
_T
L
TA
_X
)
ed
ON
rv
SC
se
(re
SY
31 8 7 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 39 Reset
SYSCON_XTAL_TICK_NUM Configures the divider value of REF_TICK when the source of APB_CLK
is XTL_CLK. The value range is 0x0 ~ 0xFF. REF_TICK = APB_CLK /(the value of this field + 1).
(R/W)
M
NU
K_
IC
_T
LL
_P
d)
ve
ON
r
SC
se
(re
SY
31 8 7 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 79 Reset
SYSCON_PLL_TICK_NUM Configures the divider value of REF_TICK when the source of APB_CLK
is PLL_CLK. The value range is 0x0 ~ 0xFF. REF_TICK = APB_CLK /(the value of this field + 1).
(R/W)
UM
_N
ICK
_T
K8M
_C
)
ed
ON
rv
SC
se
(re
SY
31 8 7 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 11 Reset
SYSCON_CK8M_TICK_NUM Configures the divider value of REF_TICK when the source of APB_CLK
is FOSC_CLK. The value range is 0x0 ~ 0xFF. REF_TICK = APB_CLK /(the value of this field + 1).
(R/W)
ON
rv
SC
se
(re
SY
31 8 7 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 99 Reset
SYSCON_APLL_TICK_NUM Configures the divider value of REF_TICK when the source of APB_CLK
is APLL_CLK. The value range is 0x0 ~ 0xFF. REF_TICK = APB_CLK /(the value of this field + 1).
(R/W)
E
AT
_D
ON
SC
SY
31 0
0x16042000 Reset
SYSCON_DATE Chip revision register. For more information see ESP32 Series SoC Errata. (R/W)
4.1 Overview
The ESP32 chip features 34 physical GPIO pads. Each pad can be used as a general-purpose I/O, or be
connected to an internal peripheral signal. The IO_MUX, RTC IO_MUX and the GPIO matrix are responsible
for routing signals from the peripherals to GPIO pads. Together these systems provide highly configurable
I/O.
Note that the I/O GPIO pads are 0-19, 21-23, 25-27, 32-39, while the output GPIOs are 0-19, 21-23, 25-27,
32-33. GPIO pads 34-39 are input-only.
GPIO 20 serves as a valid input and output only on ESP32-PICO-V3 and ESP32-PICO-V3-02. Please refer to
ESP32-PICO Series Datasheet for more information.
This chapter describes the signal selection and connection between the digital pads (FUN_SEL, IE, OE, WPU,
WDU, etc.), 162 peripheral input and 176 output signals (control signals: SIG_IN_SEL, SIG_OUT_SEL, IE, OE,
etc.), fast peripheral input/output signals (control signals: IE, OE, etc.), and RTC IO_MUX.
1. The IO_MUX contains one register per GPIO pad. Each pad can be configured to perform a ”GPIO” function
(when connected to the GPIO Matrix) or a direct function (bypassing the GPIO Matrix). Some high-speed
digital functions (Ethernet, SDIO, SPI, JTAG, UART) can bypass the GPIO Matrix for better high-frequency
digital performance. In this case, the IO_MUX is used to connect these pads directly to the peripheral.)
See Section 4.10 for a list of IO_MUX functions for each I/O pad.
2. The GPIO Matrix is a full-switching matrix between the peripheral input/output signals and the pads.
• For input to the chip: Each of the 162 internal peripheral inputs can select any GPIO pad as the input
source.
• For output from the chip: The output signal of each of the 34 GPIO pads can be from one of the 176
3. RTC IO_MUX is used to connect GPIO pads to their low-power and analog functions. Only a subset of
GPIO pads have these optional ”RTC” functions.
The input signal is read from the GPIO pad through the IO_MUX. The IO_MUX must be configured to set the
chosen pad to ”GPIO” function. This causes the GPIO pad input signal to be routed into the GPIO Matrix, which
in turn routes it to the selected peripheral input.
To read GPIO pad X into peripheral signal Y, follow the steps below:
1. Configure the GPIO_FUNCy_IN_SEL_CFG register corresponding to peripheral signal Y in the GPIO Matrix:
• Set the GPIO_FUNCy_IN_SEL field in this register, corresponding to the GPIO pad X to read from.
2. Configure the GPIO_FUNCx_OUT_SEL_CFG register and clear the GPIO_ENABLE_DATA[x] field correspond-
ing to GPIO pad X in the GPIO Matrix:
• Set the GPIO_FUNCx_OEN_SEL bit in the GPIO_FUNCx_OUT_SEL_CFG register to force the pin’s
output state to be determined always by the GPIO_ENABLE_DATA[x] field.
3. Configure the IO_MUX to select the GPIO Matrix. Set the IO_MUX_x_REG register corresponding to GPIO
pad X as follows:
• Set the function field (MCU_SEL) to the IO_MUX function corresponding to GPIO X (this is Function
2—numeric value 2—for all pins).
• Set or clear the FUN_WPU and FUN_WPD bits, as desired, to enable/disable internal pull-up/pull-
down resistors.
Notes:
• It is possible to have a peripheral read a constantly low or constantly high input value without connecting
this input to a pad. This can be done by selecting a special GPIO_FUNCy_IN_SEL input, instead of a GPIO
number:
For example, to connect RMT peripheral channel 0 input signal (RMT_SIG_IN0_IDX, signal index 83) to GPIO 15,
please follow the steps below. Note that GPIO 15 is also named the MTDO pin:
4. Set the IO_MUX_GPIO15 register MCU_SEL field to 2 (GPIO function) and also set the FUN_IE bit (input
mode).
The input value of any GPIO pin can be read at any time without configuring the GPIO Matrix for a particular
peripheral signal. However, it is necessary to enable the input in the IO_MUX by setting the FUN_IE bit in the
IO_MUX_x_REG register corresponding to pad X, as mentioned in Section 4.2.2.
4.3 Peripheral Output via GPIO Matrix
4.3.1 Summary
To output a signal from a peripheral via the GPIO Matrix, the GPIO Matrix is configured to route the peripheral
output signal (0-18, 23-37, 61-121, 140-125, 224-228) to one of the 28 GPIOs (0-19, 21-23, 25-27, 32-33).
The output signal is routed from the peripheral into the GPIO Matrix. It is then routed into the IO_MUX, which is
configured to set the chosen pad to ”GPIO” function. This causes the output GPIO signal to be connected to
the pad.
Note:
The peripheral output signals 224 to 228 can be configured to be routed in from one GPIO and output directly from
another GPIO.
signal0_out 0 MCU_SEL
signal1_out 1
signal2_out 2
signal3_out 3
0 (FUNC)
1 (FUNC)
GPIO X out I/O Pad x
2 (GPIO)
GPIOx_out
signal228_out 228
FUN_OE = 1
GPIO_OUT_DATA bit x 256 (0x100)
256sdfsdfasdfgas
• Set the GPIO_FUNCx_OUT_SEL field in GPIO_FUNCx_OUT_SEL_CFG to the numeric index (Y) of de-
sired peripheral output signal Y.
• If the signal should always be enabled as an output, set the GPIO_FUNCx_OEN_SEL bit in the
GPIO_FUN
Cx_OUT_SEL_CFG register and the GPIO_ENABLE_DATA[x] field in the GPIO_ENABLE_REG register
corresponding to GPIO pad X. To have the output enable signal decided by internal logic, clear the
GPIO_FUNCx_OEN_SEL bit instead.
2. For an open drain output, set the GPIO_PINx_PAD_DRIVER bit in the GPIO_PINx register corresponding to
GPIO pad X. For push/pull mode (default), clear this bit.
3. Configure the IO_MUX to select the GPIO Matrix. Set the IO_MUX_x_REG register corresponding to GPIO
pad X as follows:
• Set the function field (MCU_SEL) to the IO_MUX function corresponding to GPIO X (this is Function
2—numeric value 2—for all pins).
• Set the FUN_DRV field to the desired value for output strength (0-3). The higher the drive strength,
the more current can be sourced/sunk from the pin.
• If using open drain mode, set/clear the FUN_WPU and FUN_WPD bits to enable/disable the internal
pull-up/down resistors.
Notes:
• The output signal from a single peripheral can be sent to multiple pads simultaneously.
To configure a pad as simple GPIO output, the GPIO Matrix GPIO_FUNCx_OUT_SEL register is configured with a
special peripheral index value (0x100).
Selecting this option is less flexible than using the GPIO Matrix, as the IO_MUX register for each GPIO pad can
only select from a limited number of functions. However, better high-frequency digital performance will be
maintained.
1. IO_MUX for the GPIO pad must be set to the required pad function. (Please refer to section 4.10 for a list
of pad functions.)
2. For inputs, the SIG_IN_SEL register must be cleared to route the input directly to the peripheral.
When configured as RTC GPIOs, the output pads can still retain the output level value when the chip is in
Deep-sleep mode, and the input pads can wake up the chip from Deep-sleep.
If SLP_SEL is set to 0, the pin functions remain the same in both normal execution and Light-sleep mode.
The Hold state of each pin is controlled by the result of OR operation of the pin’s Hold enable signal and the
global Hold enable signal.
• Digital Pins (GPIO18 ~ GPIO19, GPIO21 ~ GPIO23, GPIO25 ~ GPIO27, GPIO32 ~ GPIO39)
– RTCIO_DIG_PAD_HOLD_REG[n], controls the Hold enable signal of each digital pin. See Table 4-8 for
the bit mapping for the pins.
– Alternatively, set RTC_CNTL_DG_PAD_FORCE_HOLD to hold the values of all digital pins, or set
RTC_CNTL_DG_PAD_FORCE_UNHOLD to disable the hold function of all digital pins.
– RTC_CNTL_HOLD_FORCE_REG[n](n = 0 ~ 17), controls the Hold enable signal of each RTC pins
(GPIO0 ~ GPIO17).
– Alternatively, set RTC_CNTL_DG_PAD_FORCE_HOLD to hold the values of all RTC pins, or set
RTC_CNTL_DG_PAD_FORCE_UNHOLD to disable the hold function of all RTC pins.
VDD3P3_CPU
GPIO21
GPIO22
GPIO19
XTAL_N
XTAL_P
U0RXD
U0TXD
VDDA
VDDA
CAP1
CAP2
48
47
46
45
44
43
42
41
40
39
38
37
VDDA 1 36 GPIO23
LNA_IN 2 35 GPIO18
VDD3P3 3 34 GPIO5
VDD3P3 4 33 SD_DATA_1
SENSOR_VP 5 32 SD_DATA_0
SENSOR_VN 8 29 SD_DATA_3
CHIP_PU 9 28 SD_DATA_2
VDET_1 10 27 GPIO17
VDET_2 11 26 VDD_SDIO
32K_XP 12 25 GPIO16
13
14
15
16
17
18
19
20
21
22
23
24
Analog pads
32K_XN
GPIO25
GPIO26
GPIO27
MTMS
MTDI
VDD3P3_RTC
MTCK
MTDO
GPIO2
GPIO0
GPIO4
Figure 4-4. ESP32 I/O Pad Power Sources (QFN 6*6, Top View)
GPIO21
GPIO22
XTAL_N
XTAL_P
U0RXD
U0TXD
VDDA
VDDA
CAP1
CAP2
48
47
46
45
44
43
42
41
40
39
VDDA 1 38 GPIO19
LNA_IN 2 37 VDD3P3_CPU
VDD3P3 3 36 GPIO23
VDD3P3 4 35 GPIO18
SENSOR_VP 5 34 GPIO5
SENSOR_CAPP 6 33 SD_DATA_1
SENSOR_CAPN 7 32 SD_DATA_0
ESP32
49 GND
SENSOR_VN 8 31 SD_CLK
CHIP_PU 9 30 SD_CMD
VDET_1 10 29 SD_DATA_3
VDET_2 11 28 SD_DATA_2
32K_XP 12 27 GPIO17
32K_XN 13 26 VDD_SDIO
GPIO25 14 25 GPIO16
15
16
17
18
19
20
21
22
23
24
Analog pads
GPIO26
GPIO27
MTMS
MTDI
VDD3P3_RTC
MTCK
MTDO
GPIO2
GPIO0
Figure 4-5. ESP32 I/O Pad Power Sources (QFN 5*5, Top View)
• Pads marked blue are RTC pads that have their individual analog function and can also act as normal digital
IO pads. For details, please see Section 4.11.
• Pads marked green can be powered externally or internally via VDD_SDIO (see below).
Without an external power supply, the internal regulator will supply VDD_SDIO. The VDD_SDIO voltage can be
configured to be either 1.8V or the same as VDD3P3_RTC, depending on the state of the MTDI pad at reset –
a high level configures 1.8V and a low level configures the voltage to be the same as VDD3P3_RTC. Setting the
efuse bit determines the default voltage of the VDD_SDIO. In addition, software can change the voltage of the
VDD_SDIO by configuring register bits.
Direct I/O in IO_MUX ”YES” means that this signal is also available directly via IO_MUX. To apply the GPIO Matrix
to these signals, their corresponding SIG_IN_SEL register must be cleared.
GPIO Pad Name Function 0 Function 1 Function 2 Function 3 Function 4 Function 5 Reset Notes
0 GPIO0 GPIO0 CLK_OUT1 GPIO0 - - EMAC_TX_CLK 3 R
1 U0TXD U0TXD CLK_OUT3 GPIO1 - - EMAC_RXD2 3 -
2 GPIO2 GPIO2 HSPIWP GPIO2 HS2_DATA0 SD_DATA0 - 2 R
3 U0RXD U0RXD CLK_OUT2 GPIO3 - - - 3 -
4 GPIO4 GPIO4 HSPIHD GPIO4 HS2_DATA1 SD_DATA1 EMAC_TX_ER 2 R
5 GPIO5 GPIO5 VSPICS0 GPIO5 HS1_DATA6 - EMAC_RX_CLK 3 -
6 SD_CLK SD_CLK SPICLK GPIO6 HS1_CLK U1CTS - 3 -
7 SD_DATA_0 SD_DATA0 SPIQ GPIO7 HS1_DATA0 U2RTS - 3 -
8 SD_DATA_1 SD_DATA1 SPID GPIO8 HS1_DATA1 U2CTS - 3 -
9 SD_DATA_2 SD_DATA2 SPIHD GPIO9 HS1_DATA2 U1RXD - 3 -
10 SD_DATA_3 SD_DATA3 SPIWP GPIO10 HS1_DATA3 U1TXD - 3 -
GPIO Pad Name Function 1 Function 2 Function 3 Function 4 Function 5 Function 6 Reset Notes
11 SD_CMD SD_CMD SPICS0 GPIO11 HS1_CMD U1RTS - 3 -
12 MTDI MTDI HSPIQ GPIO12 HS2_DATA2 SD_DATA2 EMAC_TXD3 2 R
13 MTCK MTCK HSPID GPIO13 HS2_DATA3 SD_DATA3 EMAC_RX_ER 2 R
14 MTMS MTMS HSPICLK GPIO14 HS2_CLK SD_CLK EMAC_TXD2 3 R
15 MTDO MTDO HSPICS0 GPIO15 HS2_CMD SD_CMD EMAC_RXD3 3 R
16 GPIO16 GPIO16 - GPIO16 HS1_DATA4 U2RXD EMAC_CLK_OUT 1 -
17 GPIO17 GPIO17 - GPIO17 HS1_DATA5 U2TXD EMAC_CLK_180 1 -
18 GPIO18 GPIO18 VSPICLK GPIO18 HS1_DATA7 - - 1 -
19 GPIO19 GPIO19 VSPIQ GPIO19 U0CTS - EMAC_TXD0 1 -
21 GPIO21 GPIO21 VSPIHD GPIO21 - - EMAC_TX_EN 1 -
22 GPIO22 GPIO22 VSPIWP GPIO22 U0RTS - EMAC_TXD1 1 -
23 GPIO23 GPIO23 VSPID GPIO23 HS1_STROBE - - 1 -
25 GPIO25 GPIO25 - GPIO25 - - EMAC_RXD0 0 R
26 GPIO26 GPIO26 - GPIO26 - - EMAC_RXD1 0 R
27 GPIO27 GPIO27 - GPIO27 - - EMAC_RX_DV 0 R
32 32K_XP GPIO32 - GPIO32 - - - 0 R
33 32K_XN GPIO33 - GPIO33 - - - 0 R
34 VDET_1 GPIO34 - GPIO34 - - - 0 R, I
35 VDET_2 GPIO35 - GPIO35 - - - 0 R, I
36 SENSOR_VP GPIO36 - GPIO36 - - - 0 R, I
37 SENSOR_CAPP GPIO37 - GPIO37 - - - 0 R, I
38 SENSOR_CAPN GPIO38 - GPIO38 - - - 0 R, I
39 SENSOR_VN GPIO39 - GPIO39 - - - 0 R, I
Reset Configurations
Notes
• I - Pad can only be configured as input GPIO. These input-only pads do not feature an output driver or
internal pull-up/pull-down circuitry.
Please refer to the ESP32 Pin Lists in ESP32 Datasheet for more details.
Note:
For more information on the configuration of sar_i2c_xx, see Section RTC I2C Controller in Chapter 30 ULP Coprocessor
(ULP).
1. GPIO20 is only available for ESP32-PICO-V3 and ESP32-PICO-V3-02. Please refer to ESP32-PICO Series Datasheet
for more information.
4.13 Registers
4.13.1 GPIO Matrix Registers
The addresses in parenthesis besides register names are the register addresses relative to the GPIO base ad-
dress provided in Table 1-6 Peripheral Address Mapping in Chapter 1 System and Memory. The absolute register
addresses are listed in Section 4.12.1 GPIO Matrix Register Summary.
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_OUT_W1TS_REG GPIO0-31 output set register. For every bit that is 1 in the value written here,
the corresponding bit in GPIO_OUT_REG will be set. (WO)
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_OUT_W1TC_REG GPIO0-31 output clear register. For every bit that is 1 in the value written
here, the corresponding bit in GPIO_OUT_REG will be cleared. (WO)
U
_O
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
TA
DA
T_
)
ed
U
_O
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_OUT_DATA GPIO32-39 output value set register. For every bit that is 1 in the value written
here, the corresponding bit in GPIO_OUT1_DATA will be set. (WO)
TA
DA
T_
)
ed
U
_O
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_OUT_DATA GPIO32-39 output value clear register. For every bit that is 1 in the value written
here, the corresponding bit in GPIO_OUT1_DATA will be cleared. (WO)
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_ENABLE_W1TS_REG GPIO0-31 output enable set register. For every bit that is 1 in the value
written here, the corresponding bit in GPIO_ENABLE will be set. (WO)
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_ENABLE_W1TC_REG GPIO0-31 output enable clear register. For every bit that is 1 in the value
written here, the corresponding bit in GPIO_ENABLE will be cleared. (WO)
TA
DA
E_
BL
)
NA
ed
_E
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
TA
DA
E_
BL
)
NA
ed
_E
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_ENABLE_DATA GPIO32-39 output enable set register. For every bit that is 1 in the value written
here, the corresponding bit in GPIO_ENABLE1 will be set. (WO)
NA
ed
_E
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_ENABLE_DATA GPIO32-39 output enable clear register. For every bit that is 1 in the value
written here, the corresponding bit in GPIO_ENABLE1 will be cleared. (WO)
NG
PI
AP
)
TR
ed
_S
rv
se
IO
(re
GP
31 16 15 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x x x x x x x x x x x x x x x x Reset
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_IN_REG GPIO0-31 input value. Each bit represents a pad input value, 1 for high level and 0 for
low level. (RO)
EXT
_N
TA
DA
)
ed
N_
rv
_I
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_IN_DATA_NEXT GPIO32-39 input value. Each bit represents a pad input value. (RO)
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_STATUS_INT GPIO0-31 interrupt status register. Each bit can be either of the two interrupt
sources for the two CPUs. The enable bits in GPIO_PINn_INT_ENA, corresponding to the 13-16
bits in GPIO_PINn_REG should be set to 1. (R/W)
S
1T
_W
NTI
S_
TU
TA
_S
IO
GP
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_STATUS_INT_W1TS GPIO0-31 interrupt status set register. For every bit that is 1 in the value
written here, the corresponding bit in GPIO_STATUS_INT will be set. (WO)
C
1T
_W
NT
_I
US
AT
ST
IO_
GP
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
GPIO_STATUS_INT_W1TC GPIO0-31 interrupt status clear register. For every bit that is 1 in the value
written here, the corresponding bit in GPIO_STATUS_INT will be cleared. (WO)
TA
ed
_S
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_STATUS1_INT GPIO32-39 interrupt status register. Each bit can be either of the two interrupt
sources for the two CPUs. The enable bits in GPIO_PINn_INT_ENA, corresponding to the 13-16
bits in GPIO_PINn_REG should be set to 1. (R/W)
S
1T
_W
NT
_I
S1
TU
d)
TA
ve
_S
r
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_STATUS1_INT_W1TS GPIO32-39 interrupt status set register. For every bit that is 1 in the value
written here, the corresponding bit in GPIO_STATUS1_INT will be set. (WO)
C
1T
_W
NT
_I
S1
TU
)
TA
ed
_S
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
GPIO_STATUS1_INT_W1TC GPIO32-39 interrupt status clear register. For every bit that is 1 in the
value written here, the corresponding bit in GPIO_STATUS1_INT will be cleared. (WO)
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
31 0
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x Reset
NT
I
U_
CP
)
PP
ed
_A
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
PP
ed
_A
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
T
IN
U_
CP
RO
)
ed
_P
rv
se
IO
(re
GP
31 8 7 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 x x x x x x x x Reset
T
IN
I_
N M
U_
CP
RO
)
ed
P
rv
O_
se
I
(re
GP
31 8 7 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 x x x x x x x x Reset
LE
AB
R
EN
VE
P_
PE
RI
A
EN
EU
_D
TY
T_
T_
AK
AD
IN
IN
W
_P
n_
n_
n_
(re INn
d)
GP ed)
)
ed
ed
IN
IN
IN
ve
_P
_P
_P
rv
rv
rv
O_
r
se
se
se
se
IO
IO
IO
I
(re
(re
(re
GP
GP
GP
31 18 17 13 12 11 10 9 7 6 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 x x x x x 0 0 x x x x 0 0 0 0 x 0 0 Reset
GPIO_PINn_WAKEUP_ENABLE GPIO wake-up enable will only wake up the CPU from Light-sleep.
(R/W)
L
SE
IN
_I L
Cy SE
N_
N_
UN IN_
_I
Cy
_F _
IO IGy
UN
)
ed
GP _S
_F
rv
se
IO
IO
GP
GP
(re
31 8 7 6 5 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 x x x x x x x x Reset
GPIO_SIGy_IN_SEL Bypass the GPIO Matrix. 1: route through GPIO Matrix, 0: connect signal directly
to peripheral configured in the IO_MUX. (R/W)
GPIO_FUNCy_IN_SEL Selection control for peripheral input y. A value of 0-39 selects which of the
40 GPIO Matrix input pins this signal is connected to, or 0x38 for a constantly high input or 0x30
for a constantly low input. (R/W)
UT EL EL
EL
_O _S _S
_S
EL
Cn EN INV
NV
_S
_I
UN n_O _
UT
_F C EN
IO UN _O
_O
GP _F Cn
Cn
d)
IO UN
UN
ve
GP _F
_F
r
se
IO
IO
(re
GP
GP
31 12 11 10 9 8 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x x x x x x x x x x x x Reset
GPIO_FUNCn_OEN_INV_SEL 1: Invert the output enable signal; 0: do not invert the output enable
signal. (R/W)
GPIO_FUNCn_OUT_INV_SEL 1: Invert the output value; 0: do not invert the output value. (R/W)
K2
K3
K1
CL
CL
CL
L_
L_
L_
)
ed
R
CT
CT
CT
rv
se
N_
N_
N_
(re
PI
PI
PI
31 12 11 8 7 4 3 0
Note:
• Only the above mentioned combinations of clock source (i.e. I2S0/1_CLK, APLL clock) and clock output pins
(i.e. CLK_OUT1 ~ 3) are possible.
U
P_ PD
)
CU V
N_ PU
CU D
EL
FU RV
ed
CU P
R
E
CU L
P
M _IE
M _W
SL _W
_D
_O
M SE
_S
FU IE
FU _W
W
rv
D
N_
N_
se
CU
CU
N
(re
FU
M
M
31 15 14 12 11 10 9 8 7 6 5 4 3 2 1 0
MCU_SEL Select the IO_MUX function for this signal. 0 selects Function 0, 1 selects Function 1,
etc. (R/W)
FUN_DRV Select the drive strength of the pad. A higher value corresponds with a higher strength.
For GPIO34-39, FUN_DRV is always 0. For detailed drive strength, please see note 8 in Table
”Notes on ESP32 Pin Lists”, in ESP32 Datasheet. (R/W)
FUN_IE Input enable of the pad. 1: input enabled; 0: input disabled. (R/W)
FUN_WPU Pull-up enable of the pad. 1: internal pull-up enabled; 0: internal pull-up disabled. GPIO
pins 34-39 are input-only. These pins do not feature an output driver or internal pull- up/pull-
down circuitry, therefore, their FUN_WPU is always 0. (R/W)
FUN_WPD Pull-down enable of the pad. 1: internal pull-down enabled, 0: internal pull-down dis-
abled. GPIO pins 34-39 are input-only. These pins do not feature an output driver or internal
pull- up/pull-down circuitry, therefore, their FUN_WPD is always 0. (R/W)
MCU_DRV Select the drive strength of the pad during sleep mode. A higher value corresponds
with a higher strength. (R/W)
MCU_IE Input enable of the pad during sleep mode. 1: input enabled; 0: input disabled. (R/W)
MCU_WPU Pull-up enable of the pad during sleep mode. 1: internal pull-up enabled; 0: internal
pull-up disabled. (R/W)
MCU_WPD Pull-down enable of the pad during sleep mode. 1: internal pull-down enabled; 0: in-
ternal pull-down disabled. (R/W)
SLP_SEL Sleep mode selection of this pad. Set to 1 to put the pad in sleep mode. (R/W)
MCU_OE Output enable of the pad in sleep mode. 1: enable output; 0: disable output. (R/W)
A
AT
_D
UT
_O
IO
GP
C_
d)
RT
ve
O_
r
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_OUT_DATA GPIO0-17 output register. Bit14 is GPIO[0], bit15 is GPIO[1], etc. (R/W)
)
RT
ed
O_
rv
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_OUT_DATA_W1TS GPIO0-17 output set register. For every bit that is 1 in the value
written here, the corresponding bit in RTCIO_RTC_GPIO_OUT will be set. (WO)
)
RT
ed
O_
rv
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_OUT_DATA_W1TC GPIO0-17 output clear register. For every bit that is 1 in the
value written here, the corresponding bit in RTCIO_RTC_GPIO_OUT will be cleared. (WO)
B LE
NA
_E
IO
GP
C_
d)
RT
ve
O_
r
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_ENABLE GPIO0-17 output enable. Bit14 is GPIO[0], bit15 is GPIO[1], etc. 1 means
this GPIO pad is output. (R/W)
)
RT
ed
O_
rv
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_ENABLE_W1TS GPIO0-17 output enable set register. For every bit that is 1 in the
value written here, the corresponding bit in RTCIO_RTC_GPIO_ENABLE will be set. (WO)
)
RT
ed
O_
rv
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_ENABLE_W1TC GPIO0-17 output enable clear register. For every bit that is 1 in
the value written here, the corresponding bit in RTCIO_RTC_GPIO_ENABLE will be cleared. (WO)
NTI
S_
TU
TA
_S
IO
GP
C_
d)
RT
ve
O_
r
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
)
RT
ed
O_
rv
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_STATUS_INT_W1TS GPIO0-17 interrupt set register. For every bit that is 1 in the
value written here, the corresponding bit in RTCIO_RTC_GPIO_STATUS_INT will be set. (WO)
)
RT
ed
O_
rv
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_STATUS_INT_W1TC GPIO0-17 interrupt clear register. For every bit that is 1 in the
value written here, the corresponding bit in RTCIO_RTC_GPIO_STATUS_INT will be cleared. (WO)
XT
NE
N_
_I
IO
GP
C_
d)
RT
ve
O_
r
se
CI
(re
RT
31 14 13 0
x x x x x x x x x x x x x x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_RTC_GPIO_IN_NEXT GPIO0-17 input value. Bit14 is GPIO[0], bit15 is GPIO[1], etc. Each bit
represents a pad input value, 1 for high level, and 0 for low level. (RO)
LE
AB
ER
EN
IV
P_
DR
P
EU
TY
D_
T_
AK
PA
IN
W
n_
n_
n_
IN
IN
IN
_P
_P
_P
IO
IO
ed PIO
GP
GP
se C_G
C_
C_
)
)
RT
RT
(re RT
ed
ed
O_
O_
O_
rv
rv
rv
se
se
CI
CI
CI
(re
(re
RT
RT
RT
31 11 10 9 7 6 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x x x x 0 0 0 0 x 0 0 Reset
RTCIO_RTC_GPIO_PINn_WAKEUP_ENABLE GPIO wake-up enable. This will only wake up the ESP32
from Light-sleep. (R/W)
31 0
0 Reset
RTCIO_DIG_PAD_HOLD_REG Selects the digital pads which should be put on hold. While 0 allows
normal operation, 1 puts the pad on hold. (R/W)
Name Description
Bit[0] Set to 1 to enable the Hold function of pad U0RXD
Bit[1] Set to 1 to enable the Hold function of pad U0TXD
Bit[2] Set to 1 to enable the Hold function of pad
SD_CLK
Bit[3] Set to 1 to enable the Hold function of pad
SD_DATA0
Bit[4] Set to 1 to enable the Hold function of pad
SD_DATA1
Bit[5] Set to 1 to enable the Hold function of pad
SD_DATA2
Bit[6] Set to 1 to enable the Hold function of pad
SD_DATA3
Bit[7] Set to 1 to enable the Hold function of pad
SD_CMD
Bit[8] Set to 1 to enable the Hold function of pad GPIO5
Bit[9] Set to 1 to enable the Hold function of pad GPIO16
Bit[10] Set to 1 to enable the Hold function of pad GPIO17
Bit[11] Set to 1 to enable the Hold function of pad GPIO18
Bit[12] Set to 1 to enable the Hold function of pad GPIO19
Bit[13] Set to 1 to enable the Hold function of pad
GPIO201
Bit[14] Set to 1 to enable the Hold function of pad GPIO21
Bit[15] Set to 1 to enable the Hold function of pad
GPIO22
Bit[16] Set to 1 to enable the Hold function of pad
GPIO23
1. GPIO20 is only available for ESP32-PICO-V3 and ESP32-PICO-V3-02. Please refer to ESP32-PICO Series Datasheet
for more information.
R_ SE4 U SEL
UX EL
EL
S E LP L
_S SE SL EL
NS SEN E3_ UX EL
E LP EL
_S E3_ P_ L
4_ P_ L
O_ SOR SEN E2_ _SE
O_ NS _S E3_ _IE
L E
SE SL SE
O_ NS _S E4_ _IE
IE
M _S
_S
S SL E
S
IE
SE 2_F _IE
UN E
_ S M S
FU I E
SO ENS 2_S _S
_S
EN FU E
M _
C SE OR EN 3_ LD
EN 1_ _S
CI SE OR EN 4_ LD
RT SE OR EN 1_M LD
NS _S SE UN_
N_
I
O_ SOR SEN E2_ UX_
C SE OR EN 2_ D
N_
N_
EN 4_ P_
X
UN
SE E3 LP
RT IO_ NS _S SE OL
P
RT IO_ NS _S SE HO
RT IO_ NS _S SE HO
O_ NS _S SE HO
FU
FU
FU
_S SE SL
S
S
F
F
C SE OR EN 1_H
O_ NS _S E2_
_
_
OR EN _
O_ NS _S E1_
OR EN 1_
4
RT IO_ NS _S SE
NS _S SE
N _ S
N _ S
S
NS
N _ S
S
S
NS
C SE OR EN
EN
RT SE OR EN
RT SE OR EN
RT SE OR EN
SE OR EN
E
RT IO_ NS _S
R_
_
C SE OR
CI E R
OR
CI SE OR
CI SE OR
OR
CI SE OR
O
O
RT IO_ NS
RT O_ NS
NS
RT O_ NS
RT IO_ NS
RT _ S
EN
EN
)
C SE
RT SE
CI SE
RT SE
CI SE
C SE
CI SE
ed
S
S
RT IO_
RT _
O_
RT O_
RT _
RT O_
rv
O
se
CI
CI
CI
CI
CI
CI
CI
CI
C
(re
RT
RT
RT
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 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 Reset
RTCIO_SENSOR_SENSEn_HOLD Set to 1 to hold the output value on sensen; 0 is for normal oper-
ation. (R/W)
RTCIO_SENSOR_SENSEn_FUN_SEL Select the RTC IO_MUX function for this pad. 0: select Func-
tion 0. (R/W)
RTCIO_SENSOR_SENSEn_SLP_SEL Selection of sleep mode for the pad: set to 1 to put the pad in
sleep mode. (R/W)
EL
AD AD 2_S SEL
UX EL
RT AD AD _SL EL
C2 LP EL
C LP EL
E
_S
_F E
_F _IE
C_ 2_M X_S
AD _S _S
_I
C_ 1_F _IE
AD _M LD
_
AD _S _S
_I
RT AD AD _H D
N_
UN
UN
C_ C2 LP
UN
O_ C_ C OL
C_ C1 P
C_ C1 O
C U
FU
CI AD AD H
RT IO_ C_ C1_
_
2
C2
C1
1
O_ C_ C
O_ C_ C
C AD AD
AD
CI AD AD
AD
CI AD AD
RT O_ C_
RT _ _
RT O_ C_
C
)
CI AD
RT AD
CI AD
RT AD
CI AD
ed
RT IO_
O_
RT O_
O_
RT O_
rv
O
se
CI
CI
CI
CI
C
(re
RT
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 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 Reset
RTCIO_ADC_ADCn_HOLD Set to 1 to hold the output value on the pad; 0 is for normal operation.
(R/W)
RTCIO_ADC_ADCn_FUN_SEL Select the RTC function for this pad. 0: select Function 0; 3: select
Function 1. (R/W)
RTCIO_ADC_ADCn_SLP_SEL Signal selection of pad’s sleep mode. Set this bit to 1 to put the pad
to sleep. (R/W)
RTCIO_ADC_ADCn_SLP_IE Input enable of the pad in sleep mode. 1 enabled; 0 disabled. (R/W)
E
RC
FO
D_
FU EL
AC UX_ C
CI PA PD 1_S SEL
O_ D_ AC L EL
M DA
XP
AC FU E
DA IE
S
D_ AC SL E
PD 1_ P_O
CI PA PD 1_S _S
PD 1_ LD
N_
1_ N_
PA PD 1_ P_I
C_
D_ C1_ D_
C
V
E
1_ E
RT _ _ C LP
D_ AC HO
RU
DR
AC RD
DA
A XP
1_
PA D _
1_
O_ _PD C1_
1_
1
AC
O_ D_ AC
AC
RT O_ D_ AC
D A
A
PD
CI PA PD
PD
RT PA PD
PD
CI PA PD
P
D_
RT _ _
D_
O_ D_
RT O_ D_
D
)
RT PA
CI PA
PA
CI PA
RT PA
CI PA
ed
O_
RT IO_
O_
RT O_
RT O_
rv
O
se
CI
CI
CI
CI
CI
C
(re
RT
RT
RT
31 30 29 28 27 26 19 18 17 16 15 14 13 12 11 10 9 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_PAD_PDAC1_HOLD Set to 1 to hold the output value on the pad; set to 0 for normal opera-
tion. (R/W)
RTCIO_PAD_PDAC1_SLP_SEL Sleep mode selection signal of the pad. Set this bit to 1 to put the
pad to sleep. (R/W)
RTCIO_PAD_PDAC1_SLP_IE Input enable of the pad in sleep mode. 1: enabled; 0: disabled. (R/W)
E
RC
FO
D_
UN L
DA MU DAC
RT IO_ D_ AC SLP L
PA PD 2_ P_ L
_F SE
XP
AC FU OE
O_ D_ AC SL E
DA IE
_S
D_ AC SL IE
CI PA PD 2_ _S
C2 X_
PD 2_ LD
2_ N_
C_
D_ C2_ PD_
PD 2_ P_
C
O_ D_ AC RV
E
2_ E
D_ AC HO
RU
AC RD
DA
D
A X
2_
PA D _
2_
O_ _PD C2_
C PA PD 2_
2
AC
AC
RT _ _ C
D A
A
PD
CI PA PD
PD
RT PA PD
CI A D
P
P
D_
RT _ _
D_
O_ D_
RT O_ D_
D
)
RT PA
CI PA
PA
CI PA
RT PA
CI PA
ed
P
O_
RT IO_
O_
RT O_
RT _
rv
O
se
CI
CI
CI
CI
CI
C
(re
RT
RT
RT
31 30 29 28 27 26 19 18 17 16 15 14 13 12 11 10 9 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
RTCIO_PAD_PDAC2_HOLD Set to 1 to hold the output value on the pad; 0 is for normal operation.
(R/W)
RTCIO_PAD_PDAC2_FUN_SEL Select the RTC function for this pad. 0: select Function 0. (R/W)
RTCIO_PAD_PDAC2_SLP_SEL Sleep mode selection signal of the pad. Set this bit to 1 to put the
pad to sleep. (R/W)
RTCIO_PAD_PDAC2_SLP_IE Input enable of the pad in sleep mode. 1: enabled; 0: disabled. (R/W)
K
K
2N X_S L
32
CI XT X3 _S SEL
CI XT X3 FUN L
O_ AL 2 LP L
32
2K
2P U 2K
L_ 2N LP EL
U SE
L_ 2P LP_ L
E
E
X3 FUN E
E
DR UN E
RT XTA X3 _S SE
_X E
L_
X3 _S _IE
_S
_ _O
X3 _S IE
_3
L_
RT XTA _X3 _S _S
_I
X3 M 3
_M X_
_F _O
_I
X3 _R D
_
X3 _R D
TA
L_ 2N OL
CI XT X3 DRV
X3 RUE
2N DE
N P
2N LP
UN
L_ 2P OL
RV
UE
TA
2P DE
CI XT XP TAL
L_ 2N L
2P LP
O_ AL 2 L
A
_X
RT XTA _X3 _H
RT XTA _X3 XT
_D
RT XTA X3 _H
_R
CI XT X3 _S
_F
_
_
X
AS
C_
ES
_
2N
RT _ L_ N
2P
2P
RT O_ L_ 2P
P
O_ AL D
O_ AL 2
O_ AL 2
ed DBI
DA
X3
CI XT X3
X3
CI XT X3
L_
RT _ L_
L_
RT O_ AL_
L_
RT O_ L_
L_
RT O_ L_
L_
RT IO_ AL_
L_
L_
RT XTA
RT XTA
RT XTA
RT XTA
A
A
RT XTA
(re XTA
)
CI XT
CI XT
CI XT
CI XT
C T
XT
X
O_
RT IO_
O_
RT _
O_
RT _
O_
RT _
O_
RT O_
O_
O_
rv
O
se
CI
CI
CI
CI
CI
CI
CI
CI
CI
CI
CI
C
RT
RT
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
2 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 Reset
RTCIO_XTAL_X32N_HOLD Set to 1 to hold the output value on the pad; 0 is for normal operation.
(R/W)
RTCIO_XTAL_X32P_HOLD Set to 1 to hold the output value on the pad, 0 is for normal operation.
(R/W)
RTCIO_XTAL_X32N_MUX_SEL 0: route X32N pad to the digital IO_MUX; 1: route to RTC block.
(R/W)
RTCIO_XTAL_X32P_MUX_SEL 0: route X32P pad to the digital IO_MUX; 1: route to RTC block.
(R/W)
RTCIO_XTAL_X32N_SLP_SEL Sleep mode selection. Set this bit to 1 to put the pad to sleep. (R/W)
RTCIO_XTAL_X32N_SLP_IE Input enable of the pad in sleep mode. 1: enabled; 0: disabled. (R/W)
RTCIO_XTAL_X32P_SLP_SEL Sleep mode selection. Set this bit to 1 to put the pad to sleep. (R/W)
RTCIO_XTAL_X32P_SLP_IE Input enable of the pad in sleep mode. 1: enabled; 0: disabled. (R/W)
GE
FH
UR
AN
EF
UC PD_
DC
DR
DR
X
O_ CH_
H_
H
CH
CH
UC
RT TOU
)
TO
TO
TO
TO
ed
O_
O_
O_
O_
rv
se
CI
CI
CI
CI
CI
(re
RT
RT
RT
RT
31 30 29 28 27 26 25 24 23 22 0
0 1 1 0 0 1 1 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 Reset
RTCIO_TOUCH_XPD_BIAS Touch sensor bias power on bit. 1: power on; 0: disabled. (R/W)
RTCIO_TOUCH_DCUR Touch sensor bias current. When BIAS_SLEEP is enabled, this setting is
available. (R/W)
FU EL
RT IO_T UC PA _SL EL
TO H D LP EL
IO
Dn D T
Dn UN E
O_ E
S
RT TOU PA _XP OP
_S
GP
PA _F _O
P _T T
O_ UC PA _S S
_T _I
Dn X_
D
RT TOU H_ Dn TAR
CI O _ n P_
N
PA HOL
AC
E
n_ E
H_ Dn LP
U
RU
R
AD RD
_M
_D
_D
O_ UC PA _S
_
) _P n_
_
Dn
Dn
Dn
CI O _ n
C O H_ Dn
ed H D
D
RT TOU PA
rv C A
PA
RT O_T UC PA
RT IO_T UC PA
P
P
O_ CH_
RT IO_T H_
se OU H_
H_
CI O H_
RT IO_T H_
C O _
H
H
C
(re O_T UC
UC
RT _T C
RT O_T UC
RT TOU
d)
CI O
TO
CI O
CI O
ve
RT O_T
O_
O_
r
se
CI
CI
CI
CI
CI
C
(re
RT
RT
RT
31 30 29 28 27 26 25 23 22 21 20 19 18 17 16 15 14 13 12 11 0
0 1 0 1 0 0 1 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 Reset
RTCIO_TOUCH_PADn_DRV Selects the drive strength of the pad. A higher value corresponds with a
higher strength. For detailed drive strength, please see ESP32 Datasheet > Appendix A.1 Notes
on ESP32 Pin Lists > Note 8. (R/W)
RTCIO_TOUCH_PADn_DAC Touch sensor slope control. 3-bit for each touch pad. Default is b’100.
(R/W)
RTCIO_TOUCH_PADn_SLP_SEL Sleep mode selection signal of the pad. Set this bit to 1 to put the
pad to sleep. (R/W)
RTCIO_TOUCH_PADn_FUN_IE Input enable of the pad in normal working mode (SLP_SEL = 0).
1: Enabled
0: Disabled
(R/W)
IO
Dm XP PT
GP
UC _PA m_ ART
PA _ _O
AC
_T D
O_
H_ Dm TIE
TO H D ST
_D
O_ UC PA _
Dm
CI O H_ Dm
PA
RT _T C A P
H_
CI O _ H
UC
RT O_T UC
U
)
d)
TO
CI O
ed
ve
RT _T
O_
rv
r
se
se
CI
CI
(re
(re
RT
RT
31 26 25 23 22 21 20 19 16 0
0 0 0 0 0 0 1 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 Reset
RTCIO_TOUCH_PADm_DAC Touch sensor slope control. 3-bit for each touch pad. Default b’100.
(R/W)
)
ed
E
O_
rv
se
CI
(re
RT
31 27 26 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 Reset
RTCIO_EXT_WAKEUP0_SEL GPIO[0-17] can be used to wake up the chip when the chip is in the
sleep mode. This register prompts the pad source to wake up the chip when the latter is in
deep/light sleep mode. 0: select GPIO0; 1: select GPIO2, etc. (R/W)
S EL
R_
CT
T_
_EX
TL
d)
X
ve
O_
r
se
CI
(re
RT
31 27 26 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 Reset
RTCIO_XTL_EXT_CTR_SEL Select the external crystal power down enable source to get into
sleep mode. 0: select GPIO0; 1: select GPIO2, etc. The input value on this pin XOR
RTC_CNTL_XTL_EXT_CTR_LV is the crystal power down enable signal. (R/W)
L
SE
SE
A_
L_
SC
SD
C_
C_
I2
I2
R_
R_
)
SA
SA
ed
O_
O_
rv
se
CI
CI
(re
RT
RT
31 30 29 28 27 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 Reset
RTCIO_SAR_I2C_SDA_SEL Selects the other pad as the RTC I2C SDA signal. 0: pad
TOUCH_PAD[1]; 1: pad TOUCH_PAD[3]. Default value is 0. (R/W)
RTCIO_SAR_I2C_SCL_SEL Selects the other pad as the RTC I2C SCL signal. 0: pad
TOUCH_PAD[0]; 1: pad TOUCH_PAD[2]. Default value is 0. (R/W)
5 DPort Registers
5.1 Introduction
The ESP32 integrates a large number of peripherals, and enables the control of individual peripherals to achieve
optimal characteristics in performance-vs-power-consumption scenarios. The DPort registers control clock
management (clock gating), power management, and the configuration of peripherals and core-system mod-
ules. The system arranges each module with configuration registers contained in the DPort Register.
5.2 Features
DPort registers correspond to different peripheral blocks and core modules:
• Interrupt matrix
• DMA
• MPU/MMU
• APP_CPU controller
• DPORT_PERI_CLK_EN_REG
• DPORT_PERI_RST_EN_REG
• DPORT_PERIP_CLK_EN_REG
• DPORT_PERIP_RST_EN_REG
• DPORT_WIFI_CLK_EN_REG
• DPORT_WIFI_RST_EN_REG
Notice:
• Reset registers cannot be cleared by hardware. Therefore, SW reset clear is required after setting the reset
registers.
• ESP32 features low power consumption. This is why some peripheral clocks are gated (disabled) by
default. Before using any of these peripherals, it is mandatory to enable the clock for the given periph-
eral by setting the corresponding CLK_EN bit to 1, and release the peripheral from reset state to make it
operational by setting the RST_EN bit to 0.
5.5 Registers
The addresses in parenthesis besides register names are the register addresses relative to the DPORT base
address provided in Table 1-6 Peripheral Address Mapping in Chapter 1 System and Memory. The absolute
register addresses are listed in Section 5.4 Register Summary.
AP
EM
_R
OT
BO
O_
R
d)
_P
ve
RT
r
se
O
(re
DP
31 1 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 0 Reset
AP
EM
R
T_
OO
_B
PP
)
ed
_A
rv
RT
se
O
(re
DP
31 1 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 0 Reset
S
_E SH
PE E S
AE
T_ RI_ _R
OR PE _EN
DP RT_ ERI
)
ed
O P
DP RT_
rv
se
O
(re
DP
31 3 2 1 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 0 0 Reset
DPORT_PERI_EN_RSA Set the bit to enable the clock of RSA module. Clear the bit to disable the
clock of RSA module. (R/W)
DPORT_PERI_EN_SHA Set the bit to enable the clock of SHA module. Clear the bit to disable the
clock of SHA module. (R/W)
DPORT_PERI_EN_AES Set the bit to enable the clock of AES module. Clear the bit to disable the
clock of AES module. (R/W)
ST HA
RI ST_ A
ES
PE R RS
_A
_R S
T_ RI_ T_
OR PE _RS
DP RT_ ERI
d)
O P
ve
DP RT_
r
se
O
(re
DP
31 3 2 1 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 0 0 Reset
DPORT_PERI_RST_RSA Set the bit to reset RSA module. Clear the bit to release RSA module. (R/W)
DPORT_PERI_RST_SHA Set the bit to reset SHA module. Clear the bit to release SHA module. (R/W)
DPORT_PERI_RST_AES Set the bit to reset AES module. Clear the bit to release AES module. (R/W)
NG
I
E TT
ES
R
U_
CP
PP
)
ed
A
T_
rv
OR
se
(re
DP
31 1 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 1 Reset
DPORT_APPCPU_RESETTING Set to 1 to reset APP_CPU. Clear the bit to release APP_CPU. (R/W)
N
E _E
AT
KG
CL
U_
CP
PP
d)
_A
ve
RT
r
se
O
(re
DP
31 1 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 0 Reset
DPORT_APPCPU_CLKGATE_EN Set to 1 to enable the clock of APP_CPU. Clear the bit to disable
the clock of APP_CPU. (R/W)
ALL
ST
RUN
U_
CP
PP
d)
_A
ve
RT
r
se
O
(re
DP
31 1 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 0 Reset
DPORT_APPCPU_RUNSTALL Set to 1 to put APP_CPU into stalled state. Clear the bit to release
APP_CPU from stalled state. (R/W)
31 0
0x000000000 Reset
L
SE
D_
IO
ER
P UP
_C
PU
)
ed
C
T_
rv
OR
se
(re
DP
31 2 1 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 0 Reset
DPORT_CPU_CPUPERIOD_SEL Select CPU clock. Refer to Table 3-3 for details. (R/W)
EN H_ NE
LE A
NA
E_ US DO
AB EN
_E
CH FL H_
M
CA E_ US
LE LIT
RA
O_ CH FL
NG SP
L
_I
_H
PR CA E_
SI _
M
O_ AM
T_ O_ CH
RA
PR DR
OR PR CA
_D
T_ O_
DP T_ O_
RO
OR PR
OR PR
)
)
ed
ed
ed
ed
P
T_
DP RT_
DP T_
rv
rv
rv
rv
OR
OR
se
se
se
se
O
(re
(re
(re
(re
DP
DP
DP
31 17 16 15 12 11 10 9 6 5 4 3 2 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 1 0 0 0 0 Reset
DPORT_PRO_DRAM_HL Determines the virtual address mode of the external SRAM. (R/W)
DPORT_PRO_DRAM_SPLIT Determines the virtual address mode of the external SRAM. (R/W)
O_ CH M K_ OM M
PR CA E_ S R A
CA E_ AS DR 0
T_ O_ CH MA _D DR
E_ AS IRO 1
M K_ M0
R
0
CH M K_ AM
IR 1
CL
K_ AM
AM
OR PR CA E_ ASK PS
A_
AS IR
DP RT_ RO_ ACH _M K_O
PD _I
U_ U
O P C E AS
M MM
O P C E
O_ CH
O P C
T_ O_
DP T_ O_
OR PR
OR PR
d)
)
ed
ve
DP RT_
DP RT_
rv
r
se
se
O
O
(re
(re
DP
DP
31 14 13 12 11 6 5 4 3 2 1 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 1 1 1 1 1 1 Reset
EN H_ NE
LE A
NA
E_ US DO
AB EN
_E
CH FL H_
M
CA E_ US
LE LIT
RA
P_ CH FL
NG SP
L
_I
_H
AP CA E_
SI _
AM
P_ AM
T_ P_ CH
rv _DR
AP DR
OR AP CA
T_ _
DP T_ P_
P
P
(re _AP
OR AP
OR AP
)
OR )
)
ed
ed
ed
e
DP T_
DP T_
rv
rv
rv
T
OR
OR
se
se
se
se
(re
(re
(re
DP
DP
DP
31 15 14 13 12 11 10 9 6 5 4 3 2 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 1 0 0 0 0 Reset
DPORT_APP_DRAM_HL Determines the virtual address mode of the External SRAM. (R/W)
DPORT_APP_DRAM_SPLIT Determines the virtual address mode of the External SRAM. (R/W)
AP CA E_ SK RO AM
CA E_ S R 0
T_ P_ CH MA _D DR
E_ AS IRO 1
M K_ M0
R
0
P_ CH MA _D M
CH M K_ AM
IR 1
CL
K_ AM
AM
OR AP CA E_ SK PS
A_
AS IR
DP RT_ PP_ CH MA K_O
PD _I
U_ U
O A CA E_ S
M MM
DP RT_ PP_ CH MA
CM E_
O A CA E_
P_ CH
DP RT_ PP_ CH
AP CA
O A CA
T_ P_
DP RT_ PP_
OR AP
d)
)
ed
O A
ve
DP RT_
DP RT_
rv
r
se
se
O
O
(re
(re
DP
DP
31 14 13 12 11 6 5 4 3 2 1 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 1 1 1 1 1 1 Reset
E
OD
_M
UX
M
E_
CH
CA
)
ed
T_
rv
OR
se
(re
DP
31 2 1 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 0 Reset
DPORT_CACHE_MUX_MODE The mode of the two caches sharing the memory. (R/W)
E
OD
_M
GE
ed _PA
U
M
)
(re _IM
)
ed
rv
rv
T
OR
se
se
(re
DP
31 3 2 1 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 0 Reset
DPORT_IMMU_PAGE_MODE Page size in the MMU for the internal SRAM 0. (R/W)
E
OD
_M
GE
PA
U_
M
(re _DM
)
)
ed
ed
rv
rv
T
OR
se
se
(re
DP
31 3 2 1 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 0 Reset
DPORT_DMMU_PAGE_MODE Page size in the MMU for the internal SRAM 2. (R/W)
31 0
0xFFFFFFFF Reset
1
T_
RAN
_G
SS
E
CC
_A
HB
)
ed
A
T_
rv
OR
se
(re
DP
31 9 8 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x1FF Reset
DP T_ NT LK N EN
DP RT_ HCI RO EN K_E
DP RT_ S1_ A_ EN EN
OR PC _C _E LK_
se I2 1_ E EN
O TW 1_ EN EN
O TI C K_ EN
O I2 DM K_ _
O U RG K_ L
DP RT_ ME CL 1_C
DP RT_ I_ CL CLK
DP RT_ ME LK_ EN
DP RT_ I3_ CL K_
DP RT_ DC CLK _C
DP RT_ I2 T0_ EN
K_ N
DP RT_ C_ LK_ EN
EN
DP RT_ HCI LK_ N
DP RT_ MT_ LK N
) CL EN
DP RT_ WM T1_ N
EN
DP rve S0 CLK N
DP RT_ US RO N
O d _CL _E
OR I2 0_ EN
O TI E_ UP
O LE 1_ UP
O P CL CL
O U C _E
O R _C _E
O SP 0_ CL
O SP EX K_
O SP 2_ _
O UA _C C
O P EX E
O I2 _C _
O EF RG E
K_
ed 1_ _
DP RT_ RT EM
DP RT_ AI CLK
DP T_ C_ CL
rv I0 LK
O UA _M
se SP _C
DP T_ RT
(re RT_ RT
OR UA
O UA
d)
se d)
DP RT_ )
DP RT_ )
O d
ve
(re rve
DP rve
r
se
se
(re
(re
31 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
11111 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 0 1 1 1 1 Reset
Set the following bit to enable the clock of the corresponding module. Clear the bit to disable the
clock of the corresponding module.
ST
ST
DP RT_ ME RS 1_R
DP RT_ I_ RS RST
DP RT_ DC RST _R
(re RT_ RT ST ST
DP RT_ WM T T
DP RT_ I3_ RS T
O P RS RS
O TI E_ UP
P
O SP 0_ RS
O SP 2_ _
O UA _R R
U
O U RG T
O I2 DM T
O TI R T
O SP EX T
DP RT_ RT EM
DP rve S0 RST
DP T_ AI ST
DP RT_ I2 T0_
DP RT_ S1_ A_
T
DP RT_ MT_ ST
DP T_ NT ST
DP RT_ WM T1_
DP RT_ US RO
DP RT_ HCI RO
DP RT_ C_ RS
rv I0 ST
DP RT_ C_ ST
T
DP RT_ ME ST
DP T_ CI T
) RS
O d _RS
OR TW 1_R
OR UH RS
O UA _M
R
OR PC _R
se SP _R
O I2 0_
O EF RG
O I2 _R
se I2 1_
O P EX
O LE _
ed 1_
_
1
DP T_ RT
(re RT_ RT
OR UA
O UA
)
se d)
DP RT_ )
DP RT_ )
ed
O d
R
(re rve
DP rve
rv
se
se
O
(re
(re
31 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
00000 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 Reset
Set each bit to reset the corresponding module. Clear the bit to release the corresponding module. For the list
of modules, please refer to register 5.19.
N
_E
T_
E
OS
IO EN
AV
_H
SL
SD C_
IO
K_ A
CL EM
SD
I_ _
K_
IF K
W CL
CL
T_ FI_
I_
IF
)
)
OR WI
W
ed
ed
ed
DP RT_
T_
rv
rv
rv
OR
se
se
se
O
(re
(re
(re
DP
DP
31 15 14 13 12 5 4 3 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 Reset
DPORT_WIFI_CLK_EMAC_EN Set the bit to enable the clock of Ethernet MAC module. Clear the bit
to disable the clock of Ethernet MAC module. (R/W)
DPORT_WIFI_CLK_SDIO_HOST_EN Set the bit to enable the clock of SD/MMC module. Clear the
bit to disable the clock of SD/MMC module. (R/W)
DPORT_WIFI_CLK_SDIOSLAVE_EN Set the bit to enable the clock of SDIO module. Clear the bit to
disable the clock of SDIO module. (R/W)
T
ST RS
_R T_
T_ IO ST
IO OS
OR SD _R
SD _H
DP T_ AC
OR EM
d)
)
ed
ve
DP RT_
rv
r
se
se
O
(re
(re
DP
31 8 7 6 5 4 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 0 Reset
DPORT_EMAC_RST Set the bit to reset Ethernet MAC module. Clear the bit to release Ethernet MAC
module. (R/W)
DPORT_SDIO_HOST_RST Set the bit to reset SD/MMC module. Clear the bit to release SD/MMC
module. (R/W)
DPORT_SDIO_RST Set the bit to reset SDIO module. Clear the bit to release SDIO module. (R/W)
n
PU_
_C
M
RO
_F
TR
IN
U_
P
)
ed
_C
rv
RT
se
O
(re
DP
31 1 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 0 Reset
31 0
0x000000000 Reset
31 0
0x000000000 Reset
AP
M
*_
O_
PR
d)
ve
T_
r
OR
se
(re
DP
31 5 4 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 10000 Reset
AP
_M
_*
PP
d)
A
ve
T_
r
OR
se
(re
DP
31 5 4 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 10000 Reset
IG
NF
CO
T_
AN
GR
S_
ES
C
AC
*_
E_
T
LI
HB
)
ed
A
T_
rv
OR
se
(re
DP
31 6 5 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 0 Reset
I
ve
T_
r
OR
se
(re
DP
31 7 6 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 0000000 Reset
DPORT_IMMU_TABLEn MMU for internal SRAM. When n is 0 ~ 9, the reset value is 0. When n is 10
~ 15, the reset value is 10, 11, 12, 13, 14, 15, respectively. (R/W)
En
BL
TA
U_
M
M
d)
D
ve
T_
r
OR
se
(re
DP
31 7 6 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 0000000 Reset
DPORT_DMMU_TABLEn MMU for internal SRAM. When n is 0 ~ 15, the reset value is 0 ~ 15, respec-
tively. (R/W)
EL
L
EL
E
_S
_S
_S
AN
AN
AN
CH
CH
CH
A_
A_
A_
M
M
DM
_D
_D
I1_
I2
I3
P
P
_S
_S
_S
PI
PI
PI
)
ed
S
T_
T_
T_
rv
OR
OR
OR
se
(re
DP
DP
DP
31 6 5 4 3 2 1 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 0 Reset
6.1 Overview
Direct Memory Access (DMA) is used for high-speed data transfer between peripherals and memory, as well as
from memory to memory. Data can be quickly moved with DMA without any CPU intervention, thus allowing for
more efficient use of the cores when processing data.
In the ESP32, 13 peripherals are capable of using DMA for data transfer, namely, UART0, UART1, UART2, SPI1,
SPI2, SPI3, I2S0, I2S1, SDIO slave, SD/MMC host, EMAC, BT, and Wi-Fi.
6.2 Features
The DMA controllers in the ESP32 feature:
Each DMA controller features different functions. However, the architecture of the DMA engine (DMA_ENGINE)
is the same in all DMA controllers.
The DMA Engine accesses SRAM over the AHB BUS. In Figure 6-1, the RAM represents the internal SRAM banks
available on ESP32. Further details on the SRAM addressing range can be found in Chapter System and Memory.
Software can use a DMA Engine by assigning a linked list to define the DMA operational parameters.
The DMA Engine transmits the data from the RAM to a peripheral, according to the contents of the out_link
descriptor. Also, the DMA Engine stores the data received from a peripheral into a specified RAM location,
according to the contents of the in_link descriptor.
The DMA descriptor’s linked lists (out_link and in_link) have the same structure. As shown in Figure 6-2, a
linked-list descriptor consists of three words. The meaning of each field is as follows:
• owner (DW0) [31]: The allowed operator of the buffer corresponding to the current linked list.
1’b0: the allowed operator is the CPU;
1’b1: the allowed operator is the DMA controller.
• length (DW0) [23:12]: The number of valid bytes in the buffer corresponding to the current linked list. The
field value indicates the number of bytes to be transferred to/from the buffer denoted by word DW1.
• size (DW0) [11:0]: The size of the buffer corresponding to the current linked list.
NOTE: The size must be word-aligned.
• buffer address pointer (DW1): Buffer address pointer. This is the address of the data buffer.
NOTE: The buffer address must be word-aligned.
• next descriptor address (DW2): The address pointer of the next linked-list item. The value is 0, if the
current linked-list item is the last on the list (eof=1).
When receiving data, if the data transfer length is smaller than the specified buffer size, DMA will not use
the remaining space. This enables the DMA engine to be used for transferring an arbitrary number of data
bytes.
Figure 6-3 shows the data transfer in UDMA mode. Before the DMA Engine receives data, software must initialize
the receive-linked-list. UHCI_INLINK_ADDR is used to point to the first in_link descriptor. The register must be
programmed with the lower 20 bits of the address of the initial linked-list item. After UHCI_INLINK_START is
set, the Universal Host Controller Interface (UHCI) will transmit the data received by UART to the Decoder. After
being parsed, the data will be stored in the RAM as specified by the receive-linked-list descriptor.
Before DMA transmits data, software must initialize the transmit-linked-list and the data to be transferred. UHCI_
OUTLINK_ADDR is used to point to the first out_link descriptor. The register must be programmed with the lower
20 bits of the address of the initial transmit-linked-list item. After UHCI_OUTLINK_START is set, the DMA Engine
will read data from the RAM location specified by the linked-list descriptor and then transfer the data through
the Encoder. The DMA Engine will then shift the data out serially through the UART transmitter.
The UART DMA follows a format of (separator + data + separator). The Encoder is used for adding separa-
tors before and after data, as well as using special-character sequences to replace data that are the same
as separators. The Decoder is used for removing separators before and after data, as well as replacing the
special-character sequences with separators. There can be multiple consecutive separators marking the be-
ginning or end of data. These separators can be configured through UHCI_SEPER_CH, with the default val-
ues being 0xC0. Data that are the same as separators can be replaced with UHCI_ESC_SEQ0_CHAR0 (0xDB
by default) and UHCI_ESC_SEQ0_CHAR1 (0xDD by default). After the transmission process is complete, a
UHCI_OUT_TOTAL_EOF_INT interrupt will be generated. After the reception procedure is complete, a UHCI_IN_
SUC_EOF_INT interrupt will be generated.
Note:
Please note that the buffer address pointer field in in_link descriptors should be word-aligned, and the size field in the
last in_link descriptor should be at least 4 bytes larger than the length of received data.
ESP32 SPI modules can use DMA as well as the CPU for data exchange with peripherals. As can be seen from
Figure 6-4, two DMA channels are shared by SPI1, SPI2 and SPI3 controllers. Each DMA channel can be used
by any one SPI controller at any given time.
The ESP32 SPI DMA Engine also uses a linked list to receive/transmit data. Burst transmission is supported. The
data size for a single transfer must be four bytes aligned. Consecutive data transfer is also supported.
I2S_OUTLINK_START bit in I2S_OUT_LINK_REG and I2S_INLINK_START bit in I2S_IN_LINK_REG are used for en-
abling the DMA Engine and are self-cleared by hardware. When I2S_OUTLINK_START is set to 1, the DMA Engine
starts processing the outbound linked-list descriptor and gets prepared to send data. When I2S_INLINK_START
is set to 1, the DMA Engine starts processing the inbound linked-list descriptor and gets prepared to receive
data.
4. In I2S master mode, set I2S_TX_START bit or I2S_RX_START bit to initiate an I2S operation;
In I2S slave mode, set I2S_TX_START bit or I2S_RX_START bit and wait for data transfer to be initiated by
the host device.
For more information on I2S DMA interrupts, please see Section DMA Interrupts, in Chapter I2S.
7.1 Overview
As Figure 7-1 shows, ESP32 integrates four SPI controllers which can be used to communicate with external
devices that use the SPI protocol. Controller SPI0 is used as a buffer for accessing external memory. Controller
SPI1 can be used as a master. Controllers SPI2 and SPI3 can be configured as either a master or a slave. When
used as a master, each SPI controller can drive multiple CS signals (CS0~CS2) to activate multiple slaves.
Controllers SPI1~SPI3 share two DMA channels.
The SPI signal buses consist of D, Q, CS0-CS2, CLK, WP, and HD signals, as Table 7-1 shows. Controllers SPI0
and SPI1 share one signal bus through an arbiter; the signals of the shared bus start with “SPI”. Controllers SPI2
and SPI3 use signal buses starting with “HSPI” and “VSPI” respectively. The I/O lines included in the above-
mentioned signal buses can be mapped to pins via either the IO_MUX module or the GPIO matrix. (Please refer
to Chapter IO_MUX for details.)
The SPI controller supports four-line full-duplex/half-duplex communication (MOSI, MISO, CS, and CLK lines)
and three-line half-duplex-only communication (DATA, CS, and CLK lines) in GP-SPI mode. In QSPI mode, an
SPI controller accesses the flash or SRAM by using signal buses D, Q, CS0~CS2, CLK, WP, and HD as a four-bit
parallel SPI bus. The mapping between SPI bus signals and pin function signals under different communication
modes is shown in Table 7-1.
Table 7-1. Mapping Between SPI Bus Signals and Pin Function Signals
• Programmable clock
Parallel QSPI
• SPI interrupts
7.3 GP-SPI
The SPI master mode supports four-line full-duplex/half-duplex communication and three-line half-duplex com-
munication. Figure 7-2 outlines the connections needed for four-line full-duplex/half-duplex communications.
The SPI1~SPI3 controllers can communicate with other slaves as a standard SPI master. SPI2 and SPI3 can be
configured as either a master or a slave. Every SPI master can be connected to three slaves at most by default.
When not using DMA, the maximum length of data received/sent in one burst is 64 bytes. The data length is in
multiples of one byte.
Command Description
0x1 Received by slave; writes data sent by the master into the slave status register via MOSI.
0x2 Received by slave; writes data sent by the master into the slave data buffer via MOSI.
0x3 Sent by slave; sends data in the slave buffer to master via MISO.
0x4 Sent by slave; sends data in the slave status register to master via MISO.
Writes master data on MOSI into data buffer and then sends the date in the slave data buffer
0x6
to MISO.
4. received and/or sent data: length of 0~512 bits (64 bytes); Master Out Slave In (MOSI) or Master In Slave
Out (MISO).
The address length is up to 32 bits in GP-SPI master mode and 64 bits in QSPI master mode. The command
phase, address phase, dummy phase and received/sent data phase are controlled by bits SPI_USR_COMMAND,
SPI_USR_ADDR, SPI_USR_DUMMY, and SPI_USR_MISO/SPI_USR_MOSI respectively in register SPI_USER_REG.
A certain phase is enabled only when its corresponding control bit is set to 1. Details can be found in register
description. When SPI works as a master, the register can be configured by software as required to determine
whether or not to enable a certain phase.
When SPI works as a slave, the communication format must contain command, address, received and/or sent
data, among which the command has several options listed in Table 7-2. During data transmission or reception,
the CS signal should keep logic level low. If the CS signal is pulled up during transmission, the internal state of
the slave will be reset.
The master can write the slave status register SPI_SLV_WR_STATUS_REG, and decide whether to read data from
register SPI_SLV_WR_STATUS_REG or register SPI_RD_STATUS_REG via the SPI_SLV_STATUS_READBACK bit in
register SPI_SLAVE1_REG. The SPI master can maintain communication with the slave by reading and writing
slave status register, thus realizing complex communication with ease.
The length of received and sent data is controlled by SPI_MISO_DLEN_REG and SPI_MOSI_DLEN_REG in master
mode, as well as SPI_SLV_RDBUF_DLEN_REG and SPI_SLV_WRBUF_DLEN_REG in slave mode. A reception or
transmission of data is controlled by bit SPI_USR_MOSI or SPI_USR_MISO in SPI_USER_REG. The SPI_USR bit
in register SPI_CMD_REG needs to be configured to initialize a data transfer.
Note:
• In half-duplex communication, the order of command, address, received and/or sent data in the communication
format should be followed strictly.
• In half-duplex communication, communication formats ”command + address + received data + sent data” and
”received data + sent data” are not applicable to DMA.
• When ESP32 SPI acts as a slave, the master CS should be active at least one SPI clock period before a read/write
process is initiated, and should be inactive at least one SPI clock period after the read/write process is com-
pleted.
ESP32 SPI has 16 × 32 bits of data buffer to buffer data-send and data-receive operations. As is shown in Figure
7-3, received data is written from the low byte of SPI_W0_REG by default and the writing ends with SPI_W15_REG.
If the data length is over 64 bytes, the extra part will be written from SPI_W0_REG.
Data buffer blocks SPI_W0_REG ~ SPI_W7_REG and SPI_W8_REG ~ SPI_W15_REG data correspond to the
lower part and the higher part respectively. They can be used separately, and are controlled by the SPI_USR_MOSI
_HIGHPART bit and the SPI_USR_MISO_HIGHPART bit in register SPI_USER_REG. For example, if SPI is config-
ured as a master, when SPI_USR_MOSI_HIGHPART = 1, SPI_W8_REG ~ SPI_W15_REG are used as buffer for
sending data; when SPI_USR_MISO_HIGHPART = 1, SPI_W8_REG ~ SPI_W15_REG are used as buffer for re-
ceiving data. If SPI acts as a slave, when SPI_USR_MOSI_HIGHPART = 1, SPI_W8_REG ~ SPI_W15_REG are
used as buffer for receiving data; when SPI_USR_MISO_HIGHPART = 1, SPI_W8_REG ~ SPI_W15_REG are used
as buffer for sending data.
Table 7-3. Clock Polarity and Phase, and Corresponding SPI Register Values for SPI Master
fapb
fspi =
(SPI_CLKCNT_N+1)(SPI_CLKDIV_PRE+1)
SPI_CLKCNT_N and SPI_CLKDIV_PRE are two bits of register SPI_CLOCK_REG (Please refer to 7.7 Register De-
scription for details). SPI_CLKCNT_H = ⌊ SPI_CLKCNT_N+1
2 –1⌋, SPI_CLKCNT_N=SPI_CLKCNT_L. When the SPI_CLK_EQU_SYSCLK
bit in register SPI_CLOCK_REG is set to 1, and the other bits are set to 0, SPI output clock frequency is
fapb . For other clock frequencies, SPI_CLK_EQU_SYSCLK needs to be 0. In slave mode, SPI_CLKCNT_N,
SPI_CLKCNT_L, SPI_CLKCNT_H and SPI_CLKDIV_PRE should all be 0.
Table 7-4. Clock Polarity and Phase, and Corresponding SPI Register Values for SPI Slave
1. mode0 means CPOL=0, CPHA=0. When SPI is idle, the clock output is logic low; data changes on the
falling edge of the SPI clock and is sampled on the rising edge;
2. mode1 means CPOL=0, CPHA=1. When SPI is idle, the clock output is logic low; data changes on the
rising edge of the SPI clock and is sampled on the falling edge;
Espressif Systems 131 ESP32 TRM (Version 5.2)
Submit Documentation Feedback
7 SPI Controller (SPI)
3. mode2 means when CPOL=1, CPHA=0. When SPI is idle, the clock output is logic high; data changes on
the rising edge of the SPI clock and is sampled on the falling edge;
4. mode3 means when CPOL=1, CPHA=1. When SPI is idle, the clock output is logic high; data changes on
the falling edge of the SPI clock and is sampled on the rising edge.
When GP-SPI is used as master and the data signals are not received by the SPI controller via GPIO matrix, if GP-
SPI output clock frequency is clkapb /2, register SPI_MISO_DELAY_MODE should be set to 0 when configuring
the clock polarity. If GP-SPI output clock frequency is not higher than clkapb /4, register SPI_MISO_DELAY_MODE
can be set to the corresponding value in Table 7-3 when configuring the clock polarity.
When GP-SPI is used in master mode and the data signals enter the SPI controller via the GPIO matrix:
1. If GP-SPI output clock frequency is clkapb /2, register SPI_MISO_DELAY_MODE should be set to 0 and the
dummy phase should be enabled (SPI_USR_DUMMY = 1) for one clkspi clock cycle (SPI_USR_DUMMY_CYC
LELEN = 0) when configuring the clock polarity;
2. If GP-SPI output clock frequency is clkapb /4, register SPI_MISO_DELAY_MODE should be set to 0 when
configuring the clock polarity;
3. If GP-SPI output clock frequency is not higher than clkapb /8, register SPI_MISO_DELAY_MODE can be set
to the corresponding value in Table 7-3 when configuring the clock polarity.
When GP-SPI is used in slave mode, the clock signal and the data signals should be routed to the SPI controller
via the same path, i.e., neither the clock signal nor the data signals passes through GPIO matrix, or both of
them pass through GPIO matrix. This is important in ensuring that the signals are not delayed by different time
periods before they reach the SPI hardware.
Assume that tspi , tpre and tv in Figure 7-4 denote SPI clock period, how far ahead data output is, and data output
delay time, respectively. Assume the SPI slave’s main clock period is tapb . For non-DMA mode0, SPI slave data
output is delayed by tv :
• tv < 3.5 ∗ tapb , if CLK does not pass through GPIO matrix;
In DMA mode1 and mode3, SPI slave data output is delayed by the same period of time as in non-DMA mode.
However, for mode0 and mode2, SPI slave data is output earlier by tpre :
• tpre < (tspi /2 − 5.5 ∗ tapb ), if CLK does not pass through GPIO matrix;
• tpre < (tspi /2 − 7.5 ∗ tapb ), if CLK passes through GPIO matrix.
To conclude, if signals do not pass through GPIO matrix, the SPI slave clock frequency is up to fapb /8; if signals
pass through GPIO matrix, the SPI slave clock frequency is up to fapb /12. Note that (tspi /2–tpre ) represents data
output hold time for SPI slave in mode0 and mode2.
SPI1, SPI2 and SPI3 controllers can also be configured as QSPI master to connect to external memory. The
maximum output clock frequency of the SPI memory interface is fapb , with the same clock configuration as that
of the GP-SPI master.
ESP32 QSPI supports flash-read operation in one-line, two-line, and four-line modes. When working as a QSPI
master, the command phase, address phase, dummy phase and data phase can be configured as needed, as
flexible as in GP-SPI mode.
Note that GPI-SPI full-duplex mode does not support dummy phase.
ESP32 SPI reckons the completion of send- and/or receive-operations as the completion of one operation from
the controller and generates one interrupt. When ESP32 SPI is configured to slave mode, the slave will generate
read/write status registers and read/write buffer data interrupts according to different operations.
• SPI_OUT_DONE_INT: Triggered when the last linked list item has zero length.
• SPI_IN_DONE_INT: Triggered when the last received linked list had a length of 0.
7.8 Registers
The addresses in parenthesis besides register names are the register addresses relative to the SPI0/SPI1/SPI2/SPI3
base addresses provided in Table 1-6 Peripheral Address Mapping in Chapter 1 System and Memory. The ab-
solute register addresses are listed in Section 7.7 Register Summary.
)
ed
ed
R
US
rv
rv
se
se
I_
(re
(re
SP
31 19 18 17 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 0 Reset
SPI_USR An SPI operation will be triggered when this bit is set. The bit will be cleared once the
operation is done. (R/W)
31 0
0x000000000 Reset
SPI_ADDR_REG It stores the transmitting address when master is in half-duplex mode or QSPI mode.
If the address length is bigger than 32 bits, this register stores the higher 32 bits of address value,
SPI_SLV_WR_STATUS_REG stores the rest lower part of address value. If the address length is
smaller than 33 bits, this register stores all the address value. The register is in valid only when
SPI_USR_ADDR bit is set to 1. (R/W)
I_ EA OR R
se EA IO R
E
SP FR IT_ DE
(re FR D_Q DE
OD
AD
_M L
RD A
I_ d DIO
I_ _B OR
ST DU
QU
SP RD IT_
SP rve D_
D_
FA D_
)
SP WP )
d)
I_ _B
EA
I_ EA
ed
ed
ve
SP WR
FR
SP FR
rv
rv
r
se
se
se
I_
I_
I_
(re
(re
(re
SP
SP
31 27 26 25 24 23 22 21 20 19 15 14 13 12 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Reset
SPI_WR_BIT_ORDER This bit determines the bit order for command, address and data in transmitted
signal. 1: sends LSB first; 0: sends MSB first. (R/W)
SPI_RD_BIT_ORDER This bit determines the bit order for received data in received signal. 1: re-
ceives LSB first; 0: receives MSB first. (R/W)
SPI_FREAD_QIO This bit is used to enable four-line address writes and data reads in QSPI mode.
(R/W)
SPI_FREAD_DIO This bit is used to enable two-line address writes and data reads in QSPI mode.
(R/W)
SPI_WP This bit determines the write-protection signal output when SPI is idle in QSPI mode. 1:
output high; 0: output low. (R/W)
SPI_FREAD_QUAD This bit is used to enable four-line data reads in QSPI mode. (R/W)
SPI_FREAD_DUAL This bit is used to enable two-line data reads in QSPI mode. (R/W)
SPI_FASTRD_MODE Reserved.
)
ed
S_
rv
_C
se
I
(re
SP
31 28 27 0
0x05 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 Reset
SPI_CS_HOLD_DELAY Reserved.
XT
_E
US
US
AT
AT
ST
ST
I_
I_
SP
SP
31 24 23 16 15 0
SPI_STATUS_EXT Reserved.
SPI_STATUS Reserved.
E
OD
M
OD
UM
E
NU
OD
UM
_M
_N
Y_
Y_
_M
AY
AY
_N
E
LA
LA
M
EL
EL
AY
AY
M
DE
DE
TI
I
D
D
EL
EL
_T
P_
I_
I_
O_
O_
LD
_D
_D
TU
OS
OS
ed
d
IS
IS
HO
CS
CS
SE
ve
M
_M
rv
r
I_
I_
I_
I_
I_
I_
I_
se
se
I
SP
SP
SP
SP
SP
SP
SP
SP
re
re
31 28 27 26 25 23 22 21 20 18 17 16 15 12 11 8 7 4 3 0
0x00 0x0 0x0 0x0 0x0 0x0 0x00 0x00 0x01 0x01 Reset
SPI_CS_DELAY_NUM Reserved.
SPI_CS_DELAY_MODE Reserved.
SPI_MOSI_DELAY_NUM It is used to configure the number of system clock cycles by which the
MOSI signals are delayed. (R/W)
SPI_MOSI_DELAY_MODE This register field determines the way the MOSI signals are delayed by
SPI clock. (R/W)
After being delayed by SPI_MOSI_DELAY_NUM system clocks, the MOSI signals will then be
delayed by the configuration of SPI_MOSI_DELAY_MODE, specifically:
0: no delay.
1: if SPI_CK_OUT_EDGE or SPI_CK_I_EDGE is set, the MOSI signals are delayed by half a cycle,
otherwise they are delayed by one cycle.
2: if SPI_CK_OUT_EDGE or SPI_CK_I_EDGE is set, the MOSI signals are delayed by one cycle,
otherwise they are delayed by half a cycle.
3: the MOSI signals are delayed one cycle.
SPI_MISO_DELAY_NUM It is used to configure the number of system clock cycles by which the
MISO signals are delayed. (R/W)
SPI_MISO_DELAY_MODE This register field determines the way MISO signals are delayed by SPI
clock. (R/W)
After being delayed by SPI_MISO_DELAY_NUM system clock, the MISO signals will then be de-
layed by the configuration of SPI_MISO_DELAY_MODE, specifically:
0: no delay.
1: if SPI_CK_OUT_EDGE or SPI_CK_I_EDGE is set, the MISO signals are delayed by half a cycle,
otherwise they are delayed by one cycle.
2: if SPI_CK_OUT_EDGE or SPI_CK_I_EDGE is set, the MISO signals are delayed by one cycle,
otherwise they are delayed by half a cycle.
3: the MISO signals are delayed by one cycle.
SPI_HOLD_TIME The number of SPI clock cycles by which CS pin signals are delayed. It is only
valid when SPI_CS_HOLD is set to 1. (R/W)
SPI_SETUP_TIME It is to configure the time between the CS signal active edge and the first SPI
clock edge. It is only valid in half-duplex mode or QSPI mode and when SPI_CS_SETUP is set
to 1. (R/W)
LK
SC
SY
E
PR
U_
_N
_H
_L
IV_
NT
NT
NT
EQ
KD
KC
KC
KC
K_
CL
CL
CL
CL
CL
I_
I_
I_
I_
I_
SP
SP
SP
SP
SP
31 30 18 17 12 11 6 5 0
SPI_CLK_EQU_SYSCLK In master mode, when this bit is set to 1, SPI output clock is equal to system
clock; when set to 0, SPI output clock is divided from system clock. In slave mode, it should be
set to 0. (R/W)
SPI_CLKDIV_PRE In master mode, it is used to configure the pre-divider value for SPI output clock.
It is only valid when SPI_CLK_EQU_SYSCLK is 0. In slave mode, it should be set to 0. (R/W)
SPI_CLKCNT_N In master mode, it is used to configure the divider for SPI output clock. It is only
valid when SPI_CLK_EQU_SYSCLK is 0. In slave mode, it should be set to 0. (R/W)
GH RT
RT
HI PA
PA
M I_H LE
d) OR R
R
O_ H
R_ OS Y_ID
E
I_ R_ DR ND
DE
IS IG
E_ D
I_ _S GE E
SP WR TE_ UAD
(re _B E_ L
YT OR
SP CS ED DG
SP US AD MA
SP US MIS MY
RD YT A
SP FW TE_ IO
SP FW TE_ IO
I_ R_ MM
I_ _B DU
_H UP
I_ R_ O
I_ R_ SI
I_ _I_ _E
I_ RI D
I_ RI Q
I_ RI Q
I_ R_ M
I_ R_ M
N
SP FW E_
SP US MO
SP US DU
SP US DU
SP US CO
SP CK UT
OL
CS ET
DI
US M
I_ RIT
)
UT
I_ _O
I_ R_
ed
ed
e
SP SIO
SP FW
DO
SP US
SP CK
rv
rv
rv
se
se
se
I_
I_
I_
I_
I_
(re
(re
SP
SP
SP
SP
31 30 29 28 27 26 25 24 23 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 Reset
SPI_USR_COMMAND This bit enables the command phase of an SPI operation in SPI half-duplex
mode and QSPI mode. (R/W)
SPI_USR_ADDR This bit enables the address phase of an SPI operation in SPI half-duplex mode
and QSPI mode. (R/W)
SPI_USR_DUMMY This bit enables the dummy phase of an SPI operation in SPI half-duplex mode
and QSPI mode. (R/W)
SPI_USR_MISO This bit enables the read-data phase of an SPI operation in SPI half-duplex mode
and QSPI mode. (R/W)
SPI_USR_MOSI This bit enables the write-data phase of an SPI operation in SPI half-duplex mode
and QSPI mode. (R/W)
SPI_USR_DUMMY_IDLE The SPI clock signal is disabled in the dummy phase when the bit is set in
SPI half-duplex mode and QSPI mode. (R/W)
SPI_USR_MOSI_HIGHPART If set, MOSI data is stored in SPI_W8 ~ SPI_W15 of the SPI buffer.
(R/W)
SPI_USR_MISO_HIGHPART If set, MISO data is stored in SPI_W8 ~ SPI_W15 of the SPI buffer.
(R/W)
SPI_FWRITE_QIO Reserved.
SPI_FWRITE_DIO Reserved.
SPI_FWRITE_QUAD Reserved.
SPI_FWRITE_DUAL Reserved.
SPI_WR_BYTE_ORDER This bit determines the byte order of the command, address and data in
transmitted signal. 1: big-endian; 0: little-endian. (R/W)
SPI_RD_BYTE_ORDER This bit determines the byte order of received data in transmitted signal. 1:
big-endian; 0: little_endian. (R/W)
SPI_CK_OUT_EDGE This bit, combined with SPI_MOSI_DELAY_MODE, sets the MOSI signal delay
mode. It is only valid in master mode. (R/W)
SPI_CK_I_EDGE In slave mode, the bit is the same as SPI_CK_OUT_EDGE in master mode. It is
combined with SPI_MISO_DELAY_MODE. It is only valid in slave mode. (R/W)
SPI_CS_SETUP Setting this bit enables a delay between CS active edge and the first clock edge,
in multiples of one SPI clock cycle. In full-duplex mode and QSPI mode, setting this bit results in
(SPI_SETUP_TIME + 1.5) SPI clock cycles delay. In full-duplex mode, there will be 1.5 SPI clock
cycles delay for mode0 and mode2, and 1 SPI clock cycle delay for mode1 and mode3. (R/W)
SPI_CS_HOLD Setting this bit enables a delay between the end of a transmission and CS being
inactive, as specified in SPI_HOLD_TIME. (R/W)
EN
EL
N
CL
LE
CY
IT
Y_
B
R_
M
UM
DD
D
A
)
R_
R_
ed
US
US
rv
se
I_
I_
(re
SP
SP
31 26 25 8 7 0
23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 Reset
SPI_USR_ADDR_BITLEN It indicates the bit length of the transmitted address minus one in half-
duplex mode and QSPI mode, in multiples of one bit. It is only valid when SPI_USR_ADDR is set
to 1. (RO)
SPI_USR_DUMMY_CYCLELEN It indicates the number of SPI clock cycles for the dummy phase
minus one in SPI half-duplex mode and QSPI mode. It is only valid when SPI_USR_DUMMY is
set to 1. (R/W)
E
LE
LU
IT
VA
B
D_
D_
AN
AN
M
M
M
M
CO
CO
)
R_
R_
ed
US
US
rv
se
I_
I_
(re
SP
SP
31 28 27 16 15 0
7 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 Reset
SPI_USR_COMMAND_BITLEN It indicates the bit length of the command phase minus one in SPI
half-duplex mode and QSPI mode. It is only valid when SPI_USR_COMMAND is set to 1. (R/W)
E N
TL
BI
_D
I
OS
M
)
R_
ed
US
rv
se
I_
(re
SP
31 24 23 0
0 0 0 0 0 0 0 0 0x0000000 Reset
SPI_USR_MOSI_DBITLEN It indicates the length of MOSI data minus one, in multiples of one bit. It
is only valid when SPI_USR_MOSI is set to 1 in master mode. (R/W)
R_
ed
US
rv
se
I_
(re
SP
31 24 23 0
0 0 0 0 0 0 0 0 0x0000000 Reset
SPI_USR_MISO_DBITLEN It indicates the length of MISO data minus one, in multiples of one bit. It
is only valid when SPI_USR_MISO is set to 1 in master mode. (R/W)
31 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 0 Reset
SPI_SLV_WR_STATUS_REG In the slave mode this register is the status register for the master to
write the slave. In the master mode, if the address length is bigger than 32 bits, SPI_ADDR_REG
stores the higher 32 bits of address value, and this register stores the rest lower part of address
value. (R/W)
OL
ED IVE
E L
GE
_P
_S
E_ T
DL AC
CS
CK
_I P_
R_
R_
SP CS DIS
S
CS IS
CK EE
DI
IS
TE
TE
I_ 1_D
I_ d)
SP ed)
(re _D
I_ 2_
0_
I_ _K
ed
ed
AS
AS
SP rve
SP CS
SP CS
CK
rv
rv
rv
M
M
se
se
se
se
I_
I_
I_
I_
(re
(re
(re
SP
SP
SP
31 30 29 28 14 13 11 10 9 8 6 5 4 3 2 1 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 1 1 0 Reset
SPI_CS_KEEP_ACTIVE This bit is only used in master mode where when it is set, the CS signal will
keep active. (R/W)
SPI_CK_IDLE_EDGE This bit is only used in master mode to configure the logicl level of SPI output
clock in idle state. (R/W)
1: the spi_clk line keeps high when idle;
0: the spi_clk line keeps low when idle.
SPI_MASTER_CK_SEL Reserved.
SPI_MASTER_CS_POL Reserved.
SPI_CK_DIS Reserved.
SPI_CS2_DIS This bit enables the SPI CS2 signal. 1: disables CS2; 0: enables CS2. (R/W)
SPI_CS1_DIS This bit enables the SPI CS1 signal. 1: disables CS1; 0: enables CS1. (R/W)
SPI_CS0_DIS This bit enables the SPI CS0 signal. 1: disables CS0; 0: enables CS0. (R/W)
D
D_ ST EN
FI EN
SP SLV R_ NE TEN
SP SLV R_ A_ TEN
_D NE
SP TRA D_ UF_ TEN
E
V_ _B D E
_B F_D E
ON
SL R A_ N
CM D F_
RD U ON
DE A_
NE
UF O
I_ _W ST DO
TE
I_ N BU I N
I_ _W O IN
I_ _W ST IN
V_ _R BU
I_ _R B I N
OM
TA
SP SLV R_ EN
SP SLV D_ A_
SP SLV D_ A_
SP SLV R_ DE
SP SLV E_M ET
SL R _
_
E
NT
_C
_S
I_ _W RD
I_ _R ST
I_ _R ST
I_ _W NT
I_ _W O
SP RA OD
I_ AV ES
ST
ST
_C
SP SLV S_I
SP SL _R
_M
LA
LA
NS
)
I_ NC
I_ N
ed
_I
V_
V_
RA
CS
rv
SP SY
SL
SL
I_T
I_T
se
I_
I_
I_
I_
(re
SP
SP
SP
SP
SP
SP
31 30 29 28 27 26 23 22 20 19 17 16 12 11 10 9 8 7 6 5 4 3 2 1 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 0 Reset
SPI_SYNC_RESET When set, it resets the latched values of the SPI clock line, CS line and data line.
(R/W)
SPI_SLAVE_MODE This bit is used to set the mode of the SPI device. (R/W)
1: slave mode;
0: master mode.
SPI_SLV_WR_RD_BUF_EN This bit is only used in slave half-duplex mode, where when it is set, the
write and read data commands are enabled. (R/W)
SPI_SLV_WR_RD_STA_EN This bit is only used in slave half-duplex mode, where when it is set, the
write and read status commands are enabled. (R/W)
SPI_SLV_CMD_DEFINE Reserved.
SPI_TRANS_CNT The counter for operations in both the master mode and the slave mode. (RO)
SPI_SLV_LAST_STATE In slave mode, this contains the state of the SPI state machine. (RO)
SPI_SLV_LAST_COMMAND Reserved.
SPI_CS_I_MODE Reserved.
SPI_TRANS_INTEN The interrupt enable bit for the SPI_TRANS_DONE_INT interrupt. (R/W)
SPI_SLV_WR_STA_INTEN The interrupt enable bit for the SPI_SLV_WR_STA_INT interrupt. (R/W)
SPI_SLV_RD_STA_INTEN The interrupt enable bit for the SPI_SLV_RD_STA_INT interrupt. (R/W)
SPI_SLV_WR_BUF_INTEN The interrupt enable bit for the SPI_SLV_WR_BUF_INT interrupt. (R/W)
SPI_SLV_RD_BUF_INTEN The interrupt enable bit for the SPI_SLV_RD_BUF_INT interrupt. (R/W)
SPI_TRANS_DONE The raw interrupt status bit for the SPI_TRANS_DONE_INT interrupt. It is set by
hardware and cleared by software. (R/W)
SPI_SLV_WR_STA_DONE The raw interrupt status bit for the SPI_SLV_WR_STA_INT interrupt. It is
set by hardware and cleared by software, and only applicable to slave half-duplex mode. (R/W)
SPI_SLV_RD_STA_DONE The raw interrupt status bit for the SPI_SLV_RD_STA_INT interrupt. It is set
by hardware and cleared by software, and only applicable to slave half-duplex mode. (R/W)
SPI_SLV_WR_BUF_DONE The raw interrupt status bit for the SPI_SLV_WR_BUF_INT interrupt. It is
set by hardware and cleared by software, and only applicable to slave half-duplex mode. (R/W)
SPI_SLV_RD_BUF_DONE The raw interrupt status bit for the SPI_SLV_RD_BUF_INT interrupt. It is
set by hardware and cleared by software, and only applicable to slave half-duplex mode. (R/W)
M N
EN
BU DU MY N
K
F_ M _EN
M _E
EN
AC
RD F_ M _E
N
EA EN
Y_
LE
DU MY
V_ BU U Y
N
TL
DB
SL R _D M
_R T_
LE
IT
BI
I_ _W TA UM
US AS
B
IT
R_
R_
_B
AT _F
SP SLV DS _D
DD
DD
US
ST S
I_ _R TA
V_ TU
A
A
AT
SP SLV RS
R_
D_
SL TA
ST
I_ _W
R
I_ _S
)
ed
V_
V_
V_
SP LV
SP SLV
rv
SL
SL
SL
S
se
I_
I_
I_
I_
I_
(re
SP
SP
SP
SP
SP
31 27 26 25 24 16 15 10 9 4 3 2 1 0
SPI_SLV_STATUS_BITLEN It is only used in slave half-duplex mode to configure the length of the
master writing into the status register. (R/W)
SPI_SLV_STATUS_FAST_EN Reserved.
SPI_SLV_STATUS_READBACK Reserved.
SPI_SLV_RD_ADDR_BITLEN It indicates the address length in bits minus one for a slave-read op-
eration. It is only valid in slave half-duplex mode. (R/W)
SPI_SLV_WR_ADDR_BITLEN It indicates the address length in bits minus one for a slave-write op-
eration. It is only valid in slave half-duplex mode. (R/W)
SPI_SLV_WRSTA_DUMMY_EN In slave mode, this bit enables the dummy phase for write-status
operations. It is only valid in slave half-duplex mode.(R/W)
SPI_SLV_RDSTA_DUMMY_EN In slave mode, this bit enables the dummy phase for read-status op-
erations. It is only valid in slave half-duplex mode. (R/W)
SPI_SLV_WRBUF_DUMMY_EN In slave mode, this bit enables the dummy phase for write-buffer
operations. It is only valid in slave half-duplex mode. (R/W)
SPI_SLV_RDBUF_DUMMY_EN In slave mode, this bit enables the dummy phase for read-buffer op-
erations. It is only valid in slave half-duplex mode. (R/W)
EN
EN
EN
LE
EL
EL
EL
E
CL
CL
CL
CL
CY
CY
CY
CY
Y_
Y_
Y_
Y_
M
M
UM
UM
M
DU
DU
D
_D
F_
F_
A_
TA
U
ST
RB
RS
DB
RD
W
W
R
V_
V_
V_
V_
SL
SL
SL
SL
I_
I_
I_
I_
SP
SP
SP
SP
31 24 23 16 15 8 7 0
SPI_SLV_WRBUF_DUMMY_CYCLELEN It indicates the number of SPI clock cycles minus one for the
dummy phase for write-data operations. It is only valid when SPI_SLV_WRBUF_DUMMY_EN is set
to 1 in slave half-duplex mode. (R/W)
SPI_SLV_RDBUF_DUMMY_CYCLELEN It indicates the number of SPI clock cycles minus one for the
dummy phase for read-data operations. It is only valid when SPI_SLV_RDBUF_DUMMY_EN is set
to 1 in slave half-duplex mode. (R/W)
E
E
LU
LU
LU
LU
VA
VA
VA
VA
D_
D_
D_
D_
M
M
CM
_C
_C
_C
A_
UF
UF
TA
ST
RB
RS
DB
RD
W
R
V_
V_
V_
V_
SL
SL
SL
SL
I_
I_
I_
I_
SP
SP
SP
SP
31 24 23 16 15 8 7 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 0 Reset
SPI_SLV_WRSTA_CMD_VALUE Reserved.
SPI_SLV_RDSTA_CMD_VALUE Reserved.
SPI_SLV_WRBUF_CMD_VALUE Reserved.
SPI_SLV_RDBUF_CMD_VALUE Reserved.
N
LE
BIT
_D
UF
RB
W
d)
V_
ve
SL
r
se
I_
(re
SP
31 24 23 0
0 0 0 0 0 0 0 0 0x0000000 Reset
SPI_SLV_WRBUF_DBITLEN It indicates the length of written data minus one, in multiples of one bit.
It is only valid in slave half-duplex mode. (R/W)
N
LE
T
BI
_D
UF
DB
R
)
ed
V_
rv
SL
se
I_
(re
SP
31 24 23 0
0 0 0 0 0 0 0 0 0x0000000 Reset
SPI_SLV_RDBUF_DBITLEN It indicates the length of read data minus one, in multiples of one bit. It
is only valid in slave half-duplex mode. (R/W)
V_
rv
SL
se
I_
(re
SP
31 24 23 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 0 Reset
SPI_SLV_RDATA_BIT It indicates the bit length of data the master reads from the slave, minus one.
It is only valid in slave half-duplex mode. (R/W)
31 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 0 Reset
31 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 0 Reset
SPI_TX_CRC_REG Reserved.
d)
ve
ST
r
se
I_
(re
SP
31 3 2 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 0 Reset
T_ CR_ ST _EN
E N
OD _E
F_ UR N
R T
EO B _E
M ST
P
I_ d _S P
SP OU CR_ _BU
TO
(re DM TX IN
SP rve RX TO
I N RS _
I_ T_ IFO
I_ A_ NT
I_ BM ST
I_ S A
SP IND AT
SP DM CO
SP AH _R
SP OU _F
T
OU S
D
I_ BM
I_ A_
)
SP OU )
)
I_ T_
ed
ed
ed
SP DM
SP AH
rv
rv
rv
se
se
se
I_
I_
(re
(re
SP
SP
31 17 16 15 14 13 12 11 10 9 8 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 Reset
SPI_DMA_CONTINUE This bit enables SPI DMA continuous data TX/RX mode. (R/W)
SPI_DMA_TX_STOP When in continuous TX/RX mode, setting this bit stops sending data. (R/W)
SPI_DMA_RX_STOP When in continuous TX/RX mode, setting this bit stops receiving data. (R/W)
SPI_OUT_DATA_BURST_EN SPI DMA reads data from memory in burst mode. (R/W)
SPI_AHBM_FIFO_RST This bit is used to reset SPI DMA AHB master FIFO pointer. (R/W)
SPI_OUT_RST The bit is used to reset DMA out-FSM and out-data FIFO pointer. (R/W)
SPI_IN_RST The bit is used to reset DMA in-DSM and in-data FIFO pointer. (R/W)
ST T
DR
OP
K_ R
AD
OU IN E
I_ TL _R
K_
SP OU INK
IN
I_ d)
d)
I_ TL
TL
SP rve
ve
SP OU
OU
r
se
se
I_
(re
(re
SP
31 30 29 28 27 20 19 0
0 0 0 0 0 0 0 0 0 0 0 0 0x000000 Reset
ET
NK TA T
R
LI S AR
O_
_S RT
R
P
IN K_ T
DD
UT
I_ IN RES
TO
_A
_A
SP INL K_
NK
NK
I_ d)
)
I_ IN
ed
LI
LI
SP rve
SP INL
rv
IN
IN
se
se
I_
I_
(re
(re
SP
SP
31 30 29 28 27 21 20 19 0
0 0 0 0 0 0 0 0 0 0 0 0 0x000000 Reset
SPI_INLINK_AUTO_RET when the bit is set, inlink descriptor jumps to the next descriptor when a
packet is invalid. (R/W)
N
RX N
_E
A_ _E
DM TX
I_ A_
)
ed
SP DM
rv
se
I_
(re
SP
31 2 1 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 0 Reset
EN A
T_ N
PT R_ ENA
A
I N _E
Y_ INT
EM RO T_
A
R_ ER IN
SP IN_ C_ _IN NA EN
SC R_ R_
SP OU K_ INT T_E A
I_ TL DS _E NA
I_ SU NE E T_
I_ IN E_ IN N
I_ D EO IN A
_D SC RO
SP IN_ DO INT_ _IN
SP INL ON F_ T_E
SP IN_ R_ F_ EN
IN IN CR NA
NK D ER
I_ ER EO T_
I_ T_ F_ OF
LI K_ _
SP OU EO _E
I_ T_ AL
SP OU OT
I_ T_T
)
ed
SP OU
rv
se
I_
(re
SP
31 9 8 7 6 5 4 3 2 1 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 0 Reset
SPI_OUT_EOF_INT_ENA The interrupt enable bit for the SPI_OUT_EOF_INT interrupt. (R/W)
SPI_OUT_DONE_INT_ENA The interrupt enable bit for the SPI_OUT_DONE_INT interrupt. (R/W)
SPI_IN_SUC_EOF_INT_ENA The interrupt enable bit for the SPI_IN_SUC_EOF_INT interrupt. (R/W)
SPI_IN_ERR_EOF_INT_ENA The interrupt enable bit for the SPI_IN_ERR_EOF_INT interrupt. (R/W)
SPI_IN_DONE_INT_ENA The interrupt enable bit for the SPI_IN_DONE_INT interrupt. (R/W)
RA W
T_ A
PT R_ RAW
W
I N _R
Y_ INT
EM RO T_
W
R_ ER IN
SP IN_ C_ _IN AW RA
SC R_ R_
I_ IN E_ IN AW
I_ TL DS _R AW
I_ SU NE R T_
I_ D EO IN W
_D SC RO
SP INL ON F_ T_R
SP IN_ DO INT_ _IN
SP OU K_ INT T_R
SP IN_ R_ F_ RA
IN IN CR AW
NK D ER
I_ ER EO T_
I_ T_ F_ OF
LI K_ _
SP OU EO _E
I_ T_ AL
SP OU TOT
d)
I_ T_
ve
SP OU
r
se
I_
(re
SP
31 9 8 7 6 5 4 3 2 1 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 0 Reset
SPI_OUT_TOTAL_EOF_INT_RAW The raw interrupt status bit for the SPI_OUT_TOTAL_EOF_INT inter-
rupt. (RO)
SPI_OUT_EOF_INT_RAW The raw interrupt status bit for the SPI_OUT_EOF_INT interrupt. (RO)
SPI_OUT_DONE_INT_RAW The raw interrupt status bit for the SPI_OUT_DONE_INT interrupt. (RO)
SPI_IN_SUC_EOF_INT_RAW The raw interrupt status bit for the SPI_IN_SUC_EOF_INT interrupt.
(RO)
SPI_IN_ERR_EOF_INT_RAW The raw interrupt status bit for the SPI_IN_ERR_EOF_INT interrupt.
(RO)
SPI_IN_DONE_INT_RAW The raw interrupt status bit for the SPI_IN_DONE_INT interrupt. (RO)
T_ T
IN _S
PT R_ ST
ST
Y_ INT
EM RO T_
R_ ER IN
SP IN_ C_ _IN T ST
SC R_ R_
I_ SU NE S T_
I_ IN E_ IN T
I_ TL DS _S T
_D SC RO
SP INL ON F_ T_S
SP IN_ DO INT_ _IN
SP OU K_ INT T_S
SP IN_ R_ F_ ST
NK D ER
IN IN CR T
I_ ER EO T_
I_ T_ F_ OF
I_ D EO IN
LI K_ _
SP OU EO _E
I_ T_ AL
SP OU OT
I_ T_T
)
ed
SP OU
rv
se
I_
(re
SP
31 9 8 7 6 5 4 3 2 1 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 0 Reset
SPI_OUT_TOTAL_EOF_INT_ST The masked interrupt status bit for the SPI_OUT_TOTAL_EOF_INT in-
terrupt. (RO)
SPI_OUT_EOF_INT_ST The masked interrupt status bit for the SPI_OUT_EOF_INT interrupt. (RO)
SPI_OUT_DONE_INT_ST The masked interrupt status bit for the SPI_OUT_DONE_INT interrupt. (RO)
SPI_IN_SUC_EOF_INT_ST The masked interrupt status bit for the SPI_IN_SUC_EOF_INT interrupt.
(RO)
SPI_IN_ERR_EOF_INT_ST The masked interrupt status bit for the SPI_IN_ERR_EOF_INT interrupt.
(RO)
SPI_IN_DONE_INT_ST The masked interrupt status bit for the SPI_IN_DONE_INT interrupt. (RO)
CL R
T_ L
PT R_ LR
R
IN _C
EM RO T_C
Y_ INT
R
R_ ER IN
SP IN_ C_ _IN LR CL
SC R_ R_
I_ IN E_ IN LR
I_ TL DS _C LR
I_ SU NE C T_
I_ D EO IN R
_ D S C RO
SP INL ON F_ T_C
SP IN_ DO INT_ _IN
SP OU K_ INT T_C
SP IN_ R_ F_ CL
IN IN CR LR
NK D ER
I_ ER EO T_
I_ T_ F_ OF
LI K_ _
SP OU EO _E
I_ T_ AL
SP OU OT
I_ T_T
d)
ve
SP OU
r
se
I_
(re
SP
31 9 8 7 6 5 4 3 2 1 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 0 Reset
31 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 0 Reset
31 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 0 Reset
SPI_IN_SUC_EOF_DES_ADDR_REG The last inlink descriptor address when SPI DMA encountered
EOF. (RO)
31 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 0 Reset
31 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 0 Reset
31 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 0 Reset
31 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 0 Reset
31 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 0 Reset
SPI_OUT_EOF_DES_ADDR_REG The last outlink descriptor address when SPI DMA encountered
EOF. (RO)
31 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 0 Reset
31 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 0 Reset
31 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 0 Reset
RE
LL
O_ P
DD
IF EM
_A
)
_F _
ed
TX FIFO
ES
rv
_D
se
_
(re
TX
TX
31 30 29 20 19 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 0 Reset
TX_DES_ADDRESS The LSB of the SPI DMA outlink descriptor address. (RO)
SS
FU TY
RE
LL
O_ P
DD
IF EM
A
)
_F _
ed
S_
RX FIFO
rv
E
_D
se
_
(re
RX
RX
31 30 29 20 19 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 0 Reset
RX_DES_ADDRESS The LSB of the SPI DMA inlink descriptor address. (RO)
8.1 Overview
The ESP32 features hardware support for the industry-standard Secure Digital (SD) device interface that
conforms to the SD Input/Output (SDIO) Specification Version 2.0. This allows a host controller to access the
ESP32 via an SDIO bus protocol, enabling high-speed data transfer.
The SDIO interface may be used to read ESP32 SDIO registers directly and access shared memory via Direct
Memory Access (DMA), thus reducing processing overhead while maintaining high performance.
8.2 Features
• Meets SDIO V2.0 specification
The Host System represents any SDIO specification V2.0-compatible host device. The Host System interacts
with the ESP32 (configured as the SDIO slave) via the standard SDIO bus implementation.
The SDIO Device Interface block enables effective communication with the external Host by directly providing
SDIO interface registers and enabling DMA operation for high-speed data transfer over the Advanced
High-performance Bus (AHB) without engaging the CPU.
ESP32 segregates data into packets sent to/from the Host. To achieve high bus utilization and data transfer
rates, we recommend the single block transmission mode. For detailed information on this mode, please refer
to the SDIO V2.0 protocol specification. When Host and Slave exchange data as blocks on the SDIO bus, the
Slave automatically pads data-when sending data out-and automatically strips padding data from the incoming
data block.
Whether the Slave pads or discards the data depends on the data address on the SDIO bus. When the data
address is equal to, or greater than, 0x1F800, the Slave will start padding or discarding data. Therefore, the
starting data address should be 0x1F800 - Packet_length, where Packet_length is measured in bytes. Data
flow on the SDIO bus is shown in Figure 8-2.
The standard IO_RW_EXTENDED (CMD53) command is used to initiate a packet transfer of an arbitrary length.
The content of the CMD53 command used in data transmission is as illustrated in Figure 8-3 below. For
detailed information on CMD53, please refer to the SDIO protocol specifications.
There are 52 bytes of field between SLCHOST_CONF_W0_REG and SLCHOST_CONF_W15_REG. Host and Slave
can access and change these fields, thus facilitating the information interaction between Host and
Slave.
8.3.4 DMA
The SDIO Slave module uses dedicated DMA to access data residing in the RAM. As shown in Figure 8-1, the
RAM is accessed over the AHB. DMA accesses RAM through a linked-list descriptor. Every linked list is
• Owner: The allowed operator of the buffer that corresponds to the current linked list. 0: CPU is the
allowed operator; 1: DMA is the allowed operator.
• Eof: End-of-file marker, indicating that this linked-list element is the last element of the data packet.
• Length: The number of valid bytes in the buffer, i.e., the number of bytes that should be accessed from
the buffer for reading/writing.
• Buffer Address Pointer: The address of the data buffer as seen by the CPU (according to the RAM
address space).
• Next Descriptor Address: The address of the next linked-list element in the CPU RAM address space. If
the current linked list is the last one, the Eof bit should be 1, and the last descriptor address should be 0.
When the Host is interrupted, it reads relevant information from the Slave by visiting registers SLC0HOST_INT
and SLCHOST_PKT_LEN.
• SLCHOST_PKT_LEN: Packet length accumulator register. The current value minus the value of last time
equals the packet length sent this time.
In order to start DMA, the CPU needs to write the low 20 bits of the address of the first linked-list element to
the SLC0_RXLINK_ADDR bit of SLC0RX_LINK, then set the SLC0_RXLINK_START bit of SLC0RX_LINK. The
DMA will automatically complete the data transfer. Upon completion of the operation, DMA will interrupt the
CPU so that the buffer space can be freed or reused.
The Host obtains the number of available receiving buffers from the Slave by accessing register
SLC0HOST_TOKEN_RDATA. The Slave CPU should update this value after the receiving DMA linked list is
prepared.
The Host can figure out the available buffer space, using HOSTREG_SLC0_TOKEN1 minus the number of
buffers already used.
If the buffers are not enough, the Host needs to constantly poll the register until there are enough buffers
available.
To ensure sufficient receiving buffers, the Slave CPU must constantly load buffers on the receiving linked list.
The process is shown in Figure 8-8.
The CPU first needs to append new buffer segments at the end of the linked list that is being used by DMA
and is available for receiving data.
The CPU then needs to notify the DMA that the linked list has been modified. This can be done by setting bit
SLC0_TXLINK_RESTART of the SLC0TX_LINK register. Please note that when the CPU initiates DMA to receive
packets for the first time, SLC0_TXLINK_RESTART should be set to 1.
Lastly, the CPU refreshes any available buffer information by writing to the SLC0TOKEN1 register.
When the incoming data changes near the rising edge of the clock, the Slave will perform sampling on the
falling edge of the clock, or vice versa, as Figure 8-9 shows.
By default, the MTDO strapping value determines the Slave’s sampling edge. However, users can decide the
sampling edge by configuring the SLCHOST_CONF_REG register, with priority from high to low: (1) Set
SLCHOST_FRC_POS_SAMP to sample the corresponding signal at the rising edge; (2) Set
SLCHOST_FRC_NEG_SAMP to sample the corresponding signal at the falling edge.
SLCHOST_FRC_POS_SAMP and SLCHOST_FRC_NEG_SAMP fields are five bits wide. The bits correspond to
the CMD line and four DATA lines (0-3). Setting a bit causes the corresponding line to be sampled for input at
the rising clock edge or falling clock edge.
The Slave can also select which edge to drive the output lines, in order to accommodate for any latency
caused by the physical signal path. The output timing is shown in Figure 8-10.
By default, the GPIO5 strapping value determines the Slave’s output driving edge. However, users can decide
the output driving edge by configuring the following registers, with priority from high to low: (1) Set
SLCHOST_FRC_SDIO11 in SLCHOST_CONF_REG to output the corresponding signal at the falling clock edge;
(2) Set SLCHOST_FRC_SDIO22 in SLCHOST_CONF_REG to output the corresponding signal at the rising clock
edge; (3) Set HINF_HIGHSPEED_ENABLE in HINF_CFG_DATA1_REG and SLCHOST_HSPEED_CON_EN in
SLCHOST_CONF_REG, then set the EHS (Enable High-Speed) bit in CCCR at the Host side to output the
corresponding signal at the rising clock edge.
SLCHOST_FRC_SDIO11 and SLCHOST_FRC_SDIO22 fields are five bits wide. The bits correspond to the CMD
line and four DATA lines (0-3). Setting a bit causes the corresponding line to output at the rising clock edge or
falling clock edge.
Notes on priority setting: The configuration of strapping pins has the lowest priority when controlling the
sampling edge or driving edge. The lower-priority configuration takes effect only when the higher-priority
configuration is not set. For example, the MTDO strapping value determines the sampling edge only when
SCLHOST_FRC_POS_SAMP and SCLHOST_FRC_NEG_SAMP are not set.
8.3.7 Interrupt
Host and Slave can interrupt each other via the interrupt vector. Both Host and Slave have eight interrupt
vectors. The interrupt is enabled by configuring the interrupt vector register (setting the enable bit to 1). The
interrupt vector registers can clear themselves automatically, which means one interrupt at a time and no other
configuration is required.
P_ ST K
R
OO TE AC
CL
_L P_ RB
ST
O_
TE
TX OO W
UT
0_ _L O_
_A
LC RX UT
TX ST
ST
EN
_S 0_ _A
0_ _R
_R
K
LC RX
TO
0_
O 0_ 0_
_S 0_
LC
CC F LC
F0 LC
_S
SL CON 0_S
ON 0_S
F0
d)
CC )
C F
CC F
ed
d
ON
SL CON
SL ON
ve
e
rv
rv
r
CC
se
se
se
C
(re
(re
SL
SL
SL
31 15 14 13 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 Reset
SLCCONF0_SLC0_RX_LOOP_TEST Loop around when the slave buffer finishes sending packets.
When set to 1, hardware will not change the owner bit in the linked list. (R/W)
SLCCONF0_SLC0_TX_LOOP_TEST Loop around when the slave buffer finishes receiving packets.
When set to 1, hardware will not change the owner bit in the linked list. (R/W)
IN AW
RA W
RA
IT T_ W
W
W
HO _B _IN AW
C_ HO BI IN AW
SL INT LC_ RHO _B _IN RAW
IN AW
R_ T_R
T_ RA
_B IN RA
RA
IN LC RH _B _IN RA
T_
FR ST T2 T_R
SL R T_ 3_ T_R
0_ R
IN T_
ER IN
C0 _S F ST IT7 RA
C0 _S F ST IT5 T_
ST IT1_ T_
T_
C0 _S F ST IT4 T_
C0 _S F ST _IN W
SU _I W
C0 _S F ST _I RA
C0 _S F ST IT6 T_
C0 _S 0_ ST INT W
_D _E _R
R_ R_
E_ _IN
SL INT LC X_ F_ _RA
SL _TX O T_
C0 _S 0_ UD NT
N
T_ _F OS IT
_D CR_
C0 X_ F_I
C0 _S 0_ EO
C0 _S 0_ OV
D
SL rve LC RX_
SL INT LC RX_
SL INT C X_
TX
T
se _S 0_
C0 _S 0_
C0 _S 0_
(re INT LC
SL INT LC
SL NT C
L
L
L
C0 _S
C0 _S
C0 _S
)
)
_
ed
ed
ed
SL INT
SL INT
SL INT
IN
rv
rv
rv
I
C0
C0
se
se
se
(re
(re
(re
SL
SL
31 27 26 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0x00 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 Reset
SLC0INT_SLC0_RX_DSCR_ERR_INT_RAW The raw interrupt bit for Slave sending descriptor error
(RO)
SLC0INT_SLC0_TX_DSCR_ERR_INT_RAW The raw interrupt bit for Slave receiving descriptor error.
(RO)
SLC0INT_SLC0_RX_EOF_INT_RAW The interrupt mark bit for Slave sending operation finished. (RO)
SLC0INT_SLC0_RX_DONE_INT_RAW The raw interrupt bit to mark single buffer as sent by Slave.
(RO)
SLC0INT_SLC0_TX_DONE_INT_RAW The raw interrupt bit to mark a single buffer as finished during
Slave receiving operation. (RO)
SLC0INT_SLC0_TX_OVF_INT_RAW The raw interrupt bit to mark Slave receiving buffer overflow.
(RO)
SLC0INT_SLC0_RX_UDF_INT_RAW The raw interrupt bit for Slave sending buffer underflow. (RO)
SLC0INT_SLC0_TX_START_INT_RAW The raw interrupt bit for registering Slave receiving initialization
interrupt. (RO)
SLC0INT_SLC0_RX_START_INT_RAW The raw interrupt bit to mark Slave sending initialization inter-
rupt. (RO)
SLC0INT_SLC_FRHOST_BIT7_INT_RAW The interrupt mark bit 7 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT6_INT_RAW The interrupt mark bit 6 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT5_INT_RAW The interrupt mark bit 5 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT4_INT_RAW The interrupt mark bit 4 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT3_INT_RAW The interrupt mark bit 3 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT2_INT_RAW The interrupt mark bit 2 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT1_INT_RAW The interrupt mark bit 1 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT0_INT_RAW The interrupt mark bit 0 for Host to interrupt Slave. (RO)
IN ST
ST
T_ ST
C0 T_ _F O BI IN T
IT NT_ T
ST
R_ T_
T_ _ O B IN ST
HO _B _ ST
C_ HO _B _I ST
T_
C T_ _ O BI IN T
IN T
SL 0IN SLC FRH ST_ T5_ T_S
_B _I _S
SL 0IN SLC FRH ST_ T6_ T_S
0_ S
IN T_
ER IN
T_
IN SLC RH ST_ T4_ T_
SL 0IN SLC FRH ST_ T7_ ST
ON OF ST
FR ST IT2 NT_
SL FR ST IT3 T_
SL 0IN SLC FRH ST_ _IN ST
ST
ST IT1 INT
E_ _IN
R_ RR_
C T_ _ _S T_ ST
ST
C T_ _ O BI T_
_D _E T_
C T_ 0 _S _I ST
C T_ _ O BI IN
C T_ _ O RT T_
SL 0IN SLC _RX TAR NT_
LC TX ON T_
SL ed) _TX UC _IN
C T_ 0 _U IN
E
_D R
SL IN SLC RX VF_
SL 0IN ) _TX SC
IN LC RX OF
C d 0 _D
C0 T_ 0_ _E
C0 T_ 0_ _O
_S
SL rve SLC _RX
SL IN SLC RX
SL IN LC TX
C0 T_ 0_
C0 T_ 0_
se T_ 0
0
(re 0IN SLC
SL IN SLC
SL IN SLC
S
S
d)
d)
C T_
C0 T_
C0 _ T
ve
ve
SL 0IN
SL 0IN
rv
r
r
se
se
se
C
C
(re
(re
SL
31 27 26 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0x00 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 Reset
SLC0INT_SLC0_RX_DSCR_ERR_INT_ST The interrupt status bit for Slave sending descriptor error.
(RO)
SLC0INT_SLC0_TX_DSCR_ERR_INT_ST The interrupt status bit for Slave receiving descriptor error.
(RO)
SLC0INT_SLC0_RX_EOF_INT_ST The interrupt status bit for finished Slave sending operation. (RO)
SLC0INT_SLC0_RX_DONE_INT_ST The interrupt status bit for finished Slave sending operation.
(RO)
SLC0INT_SLC0_TX_SUC_EOF_INT_ST The interrupt status bit for marking Slave receiving operation
as finished. (RO)
SLC0INT_SLC0_TX_DONE_INT_ST The interrupt status bit for marking a single buffer as finished
during the receiving operation. (RO)
SLC0INT_SLC0_TX_OVF_INT_ST The interrupt status bit for Slave receiving overflow interrupt. (RO)
SLC0INT_SLC0_RX_UDF_INT_ST The interrupt status bit for Slave sending buffer underflow. (RO)
SLC0INT_SLC0_TX_START_INT_ST The interrupt status bit for Slave receiving interrupt initialization.
(RO)
SLC0INT_SLC0_RX_START_INT_ST The interrupt status bit for Slave sending interrupt initialization.
(RO)
SLC0INT_SLC_FRHOST_BIT7_INT_ST The interrupt status bit 7 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT6_INT_ST The interrupt status bit 6 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT5_INT_ST The interrupt status bit 5 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT4_INT_ST The interrupt status bit 4 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT3_INT_ST The interrupt status bit 3 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT2_INT_ST The interrupt status bit 2 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT1_INT_ST The interrupt status bit 1 for Host to interrupt Slave. (RO)
SLC0INT_SLC_FRHOST_BIT0_INT_ST The interrupt status bit 0 for Host to interrupt Slave. (RO)
IN NA
A
EN
T_ ENA
_B _IN ENA
A
A
T_ 2_I ENA
T_ A
R_ _E
_IN NA
SL INT_ C_F OST IT5_ T_EN
EN
SL INT_ C_F OST IT4_ T_EN
T_ _FR ST_ T3_ _EN
SL INT_ C_F OST IT6_ _EN
T_
DO OF NA
IT0 T_E
_IN T_
T_
EN
HO BIT NT
SL INT_ C0_ _STA INT_ A
T
_E _E
SL RH _B INT
R T_E
RT EN
NE _IN
_
IN
IN
F_ EN
IN
SL RH _B T_
IN
SC ERR
E
_T SUC INT
T_ 0_T DO NT_
1
_
T
_D R_
R_
I
I
I
SL RH _B
SL RH _B
SL RH _B
B
SL RX F_I
F_
N
C
A
SL rved C0_ _DS
ST
SL INT_ C0_ _EO
C_ OS
O
_
_
X_
SL RH
H
SL RX
SL RX
SL RX
SL RX
TX
SL TX
SL TX
FR
(re INT_ C0_
SL INT_ C0_
0_
C0
C
C
SL
SL
SL
SL
S
d)
d)
)
SL INT_
SL INT_
SL INT_
_
d
T
rve
rve
rve
IN
IN
I
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
se
se
se
se
(re
(re
(re
SL
SL
SL
31 27 26 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0x00 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 Reset
SLC0INT_SLC0_RX_DSCR_ERR_INT_ENA The interrupt enable bit for Slave sending linked list de-
scriptor error. (R/W)
SLC0INT_SLC0_TX_DSCR_ERR_INT_ENA The interrupt enable bit for Slave receiving linked list de-
scriptor error. (R/W)
SLC0INT_SLC0_RX_EOF_INT_ENA The interrupt enable bit for Slave sending operation completion.
(R/W)
SLC0INT_SLC0_RX_DONE_INT_ENA The interrupt enable bit for single buffer’s sent interrupt, in
Slave sending mode. (R/W)
SLC0INT_SLC0_TX_SUC_EOF_INT_ENA The interrupt enable bit for Slave receiving operation com-
pletion. (R/W)
SLC0INT_SLC0_TX_DONE_INT_ENA The interrupt enable bit for single buffer’s full event, in Slave
receiving mode. (R/W)
SLC0INT_SLC0_TX_OVF_INT_ENA The interrupt enable bit for Slave receiving buffer overflow.
(R/W)
SLC0INT_SLC0_RX_UDF_INT_ENA The interrupt enable bit for Slave sending buffer underflow.
(R/W)
SLC0INT_SLC0_TX_START_INT_ENA The interrupt enable bit for Slave receiving operation initializa-
tion. (R/W)
SLC0INT_SLC0_RX_START_INT_ENA The interrupt enable bit for Slave sending operation initializa-
tion. (R/W)
SLC0INT_SLC_FRHOST_BIT7_INT_ENA The interrupt enable bit 7 for Host to interrupt Slave. (R/W)
SLC0INT_SLC_FRHOST_BIT6_INT_ENA The interrupt enable bit 6 for Host to interrupt Slave. (R/W)
SLC0INT_SLC_FRHOST_BIT5_INT_ENA The interrupt enable bit 5 for Host to interrupt Slave. (R/W)
SLC0INT_SLC_FRHOST_BIT4_INT_ENA The interrupt enable bit 4 for Host to interrupt Slave. (R/W)
SLC0INT_SLC_FRHOST_BIT3_INT_ENA The interrupt enable bit 3 for Host to interrupt Slave. (R/W)
SLC0INT_SLC_FRHOST_BIT2_INT_ENA The interrupt enable bit 2 for Host to interrupt Slave. (R/W)
SLC0INT_SLC_FRHOST_BIT1_INT_ENA The interrupt enable bit 1 for Host to interrupt Slave. (R/W)
Espressif Systems 173 ESP32 TRM (Version 5.2)
SLC0INT_SLC_FRHOST_BIT0_INT_ENA
Submit The interrupt enable
Documentation bit 0 for Host to interrupt Slave. (R/W)
Feedback
8 SDIO Slave Controller
IN LR
R
CL
T_ CLR
_B _IN CLR
R
I N LR
R_ _C
T_ 2_I CLR
T_ R
R
_IN LR
L
CL
T_ _FR ST_ T3_ _CL
T_
IT0 T_C
_IN T_
T_
CL
HO BIT NT
SL RH _B T_C
_E _C
F_ CLR
T
R T_C
SL RH _B INT
NE _IN
_
RT CL
L
IN
IN
IN
SC ERR
C
_T SUC INT
1
_
T
_D R_
R_
I
I
I
SL RH _B
SL RH _B
SL RH _B
B
SL RX F_I
F_
N
C
A
SL rved C0_ _DS
ST
SL INT_ C0_ _EO
C_ OS
O
_
_
X_
SL RH
H
SL RX
SL RX
SL RX
SL RX
TX
SL TX
SL TX
FR
(re INT_ C0_
SL INT_ C0_
0_
C0
C
C
SL
SL
SL
SL
S
d)
d)
)
SL INT_
SL INT_
SL INT_
_
d
T
rve
rve
rve
IN
IN
I
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
se
se
se
se
(re
(re
(re
SL
SL
SL
31 27 26 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0x00 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 Reset
SLC0INT_SLC0_RX_DSCR_ERR_INT_CLR Interrupt clear bit for Slave sending linked list descriptor
error. (WO)
SLC0INT_SLC0_TX_DSCR_ERR_INT_CLR Interrupt clear bit for Slave receiving linked list descriptor
error. (WO)
SLC0INT_SLC0_RX_EOF_INT_CLR Interrupt clear bit for Slave sending operation completion. (WO)
SLC0INT_SLC0_RX_DONE_INT_CLR Interrupt clear bit for single buffer’s sent interrupt, in Slave
sending mode. (WO)
SLC0INT_SLC0_TX_DONE_INT_CLR Interrupt clear bit for single buffer’s full event, in Slave receiv-
ing mode. (WO)
SLC0INT_SLC0_TX_OVF_INT_CLR Set this bit to clear the Slave receiving overflow interrupt. (WO)
SLC0INT_SLC0_RX_UDF_INT_CLR Set this bit to clear the Slave sending underflow interrupt. (WO)
SLC0INT_SLC0_TX_START_INT_CLR Set this bit to clear the interrupt for Slave receiving operation
initialization. (WO)
SLC0INT_SLC0_RX_START_INT_CLR Set this bit to clear the interrupt for Slave sending operation
initialization. (WO)
DR
P
RX K EST
TO
AD
0_ LIN R
LC RX K_
K_
_S 0_ LIN
IN
XL
RX LC RX
R
C0 _S 0_
0_
SL 0RX LC
LC
C _S
_S
SL RX )
)
C0 d
ed
SL rve
RX
rv
C0
se
se
(re
(re
SL
31 30 29 28 27 20 19 0
0 0 0 0 0 0 0 0 0 0 0 0 0x000000 Reset
SLC0RX_SLC0_RXLINK_RESTART Set this bit to restart and continue the linked list operation for
sending packets. (R/W)
SLC0RX_SLC0_RXLINK_START Set this bit to start the linked list operation for sending packets.
Sending will start from the address indicated by SLC0_RXLINK_ADDR. (R/W)
SLC0RX_SLC0_RXLINK_STOP Set this bit to stop the linked list operation. (R/W)
SLC0RX_SLC0_RXLINK_ADDR The lowest 20 bits in the initial address of Slave’s sending linked list.
(R/W)
NK TA T
LI S AR
_S RT
R
P
TX K_ ST
DD
TO
0_ LIN RE
_A
LC TX K_
K
_S 0_ LIN
IN
XL
TX LC TX
_T
C0 _S 0_
C0
SL 0TX LC
SL
C _S
SL TX )
)
C0 d
ed
X_
SL rve
rv
T
C0
se
se
(re
(re
SL
31 30 29 28 27 20 19 0
0 0 0 0 0 0 0 0 0 0 0 0 0x000000 Reset
SLC0TX_SLC0_TXLINK_RESTART Set this bit to restart and continue the linked list operation for
receiving packets. (R/W)
SLC0TX_SLC0_TXLINK_START Set this bit to start the linked list operation for receiving packets.
Receiving will start from the address indicated by SLC0_TXLINK_ADDR. (R/W)
SLC0TX_SLC0_TXLINK_STOP Set this bit to stop the linked list operation for receiving packets.
(R/W)
SLC0TX_SLC0_TXLINK_ADDR The lowest 20 bits in the initial address of Slave’s receiving linked
list. (R/W)
EC
TV
N
_I
ST
HO
TO
0_
LC
S
C_
)
VE
ed
ed
ed
NT
rv
rv
rv
se
se
se
CI
(re
(re
(re
SL
31 24 23 16 15 8 7 0
E
OR
_M
TA
DA
NC
W
_I
1_
1
N1
EN
EN
KE
OK
OK
TO
_T
_T
0_
C0
C0
ed SLC
SL
SL
1_
1_
se EN1
EN
EN
)
TO )
)
ed
C0 d
K
K
SL rve
TO
TO
rv
rv
C0
C0
se
se
(re
(re
(re
SL
SL
31 28 27 16 15 14 13 12 11 0
LR
N_ CH N
TO N
LE TIT _E
_C
AU _E
0_ _S CH
LC TX TIT
_S 0_ S
F1 LC RX_
ON 1_S 0_
CC F LC
SL CON 1_S
)
C F
ed
ed
ed
SL CON
rv
rv
rv
se
se
se
C
(re
(re
(re
SL
31 23 22 16 15 7 6 5 4
0x000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 Reset
E
AC
PL
E
_R
NO
N_
KE
TO
0_
d)
LC
ve
S
r
se
C_
(re
SL
31 1 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 0 Reset
TA
DA
N
_W
_I
EN
EN
)
)
ed
ed
_L
_L
rv
rv
rv
C0
C0
se
se
se
(re
(re
(re
SL
31 29 28 23 22 21 20 19
SL 0
SLC0_LEN_INC_MORE Set this bit to add the value of SLC0_LEN to that of SLC0_LEN_WDATA.
(WO)
LE
rv
_
C0
se
(re
SL
31 20 19 0
N1
KE
TO
0_
LC
_S
)
d)
ed
EG
ve
rv
r
ST
se
se
HO
(re
(re
31 28 27 16 15 0
W
RA
IT0 T_R W
W
HO _SL _TO ST_B 4_IN RAW
HO _BIT INT W
LC OH T_B _INT AW
SL HOS SLC OH T_BI _INT AW
_IN AW
T_
1_ _RA
RA
A
_R
_IN
_R
R
T6 _R
T_
_
T_
W
_IN AW
_B IN
RA
CK
_
_
DF _R
0_ OS IT2
T5
T_
3
T7
PA
T
T
_U NT
I
W_
RX F_I
T
ST
T_ 0_T OS
T_ 0_T OS
T_ 0_T OS
T_ 0_T OS
S
NE
0_ OV
O
ST C0 HO
X_
SL HOS SLC OH
LC X_
TO
R
_S _T
T_ 0_T
_S _T
0_
ST C0
0
LC
SL HOS SLC
HO SL
_S
T_
T_
ST
T
d)
d)
d)
d)
OS
SL HOS
rve
rve
rve
rve
HO
H
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
C0
se
se
se
se
(re
(re
(re
(re
SL
SL
SL
SL
31 26 25 24 23 22 18 17 16 15 8 7 6 5 4 3 2 1 0
0x00 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 Reset
T
_S
INT
_IN ST
T
C0 ST_S 0_TO ST_B _INT T
0_ ST
_S
_S
S
_S
T_
_
_
ET_
INT
C0 ST_S 0_TO ST_B _INT
T
_ IN
T
F_ ST
CK
_S
IT5
IT3
IT 7
IT4
HO BIT1
_
INT
PA
BIT
X_ _INT
B
W_
ST_
T_
ST_
F
UD
NE
C0 _OV
HO
HO
HO
HO
HO
HO
X_
C0 ST_S 0_TO
O
_TO
X
_R
_R
ST_ C0_T
ST_ 0_T
C0
LC
LC
LC
LC
LC
LC
LC
SL
L
SL
SL
C0 ST_S
C0 ST_S
ST_
d)
d)
d)
d)
rve
rve
rve
rve
HO
HO
HO
HO
HO
HO
HO
HO
HO
HO
HO
C0
C0
C0
se
se
se
se
(re
(re
(re
(re
SL
SL
SL
SL
SL
SL
SL
SL
SL
SL
SL
31 26 25 24 23 22 18 17 16 15 8 7 6 5 4 3 2 1 0
0x00 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 Reset
K
H EC
_C
EN
N
LE
L
0_
0_
LC
LC
_S
_S
EG
EG
TR
TR
OS
OS
H
_H
T_
ST
OS
O
CH
CH
SL
SL
31 20 19 0
SLCHOST_HOSTREG_SLC0_LEN The accumulated value of the data length sent by the Slave. The
value gets updated only when the Host reads it.
F0
F2
F3
F1
ON
ON
ON
CO
C
C
T_
T_
T_
T_
OS
OS
OS
OS
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF3 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF2 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF1 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF0 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
F5
4
F7
NF
F
ON
ON
ON
CO
C
C
T_
T_
T_
T_
OS
OS
OS
OS
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF7 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF6 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF5 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF4 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
F9
8
F1
NF
F
ON
ON
ON
O
_C
C
T_
T_
T_
ST
OS
OS
OS
O
CH
CH
CH
CH
SL
SL
SL
31 24 23 16 15 8 7
SL 0
SLCHOST_CONF11 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF10 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF9 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
SLCHOST_CONF8 The information interaction register between Host and Slave. Both Host and Slave
can access it. (R/W)
15
1 4
NF
NF
O
O
_C
_C
)
ed
ed
ST
ST
rv
rv
O
O
CH
CH
se
se
(re
(re
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF15 The information interaction register between Host and Slave. Both Host and
Slave can be read from and written to this. (R/W)
SLCHOST_CONF14 The information interaction register between Host and Slave. Both Host and
Slave can be read from and written to this. (R/W)
8
F1
F
ON
N
CO
C
T_
T_
)
ed
ed
OS
OS
rv
rv
CH
CH
se
se
(re
(re
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF19 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF18 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
26
24
7
F2
F2
NF
F
ON
ON
ON
O
C
_C
C
T_
T_
T_
ST
OS
OS
OS
O
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF27 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF26 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF25 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF24 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
32
4
F3
F3
F
F
ON
ON
ON
ON
C
C
T_
T_
T_
T_
OS
OS
OS
OS
CH
CH
CH
CH
SL
SL
SL
31 24 23 16 15 8 7 SL 0
SLCHOST_CONF35 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF34 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF33 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF32 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
36
9
7
F3
F3
NF
F
ON
ON
ON
CO
C
C
T_
T_
T_
T_
OS
OS
OS
OS
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF39 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF38 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF37 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF36 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
40
2
43
1
F4
F4
NF
F
ON
ON
ON
O
_C
C
T_
T_
T_
ST
OS
OS
OS
O
CH
CH
CH
CH
SL
SL
SL
31 24 23 16 15 8 7 SL 0
SLCHOST_CONF43 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF42 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF41 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF40 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
46
44
47
F4
NF
NF
F
ON
ON
O
O
_C
_C
C
T_
T_
ST
ST
OS
OS
O
O
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF47 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF46 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF45 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF44 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
48
9
51
F5
F4
F
F
ON
ON
ON
ON
C
C
T_
T_
T_
T_
OS
OS
OS
OS
CH
CH
CH
CH
SL
SL
SL
31 24 23 16 15 8 7 SL 0
SLCHOST_CONF51 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF50 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF49 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF48 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
55
52
5 4
F5
NF
NF
F
ON
ON
O
O
_C
_C
C
T_
T_
ST
ST
OS
OS
O
O
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF55 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF54 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF53 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF52 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
56
8
9
7
F5
F5
F5
F
ON
ON
ON
ON
C
C
T_
T_
T_
T_
OS
OS
OS
OS
CH
CH
CH
CH
SL
SL
SL
31 24 23 16 15 8 7 SL 0
SLCHOST_CONF59 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF58 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF57 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF56 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
60
3
62
61
F6
NF
NF
F
ON
ON
CO
O
C
_C
C
T_
T_
T_
ST
OS
OS
OS
O
CH
CH
CH
CH
SL
SL
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF63 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF62 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF61 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
SLCHOST_CONF60 The information interaction register between Host and Slave. Both Host and
Slave can access it. (R/W)
LR
_C
_IN CLR
LR
C0 ST_S 0_TO ST_B _INT LR
R
_IN LR
C0 ST_S 0_TO ST_B _INT R
0_ CLR
INT
_C
C
_C
T_
_
T_
ET_
INT
C0 ST_S 0_TO ST_B _INT
LR
_ IN
F_ CLR
CK
_C
IT5
IT3
IT 7
IT4
HO BIT1
_
INT
PA
BIT
X_ _INT
B
W_
ST_
T_
ST_
F
UD
NE
C0 _OV
HO
HO
HO
HO
HO
HO
X_
C0 ST_S 0_TO
O
_TO
X
_R
_R
ST_ C0_T
ST_ 0_T
C0
LC
LC
LC
LC
LC
LC
LC
SL
L
SL
SL
C0 ST_S
C0 ST_S
ST_
d)
d)
d)
d)
rve
rve
rve
rve
HO
HO
HO
HO
HO
HO
HO
HO
HO
HO
HO
C0
C0
C0
se
se
se
se
(re
(re
(re
(re
SL
SL
SL
SL
SL
SL
SL
SL
SL
SL
SL
31 26 25 24 23 22 18 17 16 15 8 7 6 5 4 3 2 1 0
0x00 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 Reset
NA
_E
_IN NA
_IN ENA
NA
ST_ 1_SL _TOH T_BI INT_ A
0_ ENA
N
INT
EN
C0 ST_F SLC OHO BIT5 NT_E
_E
C0 ST_F SLC OHO BIT4 T_E
C0 ST_F SLC OHO BIT6 T_E
_
BI INT_
T_
T_
NT
INT
A
_IN NA
_IN
EN
KE
_I
_
_
E
AC
T_
T3
C0 ST_F SLC OHO BIT7
HO BIT1
_U INT_
B IT
_P
ST_
ST_
T_
ST_
T_
_
ST_
EW
0_ OVF_
DF
S
OS
_N
H
_
RX
RX
1_S _TO
TO
1_S 0_TX
N1_ 0_T
N1_ 0_T
N1_ 0_T
N1_ 0_T
N1_ 0_T
0_
0
C0
LC
C
LC
C0 ST_F SLC
LC
ST_ 1_SL
1_S
N1_
FN
N
FN
N
FN
C0 ST_F
C0 ST_F
ST_
d)
d)
d)
d)
rve
rve
rve
rve
HO
HO
HO
HO
HO
HO
HO
HO
HO
HO
HO
C0
C0
C0
se
se
se
se
(re
(re
(re
(re
SL
SL
SL
SL
SL
SL
SL
SL
SL
SL
SL
31 26 25 24 23 22 18 17 16 15 8 7 6 5 4 3 2 1 0
0x00 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 Reset
9
1
F2
F3
ON
ON
C
C
T_
T_
)
)
ed
ed
OS
OS
rv
rv
CH
CH
se
se
(re
(re
SL
SL
31 24 23 16 15 8 7 0
SLCHOST_CONF31 The interrupt vector used by Host to interrupt Slave. This bit will not be cleared
automatically. (WO)
SLCHOST_CONF29 The interrupt vector used by Host to interrupt Slave. This bit will not be cleared
automatically. (WO)
P
_E
M
N
20
CO
_S
_S
11
IO
IO
OS
EG
D_
D
_N
_P
EE
_S
_S
SP
RC
RC
RC
RC
H
_F
_F
F
T_
T_
T_
)
)
ed
ed
ST
ST
OS
OS
OS
rv
rv
O
CH
CH
CH
CH
CH
se
se
(re
(re
SL
SL
SL
SL
SL
31 28 27 26 20 19 15 14 10 9 5 4 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 0 Reset
SLCHOST_HSPEED_CON_EN Set this bit and HINF_HIGHSPEED_ENABLE, then set the EHS (Enable
High-Speed) bit in CCCR at the Host side to output the corresponding signal at the rising clock
edge. (R/W)
SLCHOST_FRC_POS_SAMP Set this bit to sample the corresponding signal at the rising clock edge.
(R/W)
SLCHOST_FRC_NEG_SAMP Set this bit to sample the corresponding signal at the falling clock edge.
(R/W)
SLCHOST_FRC_SDIO20 Set this bit to output the corresponding signal at the rising clock edge.
(R/W)
SLCHOST_FRC_SDIO11 Set this bit to output the corresponding signal at the falling clock edge.
(R/W)
Y1 LE
AD AB
RE N
IO _E
O_ ED
DI PE
_S HS
)
ed
NF IG
HI _H
rv
se
NF
(re
HI
31 3 2 1
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 Reset
9.1 Overview
The ESP32 memory card interface controller provides a hardware interface between the Advanced Peripheral
Bus (APB) and an external memory device. The memory card interface allows the ESP32 to be connected to
SDIO memory cards, MMC cards and devices with a CE-ATA interface. It supports two external cards (Card0
and Card1).
9.2 Features
This module has the following features:
The SD/MMC controller topology is shown in Figure 9-1. The controller supports two peripherals which cannot
be functional at the same time.
• Bus Interface Unit (BIU): It provides APB interfaces for registers, data read and write operation by FIFO and
DMA.
• Card Interface Unit (CIU): It handles external memory card interface protocols. It also provides clock
control.
9.4.1.1 BIU
The BIU provides the access to registers and FIFO data through the Host Interface Unit (HIU). Additionally, it
provides FIFO access to independent data through a DMA interface. The host interface can be configured
as an APB interface. Figure 9-3 illustrates the internal components of the BIU. The BIU provides the following
functions:
• Host interface
• DMA interface
• Interrupt control
• Register access
• FIFO access
9.4.1.2 CIU
The CIU module implements the card-specific protocols. Within the CIU, the command path control unit and
data path control unit prompt the controller to interface with the command and data ports, respectively, of the
SD/MMC/CE-ATA cards. The CIU also provides clock control. Figure 9-3 illustrates the internal structure of the
CIU, which consists of the following primary functional blocks:
• Command path
• Data path
• Clock control
• Mux/demux unit
If the data_expected bit is set in the Command register, the new command is a data-transfer command and the
data path starts one of the following operations:
If no data are received by the data timeout, the data path signals a data timeout to the BIU, which marks an end
to the data transfer. Based on the value of the transfer_mode bit in the Command register, the data-receive
state machine gets data from the card’s data bus in a stream or block(s). The data receive state machine is
shown in Figure 9-6.
• During an open-ended card-write operation, if the card clock is stopped due to FIFO being empty, the
software must fill FIFO with data first, and then start the card clock. Only then can it issue a stop/abort
command to the card.
• During an SDIO/COMBO card transfer, if the card function is suspended and the software wants to resume
the suspended transfer, it must first reset FIFO, and then issue the resume command as if it were a new
data-transfer command.
• When issuing card reset commands (CMD0, CMD15 or CMD52_reset), while a card data transfer is in
progress, the software must set the stop_abort_cmd bit in the Command register, so that the CIU can
stop the data transfer after issuing the card reset command.
• When the data’s end bit error is set in the RINTSTS register, the CIU does not guarantee SDIO interrupts. In
such a case, the software ignores SDIO interrupts and issues a stop/abort command to the card, so that
the card stops sending read-data.
• If the card clock is stopped due to FIFO being full during a card read, the software will read at least two
FIFO locations to restart the card clock.
• Only one CE-ATA device at a time can be selected for a command or data transfer. For example, when
data are transferred from a CE-ATA device, a new command should not be sent to another CE-ATA device.
• If a CE-ATA device’s interrupts are enabled (nIEN=0), a new RW_BLK command should not be sent to the
same device if the execution of a RW_BLK command is already in progress (the RW_BLK command used
in this databook is the RW_MULTIPLE_BLOCK MMC command defined by the CE-ATA specifications). Only
the CCSD can be sent while waiting for the CCS.
• If, however, a CE-ATA device’s interrupts are disabled (nIEN=1), a new command can be issued to the same
device, allowing it to read status information.
• The send_auto_stop signal is not supported (software should not set the send_auto_stop bit) in CE-ATA
transfers.
After configuring the command start bit to 1, the values of the following registers cannot be changed before a
command has been issued:
• CMD - command
• TMOUT - timeout
If SDIO-sending is enabled, data can be written to the transferred RAM module by APB interface or DMA. Data
will be written from register EMAC_FIFO to the CPU, directly, by an APB interface.
When a subunit of the data path receives data, the subdata will be written onto the receive-RAM. Then, these
subdata can be read either with the APB or the DMA method at the reading end. Register EMAC_FIFO can be
read by the APB directly.
The DES2 element contains the address pointer to the data buffer.
The DES3 element contains the address pointer to the next descriptor if the present descriptor is not the last
one in a chained descriptor structure.
Table 9-5. DES3
9.9 Initialization
9.9.1 DMAC Initialization
The DMAC initialization should proceed as follows:
• Write to the DMAC Bus Mode Register (BMOD_REG) will set the Host bus’s access parameters.
• Write to the DMAC Interrupt Enable Register (IDINTEN) will mask any unnecessary interrupt causes.
• The software driver creates either the transmit or the receive descriptor list. Then, it writes to the DMAC
Descriptor List Base Address Register (DBADDR), providing the DMAC with the starting address of the list.
1. The Host sets up the elements (DES0-DES3) for transmission, and sets the OWN bit (DES0[31]). The Host
also prepares the data buffer.
2. The Host programs the write-data command in the CMD register in BIU.
3. The Host also programs the required transmit threshold (TX_WMARK field in FIFOTH register).
4. The DMAC engine fetches the descriptor and checks the OWN bit. If the OWN bit is not set, it means that
the host owns the descriptor. In this case, the DMAC enters a suspend-state and asserts the Descriptor
Unable interrupt in the IDSTS register. In such a case, the host needs to release the DMAC by writing any
value to PLDMND_REG.
5. It then waits for the Command Done (CD) bit and no errors from BIU, which indicates that a transfer can
be done.
6. Subsequently, the DMAC engine waits for a DMA interface request (dw_dma_req) from BIU. This request
will be generated, based on the programmed transmit-threshold value. For the last bytes of data which
cannot be accessed using a burst, single transfers are performed on the AHB Master Interface.
7. The DMAC fetches the transmit data from the data buffer in the Host memory and transfers them to FIFO
for transmission to card.
8. When data span across multiple descriptors, the DMAC fetches the next descriptor and extends its op-
eration using the following descriptor. The last descriptor bit indicates whether the data span multiple
descriptors or not.
9. When data transmission is complete, the status information is updated in the IDSTS register by setting the
Transmit Interrupt, if it has already been enabled. Also, the OWN bit is cleared by the DMAC by performing
a write transaction to DES0.
1. The Host sets up the element (DES0-DES3) for reception, and sets the OWN bit (DES0[31]).
2. The Host programs the read-data command in the CMD register in BIU.
3. Then, the Host programs the required level of the receive-threshold (RX_WMARK field in FIFOTH register).
4. The DMAC engine fetches the descriptor and checks the OWN bit. If the OWN bit is not set, it means that
the host owns the descriptor. In this case, the DMA enters a suspend-state and asserts the Descriptor
Unable interrupt in the IDSTS register. In such a case, the host needs to release the DMAC by writing any
value to PLDMND_REG.
5. It then waits for the Command Done (CD) bit and no errors from BIU, which indicates that a transfer can
be done.
6. The DMAC engine then waits for a DMA interface request (dw_dma_req) from BIU. This request will be
generated, based on the programmed receive-threshold value. For the last bytes of the data which cannot
be accessed using a burst, single transfers are performed on the AHB.
7. The DMAC fetches the data from FIFO and transfers them to the Host memory.
8. When data span across multiple descriptors, the DMAC will fetch the next descriptor and extend its op-
eration using the following descriptor. The last descriptor bit indicates whether the data span multiple
descriptors or not.
9. When data reception is complete, the status information is updated in the IDSTS register by setting
Receive-Interrupt, if it has already been enabled. Also, the OWN bit is cleared by the DMAC by performing
a write-transaction to DES0.
tW(CKH) tW(CKL)
CK
tOV tOH
D, CMD
(output)
tISU tIH
D, CMD
(input)
Legend:
• tW (CKL) /tW (CKH) - Clock Low/High Time: tW (CKL) /tW (CKH) represents the time that the clock signal
(CK) should remain in the low or high state.
• tISU - Input Setup Time in HS Mode: tISU represents the setup time required for CMD and D (data lines)
inputs.
• tIH - Input Hold Time in HS Mode: tIH specifies the hold time required for CMD and D inputs.
• tOV - Output Valid Time in HS Mode: tOV defines the time it takes for the CMD and D outputs to be ready.
• tOH - Output Hold Time in HS Mode: tOH specifies the hold time required for the CMD and D outputs to
be valid.
• The timing of the CMD and D inputs and outputs are measured in relation to the clock signal CK.
Please find detailed information on the clock phase selection register CLK_EDGE_SEL in Section Registers.
9.12 Interrupt
Interrupts can be generated as a result of various events. The IDSTS register contains all the bits that might
cause an interrupt. The IDINTEN register contains an enable bit for each of the events that can cause an
interrupt.
There are two groups of summary interrupts, ”Normal” ones (bit8 NIS) and ”Abnormal” ones (bit9 AIS), as
outlined in the IDSTS register. Interrupts are cleared by writing 1 to the position of the corresponding bit. When
all the enabled interrupts within a group are cleared, the corresponding summary bit is also cleared. When both
summary bits are cleared, the interrupt signal dmac_intr_o is de-asserted (stops signalling).
Interrupts are not queued up, and if a new interrupt-event occurs before the driver has responded to it, no
additional interrupts are generated. For example, the Receive Interrupt IDSTS[1] indicates that one or more data
were transferred to the Host buffer.
An interrupt is generated only once for concurrent events. The driver must scan the IDSTS register for the
interrupt cause.
9.14 Registers
SD/MMC controller registers can be accessed by the APB bus of the CPU.
The addresses in this section are relative to the SD/MMC base address provided in Table 1-6 Peripheral Address
Mapping in Chapter 1 System and Memory.
S
TU
D STA
CS T_
_C UP
SE RT_ SD OP RR
ET
NS
O C ST TE
ES
O
(re _W _R AT
AB D_C TO_ _IN
_R
AD RQ _D
se AI S
N U E
E
SE D_A VIC
ER
RE D_I AD
CO _R ET
RO T
DM rve LE
T
NT ESE
LL
N RE
)
d)
(re EN )
FI _R )
N DE
FO ES
se B
ed
ed
T_ d
A d
A
ve
IN ve
SE A_
rv
rv
r
se
se
se
AT
(re
(re
(re
CE
31 25 24 23 12 11 10 9 8 7 6 5 4 3 2 1 0
CEATA_DEVICE_INTERRUPT_STATUS Software should appropriately write to this bit after the power-
on reset or any other reset to the CE-ATA device. After reset, the CE-ATA device’s interrupt is
usually disabled (nIEN = 1). If the host enables the CE-ATA device’s interrupt, then software
should set this bit. (R/W)
SEND_CCSD When set, SD/MMC sends CCSD to the CE-ATA device. Software sets this bit only if
the current command is expecting CCS (that is, RW_BLK), and if interrupts are enabled for the
CE-ATA device. Once the CCSD pattern is sent to the device, SD/MMC automatically clears the
send_ccsd bit. It also sets the Command Done (CD) bit in the RINTSTS register, and generates
an interrupt for the host, in case the Command Done interrupt is not masked. NOTE: Once the
send_ccsd bit is set, it takes two card clock cycles to drive the CCSD on the CMD line. Due to
this, within the boundary conditions the CCSD may be sent to the CE-ATA device, even if the
device has signalled CCS. (R/W)
SEND_IRQ_RESPONSE Bit automatically clears once response is sent. To wait for MMC card inter-
rupts, host issues CMD40 and waits for interrupt response from MMC card(s). In the meantime,
if host wants SD/MMC to exit waiting for interrupt state, it can set this bit, at which time SD/MMC
command state-machine sends CMD40 response on bus and returns to idle state. (R/W)
DMA_RESET To reset DMA interface, firmware should set bit to 1. This bit is auto-cleared after two
AHB clocks. (R/W)
FIFO_RESET To reset FIFO, firmware should set bit to 1. This bit is auto-cleared after completion
of reset operation. Note: FIFO pointers will be out of reset after 2 cycles of system clocks in
addition to synchronization delay (2 cycles of card clock), after the fifo_reset is cleared. (R/W)
CONTROLLER_RESET To reset controller, firmware should set this bit. This bit is auto-cleared after
two AHB and two cclk_in clock cycles. (R/W)
0
2
3
R1
R
ER
ER
DE
DE
ID
D
VI
VI
VI
V
DI
DI
DI
DI
K_
K_
K_
K_
CL
CL
CL
CL
31 24 23 16 15 8 7 0
CLK_DIVIDER3 Clock divider-3 value. Clock division factor is 2*n, where n=0 bypasses the divider
(division factor of 1). For example, a value of 1 means divide by 2*1 = 2, a value of 0xFF means
divide by 2*255 = 510, and so on. In MMC-Ver3.3-only mode, these bits are not implemented
because only one clock divider is supported. (R/W)
CLK_DIVIDER2 Clock divider-2 value. Clock division factor is 2*n, where n=0 bypasses the divider
(division factor of 1). For example, a value of 1 means divide by 2*1 = 2, a value of 0xFF means
divide by 2*255 = 510, and so on. In MMC-Ver3.3-only mode, these bits are not implemented
because only one clock divider is supported. (R/W)
CLK_DIVIDER1 Clock divider-1 value. Clock division factor is 2*n, where n=0 bypasses the divider
(division factor of 1). For example, a value of 1 means divide by 2*1 = 2, a value of 0xFF means
divide by 2*255 = 510, and so on. In MMC-Ver3.3-only mode, these bits are not implemented
because only one clock divider is supported. (R/W)
CLK_DIVIDER0 Clock divider-0 value. Clock division factor is 2*n, where n=0 bypasses the divider
(division factor of 1). For example, a value of 1 means divide by 2*1 = 2, a value of 0xFF means
divide by 2*255 = 510, and so on. In MMC-Ver3.3-only mode, these bits are not implemented
because only one clock divider is supported. (R/W)
G
RE
)
ed
C_
rv
R
KS
se
(re
CL
31 4 3 0
CLKSRC_REG Clock divider source for two SD cards is supported. Each card has two bits assigned
to it. For example, bit[1:0] are assigned for card 0, bit[3:2] are assigned for card 1. Card 0 maps
and internally routes clock divider[0:3] outputs to cclk_out[1:0] pins, depending on bit value.
00 : Clock divider 0;
01 : Clock divider 1;
10 : Clock divider 2;
11 : Clock divider 3.
In MMC-Ver3.3-only controller, only one clock divider is supported. The cclk_out is always from
clock divider 0, and this register is not implemented. (R/W)
L
BE
NA
)
ed
_E
rv
LK
se
CC
(re
31 2 1 0
CCLK_ENABEL Clock-enable control for two SD card clocks and one MMC card clock is supported.
0: Clock disabled;
1: Clock enabled.
In MMC-Ver3.3-only mode, since there is only one cclk_out, only cclk_enable[0] is used. (R/W)
UT
EO
M
UT
I
_T
EO
SE
M
ON
I
_T
SP
TA
DA
RE
31 8 7 0
DATA_TIMEOUT Value for card data read timeout. This value is also used for data starvation by
host timeout. The timeout counter is started only after the card clock is stopped. This value is
specified in number of card output clocks, i.e. cclk_out of the selected card.
NOTE: The software timer should be used if the timeout value is in the order of 100 ms. In this
case, read data timeout interrupt needs to be disabled. (R/W)
RESPONSE_TIMEOUT Response timeout value. Value is specified in terms of number of card output
clocks, i.e., cclk_out. (R/W)
4
TH
TH
ID
ID
)
)
ed
ed
W
W
rv
rv
D_
D_
se
se
R
R
(re
(re
CA
CA
31 18 17 16 15 2 1 0
CARD_WIDTH4 One bit per card indicates if card is 1-bit or 4-bit mode.
0: 1-bit mode;
1: 4-bit mode.
Bit[1:0] correspond to card[1:0] respectively. Only NUM_CARDS*2 number of bits are imple-
mented. (R/W)
SI
ed
K_
rv
OC
se
(re
BL
31 16 15 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x00200 Reset
31 0
0x000000200 Reset
BYTCNT_REG Number of bytes to be transferred, should be an integral multiple of Block Size for
block transfers. For data transfers of undefined byte lengths, byte count should be set to 0.
When byte count is set to 0, it is the responsibility of host to explicitly send stop/abort command
to terminate data transfer. (R/W)
K
AS
_M
)
K
ed
NT
AS
rv
_I
M
se
IO
T_
(re
SD
IN
31 18 17 16 15 0
SDIO_INT_MASK SDIO interrupt mask, one bit for each card. Bit[17:16] correspond to card[15:0]
respectively. When masked, SDIO interrupt detection for that card is disabled. 0 masks an
interrupt, and 1 enables an interrupt. In MMC-Ver3.3-only mode, these bits are always 0. (R/W)
INT_MASK These bits used to mask unwanted interrupts. A value of 0 masks interrupt, and a value
of 1 enables the interrupt. (R/W)
Bit 15 (EBE): End-bit error, read/write (no CRC)
Bit 14 (ACD): Auto command done
Bit 13 (SBE/BCI): Start Bit Error/Busy Clear Interrupt
Bit 12 (HLE): Hardware locked write error
Bit 11 (FRUN): FIFO underrun/overrun error
Bit 10 (HTO): Data starvation-by-host timeout/Volt_switch_int
Bit 9 (DRTO): Data read timeout
Bit 8 (RTO): Response timeout
Bit 7 (DCRC): Data CRC error
Bit 6 (RCRC): Response CRC error
Bit 5 (RXDR): Receive FIFO data request
Bit 4 (TXDR): Transmit FIFO data request
Bit 3 (DTO): Data transfer over
Bit 2 (CD): Command done
Bit 1 (RE): Response error
Bit 0 (CD): Card detect
31 0
0x000000000 Reset
Y
NL
_O
RS
E
ET
TE
_E GT RC
DA D/W _M OP PL
IS
SE EN E_C
ND RV _C ION
CK ICE
EG
A ER ST M
XP H
T
RE NSF TO_ _CO
TR _A DAT MD
EC
_R
LO EV
CH _E ITE DE
SE _P RT AT
ON E_L NS
RE PON ESP D
DA EA ED
AI B LIZ
_C _D
TA R O
S R TE
SP S O
A U A
BE
UP D_C ECT
RE K_ EC
TE TA
W P_A TIA
X
US rve D
UM
(re rve E
DE
T O
se CM
(re _HO )
(re rve )
se d )
(re rve )
CC rve )
RE _EX )
EC P
E d
se d
se L
se d
se d
S d
A P
O NI
X
_N
(re rve
IN
ST _I
(re T_
D_
RD
ND
AR
CM
CA
SE
ST
31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 8 7 6 5 0
START_CMD Start command. Once command is served by the CIU, this bit is automatically cleared.
When this bit is set, host should not attempt to write to any command registers. If a write is
attempted, hardware lock error is set in raw interrupt register. Once command is sent and a
response is received from SD_MMC_CEATA cards, Command Done bit is set in the raw interrupt
Register. (R/W)
USE_HOLE Use Hold Register. (R/W) 0: CMD and DATA sent to card bypassing HOLD Register; 1:
CMD and DATA sent to card through the HOLD Register.
UPDATE_CLOCK_REGISTERS_ONLY (R/W)
0: Normal command sequence.
1: Do not send commands, just update clock register value into card clock domain
Following register values are transferred into card clock domain: CLKDIV, CLRSRC, and CLKENA.
Changes card clocks (change frequency, truncate off or on, and set low-frequency mode). This
is provided in order to change clock frequency or stop clock without having to send command
to cards.
During normal command sequence, when update_clock_registers_only = 0, following control
registers are transferred from BIU to CIU: CMD, CMDARG, TMOUT, CTYPE, BLKSIZ, and BYTCNT.
CIU uses new register values for new command sequence to card(s). When bit is set, there are
no Command Done interrupts because no command is sent to SD_MMC_CEATA cards.
CARD_NUMBER Card number in use. Represents physical slot number of card being accessed. In
MMC-Ver3.3-only mode, up to two cards are supported. In SD-only mode, up to two cards are
supported. (R/W)
SEND_INITIALIZATION (R/W)
0: Do not send initialization sequence (80 clocks of 1) before sending this command.
1: Send initialization sequence before sending this command.
After power on, 80 clocks must be sent to card for initialization before sending any commands
to card. Bit should be set while sending first command to card so that controller will initialize
clocks before sending command to card.
STOP_ABORT_CMD (R/W)
0: Neither stop nor abort command can stop current data transfer. If abort is sent to function-
number currently selected or not in data-transfer mode, then bit should be set to 0.
1: Stop or abort command intended to stop current data transfer in progress. When open-ended
or predefined data transfer is in progress, and host issues stop or abort command to stop data
transfer, bit should be set so that command/data state-machines of CIU can return correctly to
idle state.
WAIT_PRVDATA_COMPLETE (R/W)
0: Send command at once, even if previous data transfer has not completed;
1: Wait for previous data transfer to complete before sending Command.
The wait_prvdata_complete = 0 option is typically used to query status of card during data trans-
fer or to stop current data transfer. card_number should be same as in previous command.
SEND_AUTO_STOP (R/W)
0: No stop command is sent at the end of data transfer;
1: Send stop command at the end of data transfer.
TRANSFER_MODE (R/W)
0: Block data transfer command;
1: Stream data transfer command. Don’t care if no data expected.
READ/WRITE (R/W)
0: Read from card;
1: Write to card.
Don’t care if no data is expected from card.
DATA_EXPECTED (R/W)
0: No data transfer expected.
1: Data transfer expected.
CHECK_RESPONSE_CRC (R/W)
0: Do not check;
1: Check response CRC.
Some of command responses do not return valid CRC bits. Software should disable CRC checks
for those commands in order to disable CRC checking by controller.
RESPONSE_LENGTH (R/W)
0: Short response expected from card;
1: Long response expected from card.
RESPONSE_EXPECT (R/W)
0: No response expected from card;
1: Response expected from card.
31 0
0x000000000 Reset
31 0
0x000000000 Reset
31 0
0x000000000 Reset
31 0
0x000000000 Reset
SK
PT
_M
RU
ER
US
)
ed
NT
AT
rv
ST
_I
se
IO
T_
(re
SD
IN
31 18 17 16 15 0
SDIO_INTERRUPT_MSK Interrupt from SDIO card, one bit for each card. Bit[17:16] correspond
to card1 and card0, respectively. SDIO interrupt for card is enabled only if corresponding
sdio_int_mask bit is set in Interrupt mask register (Setting mask bit enables interrupt). (RO)
INT_STATUS_MSK Interrupt enabled only if corresponding bit in interrupt mask register is set. (RO)
Bit 15 (EBE): End-bit error, read/write (no CRC)
Bit 14 (ACD): Auto command done
Bit 13 (SBE/BCI): Start Bit Error/Busy Clear Interrupt
Bit 12 (HLE): Hardware locked write error
Bit 11 (FRUN): FIFO underrun/overrun error
Bit 10 (HTO): Data starvation by host timeout (HTO)
Bit 9 (DTRO): Data read timeout
Bit 8 (RTO): Response timeout
Bit 7 (DCRC): Data CRC error
Bit 6 (RCRC): Response CRC error
Bit 5 (RXDR): Receive FIFO data request
Bit 4 (TXDR): Transmit FIFO data request
Bit 3 (DTO): Data transfer over
Bit 2 (CD): Command done
Bit 1 (RE): Response error
Bit 0 (CD): Card detect
AW
_R
AW
PT
RU
_R
ER
US
)
ed
NT
AT
rv
ST
_I
se
IO
T_
(re
SD
IN
31 18 17 16 15 0
SDIO_INTERRUPT_RAW Interrupt from SDIO card, one bit for each card. Bit[17:16] correspond to
card1 and card0, respectively. Setting a bit clears the corresponding interrupt bit and writing 0
has no effect. (R/W)
0: No SDIO interrupt from card;
1: SDIO interrupt from card.
In MMC-Ver3.3-only mode, these bits are always 0. Bits are logged regardless of interrupt-mask
status. (R/W)
INT_STATUS_RAW Setting a bit clears the corresponding interrupt and writing 0 has no effect. Bits
are logged regardless of interrupt mask status. (R/W)
Bit 15 (EBE): End-bit error, read/write (no CRC)
Bit 14 (ACD): Auto command done
Bit 13 (SBE/BCI): Start Bit Error/Busy Clear Interrupt
Bit 12 (HLE): Hardware locked write error
Bit 11 (FRUN): FIFO underrun/overrun error
Bit 10 (HTO): Data starvation by host timeout (HTO)
Bit 9 (DTRO): Data read timeout
Bit 8 (RTO): Response timeout
Bit 7 (DCRC): Data CRC error
Bit 6 (RCRC): Response CRC error
Bit 5 (RXDR): Receive FIFO data request
Bit 4 (TXDR): Transmit FIFO data request
Bit 3 (DTO): Data transfer over
Bit 2 (CD): Command done
Bit 1 (RE): Response error
Bit 0 (CD): Card detect
S
TE
SY
K
ER RK
TA
BU
AR
_S
AT A
X
_3 Y C_
M
W RM
E
M
S
ND
TA US M
TU
FS
X_ TE
DA _B TE_
T
_I
FI _TX TY
TA
D_
_R WA
UN
SE
FI _EM L
se d)
P
_S
TA TA
FO L
ed
AN
FO _
O
FI _FU
ON
(re rve
DA _S
_C
rv
M
SP
se
M
TA
FO
FO
FO
CO
(re
DA
RE
FI
FI
31 30 29 17 16 11 10 9 8 7 4 3 2 1 0
RESPONSE_INDEX Index of previous response, including any auto-stop sent by core. (RO)
FIFO_TX_WATERMARK FIFO reached Transmit watermark level, not qualified with data transfer. (RO)
FIFO_RX_WATERMARK FIFO reached Receive watermark level, not qualified with data transfer. (RO)
IZE
_S
ON
I
CT
SA
AN
TR
E_
PL
TI
K
UL
d)
d)
AR
AR
ed
ve
ve
M
M
rv
A_
r
r
_W
_W
se
se
se
DM
(re
(re
(re
RX
TX
31 30 28 27 26 16 15 12 11 0
RX_WMARK FIFO threshold watermark level when receiving data to card.When FIFO data count
reaches greater than this number (FIFO_RX_WATERMARK), DMA/FIFO request is raised. During
end of packet, request is generated regardless of threshold programming in order to complete
any remaining data.In non-DMA mode, when receiver FIFO threshold (RXDR) interrupt is enabled,
then interrupt is generated instead of DMA request.During end of packet, interrupt is not gen-
erated if threshold programming is larger than any remaining data. It is responsibility of host to
read remaining bytes on seeing Data Transfer Done interrupt.In DMA mode, at end of packet,
even if remaining bytes are less than threshold, DMA request does single transfers to flush out
any remaining bytes before Data Transfer Done interrupt is set. (R/W)
TX_WMARK FIFO threshold watermark level when transmitting data to card. When FIFO data count
is less than or equal to this number (FIFO_TX_WATERMARK), DMA/FIFO request is raised. If In-
terrupt is enabled, then interrupt occurs. During end of packet, request or interrupt is generated,
regardless of threshold programming.In non-DMA mode, when transmit FIFO threshold (TXDR)
interrupt is enabled, then interrupt is generated instead of DMA request. During end of packet,
on last interrupt, host is responsible for filling FIFO with only required remaining bytes (not be-
fore FIFO is full or after CIU completes data transfers, because FIFO may not be empty). In DMA
mode, at end of packet, if last transfer is less than burst size, DMA controller does single cycles
until required bytes are transferred. (R/W)
_N
CT
TE
)
ed
DE
rv
D_
se
R
(re
CA
31 2 1 0
CARD_DETECT_N Value on card_detect_n input ports (1 bit per card), read-only bits.0 represents
presence of card. Only NUM_CARDS number of bits are implemented. (RO)
T
EC
OT
)
PR
ed
_
rv
TE
se
RI
(re
W
31 2 1 0
WRITE_PROTECT Value on card_write_prt input ports (1 bit per card).1 represents write protection.
Only NUM_CARDS number of bits are implemented. (RO)
31 0
0x000000000 Reset
31 0
0x000000000 Reset
TBBCNT_REG Number of bytes transferred between Host/DMA memory and BIU FIFO. (RO)
NT
OU
_C
CE
)
ed
UN
rv
BO
se
(re
DE
31 24 23 0
0 0 0 0 0 0 0 0 0x0000000 Reset
DEBOUNCE_COUNT Number of host clocks (clk) used by debounce filter logic. The typical de-
bounce time is 5 ~ 25 ms to prevent the card instability when the card is inserted or removed.
(R/W)
31 0
0x000000000 Reset
USRID_REG User identification register, value set by user. Default reset value can be picked by
user while configuring core before synthesis. Can also be used as a scratchpad register by user.
(R/W)
ET
ES
_R
)
RD
ed
CA
rv
se
T_
(re
RS
31 2 1 0
0 0x1 Reset
RST_CARD_RESET Hardware reset.1: Active mode; 0: Reset. These bits cause the cards to enter
pre-idle state, which requires them to be re-initialized. CARD_RESET[0] should be set to 1’b0 to
reset card0, CARD_RESET[1] should be set to 1’b0 to reset card1.The number of bits implemented
is restricted to NUM_CARDS. (R/W)
R
BL
W
)
)
E
OD FB
ed
ed
_D
_P
_S
BM D_
rv
rv
OD
OD
se
se
O
BM
BM
BM
(re
(re
31 11 10 8 7 6 2 1 0
BMOD_PBL Programmable Burst Length. These bits indicate the maximum number of beats to be
performed in one IDMAC transaction. The IDMAC will always attempt to burst as specified in PBL
each time it starts a burst transfer on the host bus. The permissible values are 1, 4, 8, 16, 32, 64,
128 and 256. This value is the mirror of MSIZE of FIFOTH register. In order to change this value,
write the required value to FIFOTH register. This is an encode value as follows:
000: 1-byte transfer; 001: 4-byte transfer; 010: 8-byte transfer; 011: 16-byte transfer; 100: 32-
byte transfer; 101: 64-byte transfer; 110: 128-byte transfer; 111: 256-byte transfer.
PBL is a read-only value and is applicable only for data access, it does not apply to descriptor
access. (R/W)
BMOD_FB Fixed Burst. Controls whether the AHB Master interface performs fixed burst transfers
or not. When set, the AHB will use only SINGLE, INCR4, INCR8 or INCR16 during start of normal
burst transfers. When reset, the AHB will use SINGLE and INCR burst transfer operations. (R/W)
BMOD_SWR Software Reset. When set, the DMA Controller resets all its internal registers. It is
automatically cleared after one clock cycle. (R/W)
31 0
0x000000000 Reset
PLDMND_REG Poll Demand. If the OWN bit of a descriptor is not set, the FSM goes to the Suspend
state. The host needs to write any value into this register for the IDMAC FSM to resume normal
descriptor fetch operation. This is a write only register, PD bit is write-only. (WO)
31 0
0x000000000 Reset
DBADDR_REG Start of Descriptor List. Contains the base address of the First Descriptor. The LSB
bits [1:0] are ignored and taken as all-zero by the IDMAC internally. Hence these LSB bits may
be treated as read-only. (R/W)
E
OD
_C
M
(re S_ S
BE
ID S_ E
(re NIS
)
S_ S
ID S_ )
s e DU
ST FB
ST CE
FS
ed
ed
ST d
ST AI
ST RI
TI
F
ID rve
S_
S_
ID S_
ID S_
S_
rv
rv
se
se
ST
ST
ST
ST
(re
ID
ID
ID
ID
31 17 16 13 12 10 9 8 7 6 5 4 3 2 1 0
IDSTS_FBE_CODE Fatal Bus Error Code. Indicates the type of error that caused a Bus Error. Valid
only when the Fatal Bus Error bit IDSTS[2] is set. This field does not generate an interrupt. (RO)
3b001: Host Abort received during transmission;
3b010: Host Abort received during reception;
Others: Reserved.
IDSTS_AIS Abnormal Interrupt Summary. Logical OR of the following: IDSTS[2] : Fatal Bus Interrupt,
IDSTS[4] : DU bit Interrupt. Only unmasked bits affect this bit. This is a sticky bit and must be
cleared each time a corresponding bit that causes AIS to be set is cleared. Writing 1 clears this
bit. (R/W)
IDSTS_NIS Normal Interrupt Summary. Logical OR of the following: IDSTS[0] : Transmit Interrupt,
IDSTS[1] : Receive Interrupt. Only unmasked bits affect this bit. This is a sticky bit and must be
cleared each time a corresponding bit that causes NIS to be set is cleared. Writing 1 clears this
bit. (R/W)
IDSTS_CES Card Error Summary. Indicates the status of the transaction to/from the card, also
present in RINTSTS. Indicates the logical OR of the following bits: EBE : End Bit Error, RTO :
Response Timeout/Boot Ack Timeout, RCRC : Response CRC, SBE : Start Bit Error, DRTO : Data
Read Timeout/BDS timeout, DCRC : Data CRC for Receive, RE : Response Error.
Writing 1 clears this bit. The abort condition of the IDMAC depends on the setting of this CES
bit. If the CES bit is enabled, then the IDMAC aborts on a response error. (R/W)
IDSTS_DU Descriptor Unavailable Interrupt. This bit is set when the descriptor is unavailable due to
OWN bit = 0 (DES0[31] =0). Writing 1 clears this bit. (R/W)
IDSTS_FBE Fatal Bus Error Interrupt. Indicates that a Bus Error occurred (IDSTS[12:10]) . When this
bit is set, the DMA disables all its bus accesses. Writing 1 clears this bit. (R/W)
IDSTS_RI Receive Interrupt. Indicates the completion of data reception for a descriptor. Writing 1
clears this bit. (R/W)
IDSTS_TI Transmit Interrupt. Indicates that data transmission is finished for a descriptor. Writing 1
clears this bit. (R/W)
ID TEN FBE
ID rve DU
I
TE AI
TE RI
TI
(re N_N
)
ID TEN )
ed
ed
IN d
IN _
IN _
se _
IN _
IN _
N_
ID TEN
ID TEN
rv
rv
se
se
N
IN
(re
I
ID
ID
31 10 9 8 7 6 5 4 3 2 1 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 0 Reset
IDINTEN_CES Card Error summary Interrupt Enable. When set, it enables the Card Interrupt sum-
mary. (R/W)
IDINTEN_DU Descriptor Unavailable Interrupt. When set along with Abnormal Interrupt Summary
Enable, the DU interrupt is enabled. (R/W)
IDINTEN_FBE Fatal Bus Error Enable. When set with Abnormal Interrupt Summary Enable, the Fatal
Bus Error Interrupt is enabled. When reset, Fatal Bus Error Enable Interrupt is disabled. (R/W)
IDINTEN_RI Receive Interrupt Enable. When set with Normal Interrupt Summary Enable, Receive
Interrupt is enabled. When reset, Receive Interrupt is disabled. (R/W)
IDINTEN_TI Transmit Interrupt Enable. When set with Normal Interrupt Summary Enable, Transmit
Interrupt is enabled. When reset, Transmit Interrupt is disabled. (R/W)
31 0
0x000000000 Reset
DSCADDR_REG Host Descriptor Address Pointer, updated by IDMAC during operation and cleared
on reset. This register points to the start address of the current descriptor read by the IDMAC.
(RO)
31 0
0x000000000 Reset
BUFADDR_REG Host Buffer Address Pointer, updated by IDMAC during operation and cleared on
reset. This register points to the current Data Buffer Address being accessed by the IDMAC.
(RO)
EL
L
E
SE
_S
S
V_
F_
DR
SA
L
_N
_S
L
E_
E_
E_
E
GE
GE
DG
DG
DG
DG
ED
ED
)
_E
_E
_E
_E
ed
N_
N_
IN
IN
IN
IN
rv
I
LK
LK
LK
LK
LK
LK
se
CC
CC
CC
CC
CC
CC
(re
31 21 20 17 16 13 12 9 8 6 5 3 2 0
CCLKIN_EDGE_L The low level of the divider clock. The value should be larger than
CCLKIN_EDGE_H. (R/W)
CCLKIN_EDGE_H The high level of the divider clock. The value should be smaller than
CCLKIN_EDGE_L. (R/W)
CCLKIN_EDGE_SLF_SEL It is used to select the clock phase of the internal signal from phase90,
phase180, or phase270. (R/W)
CCLKIN_EDGE_SAM_SEL It is used to select the clock phase of the input signal from phase90,
phase180, or phase270. (R/W)
CCLKIN_EDGE_DRV_SEL It is used to select the clock phase of the output signal from phase90,
phase180, or phase270. (R/W)
10.1 Overview
Features of Ethernet
By using the external Ethernet PHY (physical layer), ESP32 can send and receive data via Ethernet MAC (Media
Access Controller) according to the IEEE 802.3 standard, as Figure 10-1 shows. Ethernet is currently the most
commonly used network protocol that controls how data is transmitted over local- and wide-area networks,
abbreviated as LAN and WAN, respectively.
• Two industry-standard interfaces conforming with IEEE 802.3-2002: Media-Independent Interface (MII)
and Reduced Media-Independent Interface (RMII).
• Support for a data transmission rate of 10 Mbit/s or 100 Mbit/s through an external PHY interface
• Communication with an external Fast Ethernet PHY through IEEE 802.3-compliant MII and RMII interfaces
• Support for:
– Carrier Sense Multiple Access / Collision Detection (CSMA/CD) protocol in half-duplex mode
– operations in full-duplex mode, forwarding the received pause-control frame to the user application
– If the flow control input signal disappears during a full-duplex operation, a pause frame with zero
pause time value is automatically transmitted.
• The Preamble and the Start Frame Delimiter (SFD) are inserted in the Transmit path, and deleted in the
Receive path.
• Cyclic Redundancy Check (CRC) and Pad can be controlled on a per-frame basis.
• The Pad is generated automatically, if data is below the minimum frame length.
– All frames in mixed mode can be transmitted without being filtered for network monitoring
– A status report is attached each time all incoming packets are transmitted and filtered
• Use of the Management Data Input/Output (MDIO) interface to configure and manage PHY devices
• Support for the offloading of received IPv4 and TCP packets encapsulated by an Ethernet frame in the
reception function
• Support for checking IPv4 header checksums, as well as TCP, UDP, or ICMP (Internet Control Message
Protocol) checksums encapsulated in IPv4/IPv6 packets in the enhanced reception function
• Two sets of FIFOs: one 2 KB Tx FIFO with programmable threshold and one 2 KB Rx FIFO with configurable
threshold (64 bytes by default)
• When Rx FIFO stores multiple frames, the Receive Status Vector is inserted into the Rx FIFO after trans-
mitting an EOF (end of frame), so that the Rx FIFO does not need to store the Receive Status of these
frames.
• In store-and-forward mode, all error frames can be filtered during reception, but not forwarded to the
application.
• Support for data statistics by generating pulses for lost or corrupted frames in the Rx FIFO due to an
overflow
• Support for store-and-forward mechanism when transmitting data to the MAC core
• Automatic re-transmission of collided frames during transmission (subject to certain conditions, see sec-
tion 10.2.1.2)
• Discarding frames in cases of late collisions, excessive collisions, excessive deferrals, and under-run con-
ditions
• Calculating the IPv4 header checksum, as well as the TCP, UDP, or ICMP checksum, and then inserting
them into frames transmitted in store-and-forward mode.
Ethernet MAC consists of the MAC-layer configuration register module and three layers: EMAC_CORE (MAC Core
Layer), EMAC_MTL (MAC Transition Layer), and EMAC_DMA (Direct Memory Access). Each of these three layers
has two directions: Tx and Rx. They are connected to the system through the Advanced High-Performance Bus
(AHB) and the Advanced Peripheral Bus (APB) on the chip. Off the chip, they communicate with the external
PHY through the MII and RMII interfaces to establish an Ethernet connection.
10.2 EMAC_CORE
The MAC supports many interfaces with the PHY chip. The PHY interface can be selected only once after reset.
The MAC communicates with the application side (DMA side), using the MAC Transmit Interface (MTI), MAC
Receive Interface (MRI) and the MAC Control Interface (MCI).
After the EOF (end of frame) is transmitted to the MAC, the MAC completes the normal transmission and yields
the Transmit Status to the MTL. If a normal collision (in half-duplex mode) occurs during transmission, the MAC
makes valid the Transmit Status in the MTL. It then accepts and drops all further data until the next SOF is
received. The MTL block should retransmit the same frame from SOF upon observing a retry request (in the
Status) from the MAC.
The MAC issues an underflow status if the MTL is not able to provide the data continuously during transmission.
During the normal transmission of a frame from MTL, if the MAC receives an SOF without getting an EOF for the
previous frame, it ignores the SOF and considers the new frame as a continuation of the previous one.
When the application sets the Flow Control Busy bit (FCB bit in the Flow Control Register) to 1, or when the Rx
FIFO is full, a pause frame is transmitted.
• If an application has requested flow control by setting the FCB bit in the Flow Control Register to 1, the MAC
will generate and send a single pause frame. The pause time value in the generated frame is the pause
time value programmed in the Flow Control Register. To extend or end the pause time before the time
specified in the previously transmitted pause frame, the application program must configure the pause
time value in the Flow Control Register to the appropriate value and, then, request another pause frame
transmission.
• If the application has requested flow control when the Rx FIFO is full, the MAC will generate and transmit a
pause frame. The value of the pause time of the generated frame is the pause time value programmed in
the Flow Control Register. If the Rx FIFO remains full during the configurable interval, which is determined
by the Pause Low Threshold bit (PLT) in the Flow Control Register before the pause time expires, a second
pause frame will be transmitted. As long as the Rx FIFO remains full, the process repeats itself. If the FIFO
is no longer full before the sample time, the MAC will send a pause frame with zero pause time, indicating
to the remote end that the Rx buffer is ready to receive the new data frame.
The MAC transmitter may abort the transmission of a frame because of collision, Tx FIFO underflow, loss of
carrier, jabber timeout, no carrier, excessive deferral, and late collision. When frame transmission is aborted
because of collision, the MAC requests retransmission of the frame.
The frame received by the MAC will be pushed into the Rx FIFO. Once the FIFO status exceeds the Receive
Threshold, configured by the Receive Threshold Control (RTC) bit in the Operation Mode register, the DMA can
initiate a preconfigured burst transmission to the AHB interface.
In the default pass-through mode, when the FIFO receives a complete packet or 64 bytes configured by the
RTC bit in the Operation Mode Register, the data pops up and its availability is notified to the DMA. After the DMA
initiates the transmission to the AHB interface, the data transmission continues from the FIFO until the complete
packet is transmitted. Upon completing transmitting the EOF, the status word will pop up and be transmitted to
the DMA controller.
In the Rx FIFO Store-and-Forward mode (configured through the RSF or Receive Store and Forward bit in the
Operation Mode Register), only the valid frames are read and forwarded to the application. In the passthrough
mode, error frames are not discarded because the error status is received at the end of the frame. The start of
frame will have been read from the FIFO at that point.
If the received frame length/type is less than 0x600 and the automatic CRC/Pad removal option is programmed
for the MAC, the MAC will send frame data to the Rx FIFO (the amount of data does not exceed the number
specified in the length/type field). Then MAC begins discarding the remaining section, including the FCS field.
If the frame length/type is greater than, or equal to, 0x600, the MAC will send all received Ethernet frame data
to the Rx FIFO, regardless of the programmed value of the automatic CRC removal option. By default, the MAC
watchdog timer is enabled, meaning that frames, including DA, SA, LT, data, pad and FCS, which exceed 2048
bytes, are cut off. This function can be disabled by programming the Watchdog Disable (WD) bit in the MAC
Configuration Register. However, even if the watchdog timer is disabled, frames longer than 16 KB will be cut
off and the watchdog timeout status will be given.
The MAC will also decode the type, the opcode, and the pause timer field of the Receive Control Frame. If
the value of the status byte counter is 64 bits and there are no CRC errors, the MAC transmitter will halt the
transmission of any data frame. The duration of the pause is the decoded pause time value multiplied by the
interval (which is 64 bytes for both 10 Mbit/s and 100 Mb/s modes). At the same time, if another pause frame
of zero pause time is detected, the MAC will reset the pause time to manage the new pause request.
If the type field (0x8808), the opcode (0x00001), and the byte length (64 bytes) of the received control frame
are not 0x8808, 0x00001, and 64 bytes, respectively, or if there is a CRC error, the MAC will not generate a
pause.
If a pause frame has a multicast destination address, the MAC filters the frame, according to the address match-
ing.
For pause frames with a unicast destination address, the MAC checks whether the DA matches the content of
the EMACADDR0 Register, and whether the Unicast Pause Frame Detect (UPFD) bit in the Flow Control Register
is set to 1. The Pass Control Frames (PCF) bits in the Frame Filter Register [7:6] control the filtering of frames
and addresses.
If the function that corresponds to the Flush Transmit FIFO (FTF) bit and the Forward Undersized Good Frames
(FUGF) bit in the Operation Mode Register is enabled, the Rx FIFO can filter error frames and runt frames.
If the receive FIFO is configured to operate in store-and-forward mode, all error frames will be filtered and
discarded.
In passthrough mode, if a frame’s status and length are available when reading a SOF from the Rx FIFO, the entire
error frame can be discarded. DMA can clear the error frame being read from the FIFO by enabling the Receive
Frame Clear bit. The data transmission to the application (DMA) will then stop, and the remaining frames will be
read internally and discarded. If FIFO is available, the transmission of the next frame will be initiated.
The interrupt register bits only indicate various interrupt events. To clear the interrupts, the corresponding status
register and other registers must be read. An Interrupt Status Register describes the events that prompt the MAC
core to generate interrupts. Each interrupt event can be prevented by setting the corresponding mask bit in
the Interrupt Mask Register to 1. For example, if bit3 of the interrupt register is set high, it indicates that a magic
packet or Wake-on-LAN frame has been received in Power-down mode. The PMT Control and Status register
must be read to clear this interrupt event.
Physical (MAC) addresses are used for address checking during address filtering.
In perfect filtering mode, the multicast address is compared with the programmed MAC Destination Address
Registers (EMACADDR0 ~ EMACADDR7). Group address filtering is also supported.
When the SAF enable bit is set to 1, the result of the SA filtering and DA filtering is AND’ed to determine whether
or not to forward the frame. Any frame that fails to pass will be discarded. Frames need to pass both filterings
in order to be forwarded to the application.
The following two tables summarize the destination address and source address filtering, based on the type of
the frames received.
The filtering parameters in the MAC Frame Filter Register described in Table 10-1 are as follows.
The filtering parameters in the MAC Frame Filter Register described in Table 10-2 are as follows.
• Jabber timeout
• Late collision
• Frame underflow
• Excessive deferral
• Excessive collision
The received frames are considered ”good frames”, if there are not any of the following errors:
• CRC error
• Frame size over the maximum size (for non-type frames over the maximum frame size only)�
For details please refer to Register Summary and Linked List Descriptors.
• MII_TX_CLK: TX clock signal. This signal provides the reference timing for TX data transmission. The
frequencies are divided into two types: 2.5 MHz at a data transmission rate of 10 Mbit/s, and 25 MHz at
100 Mbit/s.
• MII_TXD[3:0]: Transmit data signal in groups of four, syn-driven by the MAC sub-layer, and valid only
when the MII_TX_EN signal is valid. MII_TXD[0] is the lowest significant bit and MII_TXD[3] is the highest
significant bit. When the signal MII_TX_EN is pulled low, sending data does not have any effect on the
PHY.
• MII_TX_EN: Transmit data enable signal. This signal indicates that the MAC is currently sending nibbles
(4 bits) for the MII. This signal must be synchronized with the first nibble of the header (MII_TX_CLK) and
must be synchronized when all nibbles to be transmitted are sent to the MII.
• MII_RX_CLK: RX clock signal. This signal provides the reference timing for RX data transmission. The
frequencies are divided into two types: 2.5 MHz at the data transmission rate of 10 Mbit/s, and 25 MHz
at 100 Mbit/s.
• MII_RXD[3:0]: Receive data signal in groups of four, syn-driven by the PHY, and valid only when MII_RX_DV
signal is valid. MII_RXD[0] is the lowest significant bit and MII_RXD[3] is the highest significant bit. When
MII_RX_DV is disabled and MII_RX_ER is enabled, the specific MII_RXD[3:0] value represents specific
information from the PHY.
• MII_RX_DV: Receive data valid signal. This signal indicates that the PHY is currently receiving the recov-
ered and decoded nibble that will be transmitted to the MII. This signal must be synchronized with the first
nibble of the recovered frame (MII_RX_CLK) and remain synchronized till the last nibble of the recovered
frame. This signal must be disabled before the first clock cycle following the last nibble. In order to re-
ceive the frame correctly, the MII_RX_DV signal must cover the frame to be received over the time range,
starting no later than when the SFD field appears.
• MII_CRS: Carrier sense signal. When the transmitting or receiving medium is in the non-idle state, the
signal is enabled by the PHY. When the transmitting or receiving medium is in the idle state, the signal
is disabled by the PHY. The PHY must ensure that the MII_CRS signal remains valid under conflicting
conditions. This signal does not need to be synchronized with the TX and RX clocks. In full-duplex mode,
this signal is insignificant.
• MII_COL: Collision detection signal. After a collision is detected on the medium, the PHY must immediately
enable the collision detection signal, and the collision detection signal must remain active as long as a
condition for collision exists. This signal does not need to be synchronized with the TX and RX clocks. In
full-duplex mode, this signal is meaningless.
• MII_RX_ER: Receive error signal. The signal must remain for one or more cycles (MII_RX_CLK) to indicate
to the MAC sublayer that an error has been detected somewhere in the frame.
• MDIO and MDC: Management Data Input/Output and Management Data Clock. The two signals constitute
a serial bus defined for the Ethernet family of IEEE 802.3 standards, used to transfer control and data
information to the PHY, see section Station Management Agent (SMA) Interface.
• The same reference clock must be provided to the MAC and the external Ethernet PHY. The PHY provides
independent 2-bit-wide TX and RX data paths.
• Note: If Wi-Fi and Ethernet are used simultaneously, the RMII clock cannot be generated by the internal
APLL clock, as it would result in clock instability. In this case, please use an external PHY or external clock
source to provide the reference clock.
Please refer to Register Summary for details about the EMII Address Register and the EMII Data Register.
Reserved
OWN
Ctrl/status Status
TDES0 Ctrl[30:26] Ctrl[24:18] Status[16:7] [6:3] [2:0]
Ctrl
TDES1 [31:29] Reserved Transmit Buffer Size[12:0]
TDES4 Reserved
TDES5 Reserved
TDES6 Reserved
TDES7 Reserved
31 0
OWN
RDES0 Status[30:0]
Ctrl
Res
Ctrl
RDES1 Reserved[30:16] [15:14] Receive Buffer 1 Size[12:0]
RDES5 Reserved
RDES6 Reserved
RDES7 Reserved
• Latched-low (LL)
• Latched-high (LH)
10.10 Registers
The addresses in parenthesis besides register names are the register addresses relative to the EMAC base
address provided in Table 1-6 Peripheral Address Mapping in Chapter 1 System and Memory. The absolute
register addresses are listed in Section 10.9 Register Summary.
Note: The value of all reset registers must be set to the reset value.
EN
US 8_M LIB T
E_ O EA
A S
EN
_L
ZE
CH
LX DR R
L
SE DE
ST
RA ST
PB AD DBU
_L
PB
ST _S
PB
_S
IP
UR
R
O
P_
)
_R RB
SC
A_
PR BU
ed
K
A E
TI
_B
_S
X
SW _A
DE
M
rv
D_
DM MI
OG
SC
_D
se
A
I_
T_
A
XE
DM
DM
(re
DE
PR
RX
AL
FI
31 27 26 25 24 23 22 17 16 15 14 13 8 7 6 2 1 0
DMAMIXEDBURST When this bit is set high and the FB(FIXES_BURST) bit is low, the AHB master
interface starts all bursts of a length more than 16 with INCR (undefined burst), whereas it reverts
to fixed burst transfers (INCRx and SINGLE) for burst length of 16 and less. (R/W)
DMAADDRALIBEA When this bit is set high and the FB bit is 1, the AHB interface generates all bursts
aligned to the start address LS bits. If the FB bit is 0, the first burst (accessing the start address
of data buffer) is not aligned, but subsequent bursts are aligned to the address. (R/W)
PBLX8_MODE When set high, this bit multiplies the programmed PBL(PROG_BURST_LEN) value
(Bits[22:17] and Bits[13:8]) eight times. Therefore, the DMA transfers the data in 8, 16, 32, 64,
128, and 256 beats depending on the PBL value. (R/W)
USE_SEP_PBL When set high, this bit configures the Rx DMA to use the value configured in
Bits[22:17] as PBL. The PBL value in Bits[13:8] is applicable only to the Tx DMA operations. When
reset to low, the PBL value in Bits[13:8] is applicable for both DMA engines. (R/W)
RX_DMA_PBL This field indicates the maximum number of beats to be transferred in one Rx DMA
transaction. This is the maximum value that is used in a single block Read or Write.The Rx
DMA always attempts to burst as specified in the RPBL(RX_DMA_PBL) bit each time it starts
a burst transfer on the host bus. You can program RPBL with values of 1, 2, 4, 8, 16, and
32. Any other value results in undefined behavior. This field is valid and applicable only when
USP(USE_SEP_PBL) is set high. (R/W)
FIXED_BURST This bit controls whether the AHB master interface performs fixed burst transfers or
not. When set, the AHB interface uses only SINGLE, INCR4, INCR8, or INCR16 during start of
the normal burst transfers. When reset, the AHB interface uses SINGLE and INCR burst transfer
operations. (R/W)
PRI_RATIO These bits control the priority ratio in the weighted round-robin arbitration between the
Rx DMA and Tx DMA. These bits are valid only when Bit 1 (DA) is reset. The priority ratio Rx:Tx
represented by each bit: (R/W)
• 2’b00 — 1: 1
• 2’b01 — 2: 0
• 2’b10 — 3: 1
• 2’b11 — 4: 1
PROG_BURST_LEN These bits indicate the maximum number of beats to be transferred in one DMA
transaction. If the number of beats to be transferred is more than 32, then perform the following
steps: 1. Set the PBLx8 mode; 2. Set the PBL. (R/W)
ALT_DESC_SIZE When set, the size of the alternate descriptor increases to 32 bytes. (R/W)
DESC_SKIP_LEN This bit specifies the number of Word to skip between two unchained descriptors.
The address skipping starts from the end of current descriptor to the start of next descriptor.
When the DSL(DESC_SKIP_LEN) value is equal to zero, the descriptor table is taken as contigu-
ous by the DMA in Ring mode. (R/W)
DMA_ARB_SCH This bit specifies the arbitration scheme between the transmit and receive paths.
1’b0: weighted round-robin with RX: TX or TX: RX, priority specified in PR (bit[15:14]); 1’b1 Fixed
priority (Rx priority to Tx). (R/W)
SW_RST When this bit is set, the MAC DMA Controller resets the logic and all internal registers of
the MAC. It is cleared automatically after the reset operation is complete in all of the ETH_MAC
clock domains. Before reprogramming any register of the ETH_MAC, you should read a zero (0)
value in this bit. (R/WS/SC)
31 0
0x000000000 Reset
TRANS_POLL_DEMAND When these bits are written with any value, the DMA reads the current
descriptor to which the Register (Current Host Transmit Descriptor Register) is pointing. If that
descriptor is not available (owned by the Host), the transmission returns to the suspend state
and Bit[2] (TU) of Status Register is asserted. If the descriptor is available, the transmission
resumes. (RO/WT)
31 0
0x000000000 Reset
RECV_POLL_DEMAND When these bits are written with any value, the DMA reads the current de-
scriptor to which the Current Host Receive Descriptor Register is pointing. If that descriptor is
not available (owned by the Host), the reception returns to the Suspended state and Bit[7] (RU)
of Status Register is asserted. If the descriptor is available, the Rx DMA returns to the active
state. (RO/WT)
31 0
0x000000000 Reset
START_RECV_LIST This field contains the base address of the first descriptor in the Receive De-
scriptor list. The LSB Bits[1:0] are ignored and internally taken as all-zero by the DMA. Therefore,
these LSB bits are read-only. (R/W)
31 0
0x000000000 Reset
START_TRANS_LIST This field contains the base address of the first descriptor in the Transmit De-
scriptor list. The LSB Bits[1:0] are ignored and are internally taken as all-zero by the DMA. There-
fore, these LSB bits are read-only. (R/W)
IN _S AIL
T
E
P
IN
IL
AT
AN PR UN O
E
TO
S_ OC AV
TR V_IN _U OP
FA LY_R SU MM
TR NS_ UF_ _T
TR NS_ LO OW
VA
RE V_P T_T INT
R_
AT
ST
S_ T
TA E MM
T
A B ER
ST
C UF ST
A T NA
(re BU IN
ER
C_
F L
R T_ U
C D _
IN
AN JA W
C RO O
TR _O DF
RE _W NS
_
C_
RE V_B C_
TR S_ BB
EA IN _S
TS
T_
RO
L_ CV
T
_ )
CV UN
N_ NT
O
CV RA
(R ed)
EA ed)
(re PM
AC ed
BI
ed
PR
V
I
R_
S_
RE NS_
RE Y_T
EM erv
AB _
rv
rv
rv
_
RM
RO
AN
CV
se
se
se
RL
es
A
NO
(re
TR
ER
RE
31 30 29 28 27 26 25 23 22 20 19 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EMAC_PMT_INT This bit indicates an interrupt event in the PMT module of the ETH_MAC. The
software must read the PMT Control and Status Register in the MAC to get the exact cause of
interrupt and clear its source to reset this bit to 1’b0. (RO)