Skip to main content

ESP32 Simulation

The ESP32 is a popular WiFi and Bluetooth-enabled microcontroller, widely used for IoT Projects. Wokwi simulates the ESP32, ESP32-C3, ESP32-S2, ESP32-S3 (beta).

ESP32 boards

NameChipDescription
ESP32 DevKit v1ESP32Popular ESP32 development board
TinyPICOESP32Small ESP32 board by UnexpectedMaker
ESP32-S2-DevKitM-1ESP32-S2Entry-level ESP32-S2 development board
Franzininho WiFiESP32-S2Board by the Franzininho Community
ESP32-C3-DevKitM-1ESP32-C3Entry-level ESP32-C3 development board
Rust Board ESP32-C3ESP32-C3ESP32-C3 board for Rust development
ESP32-S3-DevKitC-1ESP32-S3Entry-level ESP32-C3 development board (beta)

You can contribute additional boards by sending a pull request to wokwi-boards.

Getting Started

You can use the ESP32 simulator in three ways:

  1. Build projects using the ESP32 Arduino Core (including ESP-IDF projects)
  2. Run MicroPython projects (also CircuitPython on the ESP32-S2)
  3. Simulate bin application files you built on your machine (e.g. using ESP-IDF)

Arduino Core

Start from the Arduino-ESP32 Project Template, or from the ESP32 Blink Example.

If you want to use third-party Arduino libraries, add a libraries.txt file with the list of libraries that you use.

MicroPython

Start from the MicroPython ESP32 Project Template, or from the MicroPython ESP32 Blink Example.

Note: While the simulation is running, press Ctrl+C inside the Serial Terminal to get into the MicroPython REPL. Alternatively, you can edit the Blink Example code and remove the while loop. For more information, check out the MicroPython Guide.

Custom Application (.bin) File

Open the ESP32 custom application project template, and press "F1" in the code editor. Then choose "Load HEX File and Start Simulation…". Choose any .bin file from your computer and the simulation will start.

Simulator Examples

Arduino Examples

MicroPython Examples

ESP-IDF Examples

The following examples use the ESP-IDF functions. They are compiled using Arduino ESP32 Core:

Simulation Features

PeripheralESP32S2S3C3Notes
Processor core(s)✔️✔️✔️✔️
GPIO✔️✔️🟡✔️Interrupts supported
IOMUX🟡🟡🟡🟡
PSRAM✔️✔️✔️4MB of external SRAM *
UART✔️✔️✔️✔️
USB✔️✔️Support for UART over USB (CDC)
I2C✔️✔️✔️✔️Master only. 10-bit addressing not supported.
I2SOpen for voting
SPI✔️✔️✔️✔️
TWAI
RMT🟡🟡🟡Transmit-only, use to control NeoPixels
LEDC PWM✔️✔️✔️Used by analogWrite(), Servo, Buzzer, etc.
MCPWM
DMA🟡🟡
WiFi✔️✔️✔️✔️See the ESP32 WiFi Guide
BluetoothOpen for voting
Timers🟡✔️🟡✔️
Watchdog
RTC🟡🟡🟡🟡Only RTC Pull-up / Pull-down resistors
ADC✔️✔️✔️Note: analogRead() returns values up to 4095
RNG✔️✔️✔️✔️Random Number Generator
AES Accelerator✔️✔️✔️
SHA Accelerator✔️✔️✔️
RSA Accelerator✔️✔️✔️
Hall Effect Sensor
ULP Processor
GDB Debugging🟡🟡🟡🟡Only through wokwi-gdbserver

Legend:
✔️ - Simulated
🟡 - Partial implementation/work in progress
❌ - Not implemented (but if you need it, please open a feature request)
— - Not available on this chip

* The amount of SRAM can be customized using the "psramSize" attribute.

WiFi Simulation

See the ESP32 WiFi Guide.

Advanced Usage

Flash and memory size

You can customize the size of flash and PSRAM by adding the following attributes to the chip:

AttributeDescriptionDefault
flashSizeFlash size in MB. Valid values: "2", "4", "8", "16", "32"."4"
psramSizePSRAM size in MB. Valid values: "2", "4", "8"."4"

Custom Partition Table

You can specifiy a custom partititon table by adding a "partitions.csv" file to your project. Check out the ESP32 Partition Table Guide for the exact format of this file.

Custom firmware offset

When loading a custom firmware, you can specify the offset of the firmware in the flash memory. By default, Wokwi will look at the firmware binary and try to figure out the offset automatically, based on the presence of the bootloader and the type of the chip. If Wokwi can't figure out the offset, it will assume that your firmware is an application firmware and load it at offset 0x10000.

You can specify the offset manually by adding the following attribute to the chip:

AttributeDescriptionDefault
firmwareOffsetOffset of the firmware in the flash memory, in bytes.""

Skipping the bootloader

On ESP32 and ESP32-S2 chips, Wokwi skips the boot ROM and the bootloader, so that your firmware starts running immediately. Other chips (ESP32-C3, ESP32-S3, etc.) always run the full boot sequence.

If you want Wokwi to always run the bootloader, you can add the following attribute to the chip:

AttributeDescriptionDefault
fullBootSet to "1" to simulate the complete boot sequence: boot ROM -> bootloader -> application.""