esp32sim README

The project's README from github.com/mikroverk/esp32sim. As one markdown file: README.md.

esp32sim logo: a smiling chip in an emulator window

esp32sim

esp32sim is an ESP32 emulator written in Rust. It runs real ESP32 firmware on your computer or in a browser tab, without the hardware.

It boots the chip's own mask ROM, the real second-stage bootloader and your unmodified application. It also models the board around the chip: displays, touch, LEDs, buttons, audio, camera and WiFi.

Try it in your browser, nothing to install: https://mikroverk.github.io/esp32sim/

--chip esp32 --board ai-thinker-cam --cam-image image.ppm supplies the AI-Thinker ESP32-CAM's OV2640 with a BMP/PPM still image. Capture supports raw RGB565/YUV422 into internal DRAM at a fixed approximate 10 FPS; the usual JPEG+PSRAM CameraWebServer path is unsupported. See the camera scope and example.

Supported chips

Chip CPU Status Boards
ESP32-S3 2 x Xtensa LX7 mature Atech 14-port kit, Waveshare Touch-LCD-4B, Touch-AMOLED-1.8, ESP32-S3-CAM, M5Stack StopWatch
ESP32-C3 RISC-V RV32IMC draft console only
ESP32-C6 RISC-V RV32IMAC draft Waveshare ESP32-C6-LCD-1.47 (with the 802.15.4 radio), Seeed XIAO ESP32-C6
ESP32 (classic) 2 x Xtensa LX6 early LilyGO TTGO T-Display, ESP32-2432S028 "Cheap Yellow Display", AI-Thinker ESP32-CAM (raw capture), Ulanzi TC001
ESP32-P4 (rev < 3 and rev ≥ 3) 2 x RISC-V RV32IMAFC draft Waveshare ESP32-P4-WIFI6-Touch-LCD-3.5 (rev ≥ 3); WiFi through an emulated ESP32-C6 co-processor on SDIO (ESP-Hosted)
ESP32-S31 2 x RISC-V RV32IMAFC draft Espressif ESP-Mosaico (display, touch, WiFi, audio, IMU, keys); IDF v6.1

Features

Demos

These run on the demo site:

You can also load your own firmware for any of the chips.

Quick start

No Rust needed: the releases carry prebuilt binaries for macOS and Linux, and docs/quick-start.md takes your own build from the tarball to a run in three steps. From a checkout:

cargo build --release
tools/fetch-demo-assets.sh --no-linux       # downloads the mask ROMs, which are not in the repo

FW=web/wasm/fw/public                       # demo firmware included in the repo
./target/release/esp32sim --boot rom --rom web/wasm/fw/esp32s3_rev0_rom.elf \
    --bootloader $FW/atech-bootloader.bin --ptable $FW/atech-ptable.bin --app $FW/atech-firmware.bin \
    --script $FW/atech-script1.txt --wav out.wav --tft-png tft.png --max-seconds 5

This boots the Atech synth firmware, plays a short script, and saves the audio to out.wav and the display to tft.png. Use esp32sim-c3, esp32sim-c6, esp32sim-p4, esp32sim-s31 or --chip esp32 for the other chips.

Getting started covers the rest: your own ESP-IDF builds, each chip, WiFi, scripts, the browser build and debugging.

Documentation

Contributing

Bug fixes, peripherals, boards and new chips are welcome. CONTRIBUTING.md lists what a pull request needs; these are the same checks CI runs. Security problems go through SECURITY.md, not the public issue tracker.

Credits and license

esp32sim is released under the MIT License.

Authors: Joakim Eriksson, RISE (@joakimeriksson), Alice (@aliceisjustplaying) and Mattia Fiumara, Schematik (@mfiumara), together with other contributors.

The emulator was written from the ESP-IDF register headers, the Xtensa core configuration that ships with ESP-IDF, the RISC-V specification, the chips' technical reference manuals and observed firmware behaviour. QEMU was consulted only to confirm instruction semantics; no code was copied.

esp32sim is unofficial and not affiliated with Espressif Systems.

Third-party code, data and demo files keep their own licenses:

esp32sim (mikroverk/esp32sim)

Searching Database…

What is this?esp32sim is an open-source, instruction-level emulator for four ESP32 chips (classic ESP32, S3, C3, C6) that boots the real mask ROM, bootloader and an unmodified application image, with no patched firmware and no hardware required.
Is this a CLI tool or something I run in the browser?It is both: a native command-line emulator (esp32sim, esp32sim-c3, esp32sim-c6) and the same emulator compiled to WebAssembly so it runs directly in the browser with no install.
How do I get firmware running in it?Open the hosted browser demo and press Boot for a quick try, or run the matching CLI command and load your own firmware image from disk, picking the board or chip (esp32c3 / esp32c6) you need.
Do I need a real ESP32 board or an Espressif account to use it?No — it boots real ROM and bootloader images entirely in software, with no cloud account, no subscription and no physical hardware required.
Are the C3 and C6 emulators as mature as the S3?No, the classic ESP32 and S3 support is mature, but the C3 and C6 RISC-V emulators are still marked draft and currently run on a plain interpreter rather than the JIT.
Does the fast JIT need Apple Silicon, or does it work elsewhere too?The S3's speed comes from compiling hot instruction blocks to native AArch64 code; on other CPU architectures you can pass --no-jit to fall back to the plain interpreter, which is guaranteed to give identical results.
Is the whole project MIT, including the demo firmware it bundles?esp32sim itself is MIT, but it fetches or bundles third-party firmware and data (like a Linux kernel image) that keep their own, sometimes different, licenses such as GPL-3.0.
What boards and peripherals can the ESP32-S3 emulate?The S3 emulates displays like the ST7735 and a 480x480 touch ST7701S, WS2812 LEDs, a camera and audio, plus board support such as the LilyGO TTGO T-Display and the Touch-LCD-4B panel.
How accurate is the emulator compared to real hardware?Each chip is differentially tested against physical boards: the S3 runs in JTAG lock-step with zero PC divergence over thousands of steps, while the C3 and C6 match captured hardware console output on 205/208 and 203/204 lines respectively.
How fast does the emulator run compared to real time?The S3 combines a block interpreter with an AArch64 JIT reaching roughly 150-240 million instructions per second, fast enough to run real firmware (like a synth app) in real time except during the heaviest screen redraws, which briefly lag and then recover.
Can I debug firmware while it's running inside the emulator?Yes — flags like --trace, --break ADDR, --watch ADDR, --peek and --profile let you step through execution and inspect memory, with extra env vars to log peripheral activity such as SPI, WiFi, AES and SHA.
Creator
mikroverk
Size
73.8 MB
Stars
1.2K
Age
3mo
Commits · 90 Days