Under the hood
Memory, clocks and power modes
Where your code and data live, which clock drives what, and how much each power mode saves.
The address map
The CPU sees one big address space: ROM, internal SRAM, the flash and PSRAM through the caches, and the peripherals' registers.
| Region | Start | End | Size | Highlighted |
|---|---|---|---|---|
| External memory, data side | 0x3C000000 | 0x3DFFFFFF | 32 MB | Yes |
| Internal SRAM 1 (data bus) | 0x3FC88000 | 0x3FCEFFFF | 416 KB | Yes |
| Internal SRAM 2 | 0x3FCF0000 | 0x3FCFFFFF | 64 KB | |
| Internal ROM 1 (data bus) | 0x3FF00000 | 0x3FF1FFFF | 128 KB | |
| Internal ROM 0 | 0x40000000 | 0x4003FFFF | 256 KB | |
| Internal ROM 1 (instruction bus) | 0x40040000 | 0x4005FFFF | 128 KB | |
| Internal SRAM 0 | 0x40370000 | 0x40377FFF | 32 KB | |
| Internal SRAM 1 (instruction bus) | 0x40378000 | 0x403DFFFF | 416 KB | Yes |
| External memory, instruction side | 0x42000000 | 0x43FFFFFF | 32 MB | Yes |
| RTC SLOW memory | 0x50000000 | 0x50001FFF | 8 KB | |
| Peripheral registers | 0x60000000 | 0x600D0FFF | 836 KB | |
| RTC FAST memory | 0x600FE000 | 0x600FFFFF | 8 KB |
Where your sketch lives
- External memory, data side
32 MB window onto the PSRAM (read and write) and the flash (read only), through the data cache. Big buffers like a frame or a sound clip live here.
- Internal SRAM 1 (data bus)
416 KB, the same memory as SRAM 1 on the instruction bus. Your variables, heap and stacks.
- Internal SRAM 1 (instruction bus)
The same 416 KB as SRAM 1 on the data bus, seen as instruction memory: code placed in internal RAM runs from here.
- External memory, instruction side
32 MB window onto the flash (or PSRAM), through the instruction cache, in 64 KB pages. Code stored in flash runs from here.
The clock tree
One 40 MHz crystal feeds a PLL; dividers make the CPU, APB and peripheral clocks from it, while slow RC oscillators keep the RTC ticking in sleep.
| From | To | Via |
|---|---|---|
| XTAL_CLK, main crystal (40 MHz) | PLL_CLK (320 / 480 MHz) | |
| XTAL_CLK, main crystal (40 MHz) | CPU_CLK (80 / 160 / 240 MHz) | ÷ (n+1), 20 MHz at reset |
| PLL_CLK (320 / 480 MHz) | CPU_CLK (80 / 160 / 240 MHz) | ÷ 2, 3, 4 or 6 |
| RC_FAST_CLK, fast RC oscillator (17.5 MHz) | CPU_CLK (80 / 160 / 240 MHz) | |
| RC_FAST_CLK, fast RC oscillator (17.5 MHz) | RC_FAST_DIV_CLK (RC_FAST ÷ 256) | ÷ 256 |
| CPU_CLK (80 / 160 / 240 MHz) | CPU cores (240 MHz) | |
| CPU_CLK (80 / 160 / 240 MHz) | APB_CLK (80 MHz) | |
| CPU_CLK (80 / 160 / 240 MHz) | CRYPTO_PWM_CLK (160 MHz) | |
| PLL_CLK (320 / 480 MHz) | PLL_F160M_CLK (160 MHz) | |
| PLL_CLK (320 / 480 MHz) | PLL_D2_CLK | |
| PLL_CLK (320 / 480 MHz) | Wi-Fi and Bluetooth LE | |
| APB_CLK (80 MHz) | UART | |
| APB_CLK (80 MHz) | SPI | |
| APB_CLK (80 MHz) | RMT | |
| APB_CLK (80 MHz) | LED PWM | |
| APB_CLK (80 MHz) | SAR ADC | |
| XTAL_CLK, main crystal (40 MHz) | UART | |
| XTAL_CLK, main crystal (40 MHz) | I2C | |
| XTAL_CLK, main crystal (40 MHz) | I2S | |
| XTAL_CLK, main crystal (40 MHz) | LED PWM | |
| XTAL_CLK, main crystal (40 MHz) | System timer (16 MHz) | |
| RC_FAST_CLK, fast RC oscillator (17.5 MHz) | UART | |
| RC_FAST_CLK, fast RC oscillator (17.5 MHz) | I2C | |
| RC_FAST_CLK, fast RC oscillator (17.5 MHz) | LED PWM | keeps PWM running in light sleep |
| PLL_F160M_CLK (160 MHz) | I2S | |
| PLL_D2_CLK | I2S | |
| PLL_D2_CLK | SAR ADC | |
| CRYPTO_PWM_CLK (160 MHz) | Crypto accelerators | |
| RC_SLOW_CLK, slow RC oscillator (0.136 MHz) | RTC_SLOW_CLK | |
| XTAL32K_CLK, 32 kHz crystal (0.032 MHz) | RTC_SLOW_CLK | |
| RC_FAST_DIV_CLK (RC_FAST ÷ 256) | RTC_SLOW_CLK | |
| RTC_SLOW_CLK | RTC: power manager, RTC watchdog | |
| XTAL_CLK, main crystal (40 MHz) | RTC_FAST_CLK | ÷ 2 |
| RC_FAST_CLK, fast RC oscillator (17.5 MHz) | RTC_FAST_CLK | |
| RTC_FAST_CLK | ULP coprocessor, on-chip sensors (17.5 MHz) |
Power modes
Each step down the ladder switches more of the chip off, and the current drops by orders of magnitude.
Power off draws 340,000 times less than Active, Wi-Fi sending.
| Item | Value | Stays on |
|---|---|---|
| Active, Wi-Fi sending | 340 mA | CPU, RF circuits, Wi-Fi, all peripherals |
| Active, Bluetooth LE sending | 176 mA · ×1.9 less | CPU, RF circuits, Bluetooth LE, all peripherals |
| Active, listening | 88 mA · ×3.9 less | CPU, RF circuits, all peripherals |
| Modem-sleep | 66.2 mA · ×5.1 less | CPU, digital peripherals, RTC |
| Light-sleep | 0.24 mA · ×1,400 less | RTC, RAM contents, digital peripherals (optional) |
| Deep-sleep with the ULP running | 0.17 mA · ×2,000 less | RTC, RTC memory, ULP coprocessor |
| Deep-sleep | 0.008 mA · ×43,000 less | RTC, RTC memory |
| Power off | 0.001 mA · ×340,000 less |