Litz is an open-source electronics and firmware simulator. A diagram.json file lists the parts and the wires between them, a project manifest names a firmware image, and Litz boots that image on an emulated chip, resolves pins, buses and analog nets against the parts on the board, and runs it. It is written in Rust, runs natively and compiles to WebAssembly.

Litz boots the image you built: MicroPython 1.29 from micropython.org, CircuitPython, an ESP-IDF binary, a hand-written 8051 assembly file, an unmodified .bin straight from your toolchain. The ESP32 family is entered through Espressif's mask ROM dump, so the second-stage bootloader, the partition table and the app all run the way they do on the bench. Fourteen microcontrollers sit behind one interface: six ESP32 parts (classic, C3, C6, S3, P4, S31), four AVR parts, the RP2040, the RP2350 (Cortex-M33 plus a Hazard3 RISC-V core), the STC89C52RC and the CH32V003.

The parts on the board model device behaviour. An SSD1306 understands page addressing and the control byte; an ST7735 and an ILI9341 take their command streams; e-paper only changes on its refresh. EEPROM and flash parts remember between runs, real-time clocks keep time, I/O expanders and motor drivers respond on I2C and SPI. I2C, SPI and UART are transfers and device state, not pin wiggle, which is what lets a stock MicroPython driver work untouched.

A litz-wifi-router part puts a real network on the air: beacons, open-system authentication and association, a WPA2-PSK four-way handshake when a passphrase is set, DHCP, DNS, TCP, UDP, a TLS 1.3 endpoint with a simulated CA, WebSockets and an MQTT broker, all answered at simulated times. The guest can run the other way as an access point, with a virtual station joining it and completing the handshake. Bluetooth beacons, nRF24L01, SX1276 and IEEE 802.15.4 peers share the same medium.

Deep sleep is part of the chip model. Firmware writes the same sleep-enable register it writes on silicon, the HP domain stops, an RTC timer or an EXT0/EXT1 pad wakes it, and the chip reboots inside the same run. RTC registers, slow memory and the wake cause survive, so machine.deepsleep() followed by boot.py reading machine.reset_cause() behaves like the real thing.

The analog side runs an MNA solver alongside the digital simulation: voltage dividers, LEDs with their forward drop, zener breakdown, linear regulators with dropout, buck and boost modules, and an ADC that reads the solved node voltage. A firmware reading a potentiometer sees a number that comes from the circuit, not from an attribute.

The engine has no wall clock and no randomness; every event is scheduled in simulated nanoseconds. Two runs of the same project produce the same console output, part states, captured waveforms and network capture. litz test asserts on serial output and part state, writes JUnit for CI, and records VCD for a logic analyser view or a pcap for Wireshark. A litz.lock file pins the digest of every catalog manifest and firmware image a run consumed, so a green build stays green until something the run actually used changes.

There are two front ends. litz on the command line runs, tests, builds and serves projects, exposes the simulator over the Model Context Protocol, and attaches a debugger through a GDB stub. Litz Breadboard, the browser editor, runs the same engine as a WebAssembly module: you place a board and parts, wire them, press Run, and the serial panel, the LEDs, the seven-segment displays and the OLED update live. The browser build carries the RISC-V ESP parts, the RP2040 and RP2350, the AVRs, the STC89C52RC and the CH32V003; the two Xtensa ESP32s need the native JIT.

Parts and chips of your own are sandboxed WebAssembly components speaking litz:part and litz:mcu, with no WASI, so a custom sensor or core can be installed beside a project without rebuilding Litz.

Litz is Apache-2.0. It is on crates.io, npm and GitHub with prebuilt binaries for Linux, macOS and Windows.