2026-03-11 04:01:05 +07:00
|
|
|
# ESP32 Emulation Test Suite
|
|
|
|
|
|
|
|
|
|
This directory contains tests for ESP32 emulation using QEMU compiled to WebAssembly.
|
|
|
|
|
|
|
|
|
|
## Structure
|
|
|
|
|
|
|
|
|
|
- `sketches/` - Arduino sketches for ESP32 (copied from test/esp32/sketches)
|
|
|
|
|
- `binaries/` - Compiled firmware binaries (`.bin`, `.elf`)
|
|
|
|
|
- `qemu-config/` - QEMU machine configurations
|
|
|
|
|
- `scripts/` - Build and test scripts
|
|
|
|
|
- `web/` - HTML/JS wrapper for WebAssembly QEMU
|
|
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
refactor: rename wokwi-libs/ → third-party/
The directory grew well beyond Wokwi-only contents: it now hosts
lcgamboa's QEMU fork (qemu-lcgamboa), Espressif's esp32-camera, the
ngspice WASM build, fritzing-parts, picowi, an alternative QEMU
(qemu-esp32), the 100_Days_100_IoT_Projects examples repo, and
Wokwi's own avr8js/rp2040js/wokwi-elements/wokwi-features/wokwi-boards.
"wokwi-libs" was misleading — half the contents have nothing to do
with Wokwi. "third-party/" is the standard convention for vendored
external dependencies.
Mechanical changes:
Path rename:
wokwi-libs/ → third-party/
update-wokwi-libs.bat → update-third-party.bat
docs/WOKWI_LIBS.md → docs/THIRD_PARTY.md
Submodule reconfiguration:
.gitmodules — 4 path= and section names updated
.git/modules/wokwi-libs/ → .git/modules/third-party/
each submodule's .git file rewired to ../../.git/modules/third-party/<name>
Reference updates (~80 files): vite.config.ts aliases, Dockerfile
COPY paths, GH Actions workflow steps, build_qemu_*.sh, all
docs/* and test/*/autosearch/* entries that mention the path,
package-lock.json file: dependencies, .gitignore patterns,
sitemap.xml + index.html SEO blurbs, scripts/generate-component-*,
.dockerignore, .idea/vcs.xml. Bulk replaced both `wokwi-libs/`
(path) and bare `wokwi-libs` (textual mentions in docs/comments).
Verified:
- npx tsc -b --noEmit produces no new errors related to these paths
- vite.config.ts aliases now point at ../third-party/avr8js etc.
- All 4 git submodules (avr8js, rp2040js, wokwi-elements,
wokwi-features) are linked under third-party/ with their
worktrees re-populated and config files referencing the new path
- `grep -r wokwi-libs` returns zero hits outside node_modules,
.vite, frontend/dist, third-party/ (upstream submodule contents),
*.pyc caches, and *.dll.pre-camera rollback binaries
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 10:58:57 +07:00
|
|
|
1. QEMU fork built as WebAssembly (see `third-party/qemu-lcgamboa/`)
|
2026-03-11 04:01:05 +07:00
|
|
|
2. ESP32 toolchain (arduino-cli with esp32 platform)
|
|
|
|
|
3. Emscripten SDK (for building QEMU to WASM)
|
|
|
|
|
|
|
|
|
|
## Initial Test
|
|
|
|
|
|
|
|
|
|
The first test is to compile the blink sketch and run it in QEMU (native) to verify basic GPIO emulation.
|
|
|
|
|
|
|
|
|
|
## Goals
|
|
|
|
|
|
|
|
|
|
- Emulate GPIO pins (digitalWrite, digitalRead)
|
|
|
|
|
- Emulate Serial output (UART)
|
|
|
|
|
- Emulate WiFi (station and AP modes)
|
|
|
|
|
- Emulate other peripherals (SPI, I2C, ADC, etc.)
|
|
|
|
|
- Run entirely in browser via WebAssembly
|