Skip to content

Developer Guide

Everything you need to build, run, test, and extend MaD.

Prerequisites

Tool Version For
Node.js 20+ The app and its E2E suite
Rust stable + wasm32-unknown-unknown The protocol core, WASM, the SIL emulator
wasm-pack latest Building the app's WASM core
Python 3.8+ The protocol generator and the docs site
PlatformIO 6.x+ Building the firmware
KiCad 8+ Hardware (optional)

Rust, wasm-pack, and Python are only needed if you're building the app or running SIL; PlatformIO only if you're building firmware.

Initialize the submodules first

Two components are git submodules: Protocol/ProtoEmb (protocol codegen + runtime) and SIL/embsim (the emulator framework). Every fast path below needs them:

git clone --recurse-submodules https://github.com/RileyMcCarthy/MaD.git
# or, in an existing checkout:
git submodule update --init --recursive

The fast paths

cd Software/Control
npm install
npm run build:wasm        # compile the Rust protocol core → src/wasm/
npm run generate:proto    # generate the TS codec from the YAML schema
npm run app               # opens your browser; use Web Serial to connect
cd SIL
make test                 # build firmware + emulator, run cargo test
cd Firmware/MaDCore
pio run -e MaD             # build
pio run -e MaD -t upload   # flash through J1, the programming port

Deep dives

Design records kept alongside the code rather than duplicated here.

Control app — TEST_PLAN.md (Rust unit, vitest, and live-SIL E2E layers) and HARDENING.md (safety model, failure recovery, data integrity, performance).

Protocol — ProtoEmb README (generator, framing, runtime) and wire-format.md (the canonical frame + payload contract).

SIL framework — embsim README (the reusable framework and the ~10-line emulator) and CONTRACT.md (the symbols and ABI a platform crate must export).