Skip to main content
Open Source · Browser + Node · WebAssembly

STM32F4 Emulator

Real Cortex-M4 firmware on an emulated MCU — Unicorn CPU + Rust peripherals, all WebAssembly

33Peripherals
44Firmware demos
~25FPS DOOM
0Native deps

Everything you need

A complete embedded development environment in your browser

🔧

Real Firmware

Runs actual Cortex-M4 Thumb-2 binaries — the same firmware works on real STM32F407 hardware.

33 Peripherals

USART, GPIO, DMA, ETH, TIM, CAN, ADC, DAC, I2S, LTDC, SPI, I2C — all modeled in Rust.

🌐

Browser + Node

Runs headless in Node.js or in a browser tab via WebAssembly. No native dependencies.

🔗

Real Networking

DHCP + TCP + HTTP against a real gVisor network stack or a deterministic script.

💀

DOOM

The full DOOM 1 shareware running at ~25 FPS in your browser, with audio.

🤖

AI Integration

MCP server lets AI agents boot firmware, step execution, and inspect registers interactively.

How it works

Three layers, zero magic

01

Unicorn CPU

QEMU-derived ARM Cortex-M4 core compiled to WASM. Executes real Thumb-2 firmware binaries instruction by instruction.

unicorn_arm.cjs · 837 KB
02

Rust Peripherals

33 peripheral modules modeled in Rust, compiled to WASM with wasm-bindgen. Register-mapped MMIO with real interrupt logic.

stm32_periph_wasm · 1.1 MB
03

JS Driver

Memory hooks route MMIO reads/writes between CPU and peripherals. Drives UART output, ETH frames, GPIO state, and more.

emulator.js · 1800 lines

Get started in 30 seconds

Browser
# Serve the site
npx serve site/

# Open http://localhost:3000
# Pick a firmware, click Boot
Node.js
npm install stm32f4-emu

# Run CLI
npx stm32f4-emu firmware.bin

# Or programmatic
import { STM32F4 } from 'stm32f4-emu'
const mcu = await STM32F4.create({ firmware })