Complete setup instructions for developing, building, testing, and flashing Qbitel EdgeOS firmware.
- System Requirements
- Rust Toolchain Setup
- Python Environment Setup
- Hardware Debug Probes
- Docker Environment
- Development Container (VS Code)
- Verifying the Installation
- Platform-Specific Notes
| Requirement | Minimum | Recommended |
|---|---|---|
| OS | Linux (x86_64), macOS (ARM/x86) | Ubuntu 22.04 LTS |
| RAM | 4GB | 8GB+ |
| Disk | 5GB free | 10GB+ |
| Rust | 1.82 (stable) | Latest stable |
| Python | 3.10 | 3.11+ |
| Docker | 24.0 (optional) | Latest |
| Platform | Board | Debug Probe |
|---|---|---|
| STM32H7 | NUCLEO-H743ZI, STM32H753I-EVAL | ST-Link V3 (built-in) |
| STM32U5 | B-U585I-IOT02A | ST-Link V3 (built-in) |
| RISC-V | HiFive1 Rev B | Segger J-Link |
No hardware? All tests run on the host. Hardware is only needed for on-device testing and flashing.
If you don't have Rust installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envVerify the installation:
rustc --version # Should be 1.82.0 or later
cargo --version# ARM Cortex-M7 (STM32H743/753)
rustup target add thumbv7em-none-eabihf
# ARM Cortex-M33 (STM32U585)
rustup target add thumbv8m.main-none-eabihf
# RISC-V RV32IMAC (SiFive FE310)
rustup target add riscv32imac-unknown-none-elfrustup component add rustfmt clippy llvm-tools-preview rust-src# Code coverage
cargo install cargo-tarpaulin
# Dependency auditing
cargo install cargo-audit cargo-deny
# Unsafe code detection
cargo install cargo-geiger
# Binary utilities (size analysis)
cargo install cargo-binutils
# SBOM generation
cargo install cargo-sbom
# Fuzzing (optional)
cargo install cargo-fuzz# Install probe-rs for flashing and debugging
cargo install probe-rs-tools
# Verify
probe-rs listThe Python tools (q-sign and q-provision) require Python 3.10+.
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows# Firmware signing tool
pip install -e tools/q-sign
# Device provisioning tool
pip install -e tools/q-provision# Formatter, linter, type checker
pip install black ruff mypy
# Testing
pip install pytest pytest-cov
# Pre-commit hooks
pip install pre-commit
pre-commit installq-sign --help
q-provision --helpMost STM32 Nucleo and Discovery boards have an ST-Link debug probe built in. Connect via USB and verify:
probe-rs listExpected output:
The following debug probes were found:
[0]: STLink V3 (VID: 0483, PID: 374E, Serial: ...)
Linux udev rules (required for non-root access):
# Create udev rules for ST-Link
sudo tee /etc/udev/rules.d/49-stlink.rules << 'EOF'
# STLink V2
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="0666"
# STLink V3
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", MODE="0666"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", MODE="0666"
EOF
sudo udevadm control --reload-rules
sudo udevadm triggerFor SiFive HiFive1 boards:
- Download J-Link Software from segger.com
- Install the package for your OS
- Verify:
probe-rs listDocker provides a reproducible build environment with all toolchains pre-installed.
Follow the official instructions for your platform:
cd qbitel-edgeos
docker compose buildThis builds an image with:
- Rust 1.82 + all embedded targets
- All cargo tools (tarpaulin, audit, deny, geiger, fuzz, sbom)
- Python 3.11 + all tool dependencies
- ARM and RISC-V cross-compilation toolchains
# Full workspace build (all targets)
docker compose run builder
# Run the complete test suite
docker compose run test
# Format and lint check
docker compose run lint
# Security audit (cargo audit + deny + geiger)
docker compose run audit
# Code coverage report
docker compose run coverage
# Python tool tests
docker compose run python-testdocker compose run --entrypoint bash builderIf you use Visual Studio Code, a dev container configuration is provided:
Install the Dev Containers extension (ms-vscode-remote.remote-containers).
- Open the
qbitel-edgeosfolder in VS Code - Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Select Dev Containers: Reopen in Container
The container includes:
- Rust toolchain with all targets
- rust-analyzer extension
- Python environment with tools installed
- All cargo tools pre-installed
Run these commands to verify everything is set up correctly:
# Check that all crates compile (no output = success)
cargo check --workspace --all-featurescargo fmt --all -- --checkcargo clippy --workspace --all-features -- -D warningscargo test --workspace --all-featurescargo build --release --target thumbv7em-none-eabihf --features stm32h7cargo size --release --target thumbv7em-none-eabihf --features stm32h7 -- -Aq-sign keygen --algorithm dilithium3 --output /tmp/test-keys/
q-sign keyinfo --key /tmp/test-keys/firmware_signer.pub
rm -rf /tmp/test-keys/cargo audit
cargo deny checkIf all commands pass, your environment is ready.
Rust cross-compilation to ARM embedded targets works natively on Apple Silicon. No additional configuration needed.
# Rosetta is NOT required for embedded cross-compilation
rustup target add thumbv7em-none-eabihf # Works nativelySame as Apple Silicon. All embedded targets compile via LLVM's cross-compilation backend.
Install system dependencies:
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
libssl-dev \
libudev-dev \
libusb-1.0-0-dev \
cmakeThe libudev-dev and libusb-1.0-0-dev packages are required for probe-rs to communicate with debug probes.
sudo dnf install -y \
gcc \
openssl-devel \
systemd-devel \
libusbx-devel \
cmakeQbitel EdgeOS development is supported on Windows via WSL2:
- Install WSL2 with Ubuntu 22.04
- Follow the Ubuntu/Debian instructions above
- For USB debug probe passthrough, use usbipd-win
Native Windows compilation is not officially supported due to the no_std embedded toolchain requirements.
You're building for an embedded target but didn't disable std. Ensure your code uses #![no_std] and you're using the correct target triple.
- Linux: Check udev rules (see ST-Link section)
- macOS: No special permissions needed
- WSL2: Use usbipd-win to forward the USB device
The post-quantum crypto algorithms use significant compile-time memory. Increase available RAM or reduce parallelism:
cargo build --release -j 2 # Limit to 2 parallel jobsRun cargo deny check to see which dependencies have advisories. Update affected dependencies:
cargo update
cargo deny check- QUICKSTART.md - Build and run your first application
- DEPLOYMENT.md - Production deployment guide
- ../CONTRIBUTING.md - Contributor guidelines