PlatformIO-compatible embedded build tool (Rust implementation)
Project description
A fast, next-generation multi-platform compiler, deployer, and monitor for embedded development, directly compatible with platformio.ini.
CI status
Per-platform board build badges (click to expand)
AVR
MegaAVR
Renesas
ESP8266
ESP32
CH32V (RISC-V)
CH32X (RISC-V, USB PD)
Teensy
STM32
SAM / SAMD
RP2040 / RP2350
Nordic NRF52
Apollo3
Silicon Labs
NRF52
Raspberry Pi Pico
Silicon Labs
Board descriptions and family deep-dives live in docs/BOARD_STATUS.md.
fbuild
fbuild is a next-generation embedded development tool featuring a clean, extensible, data-driven architecture. It provides fast incremental builds, URL-based package management, and comprehensive multi-platform support for Arduino and ESP32 development.
platformio.ini compatible — fbuild uses the same platformio.ini already used in your PlatformIO sketches.
Current status: v2.0.6 — Rust rewrite. Full ESP32 / Teensy support with a working build system.
Docs index
For a full FAQ-style map of every doc in this repo, see docs/INDEX.md. Common entry points:
- Why fbuild exists, key benefits, performance →
docs/WHY.md - Is my board supported? →
docs/BOARD_STATUS.md - Architecture / daemon / serial internals →
docs/architecture/(start atoverview.md) - Crate dependency graph →
crates/CLAUDE.md - Testing, troubleshooting, local setup →
docs/DEVELOPMENT.md - Design decisions (ADRs) →
docs/DESIGN_DECISIONS.md - Implementation roadmap →
docs/ROADMAP.md
Installation
# Install from PyPI
pip install fbuild
# Or install from source
git clone https://github.com/fastled/fbuild.git
cd fbuild
pip install -e .
Quick Start
Build an Arduino Uno project
-
Create project structure:
mkdir my-project && cd my-project mkdir src
-
Create
platformio.ini:[env:uno] platform = atmelavr board = uno framework = arduino
-
Write your sketch (
src/main.ino):void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); }
-
Build:
fbuild build
On first build, fbuild will download the AVR-GCC toolchain (~50MB, one-time), download the Arduino AVR core (~5MB, one-time), compile your sketch, and emit firmware.hex under .fbuild/build/uno/.
Build time: ~19s first build, ~3s subsequent builds, <1s incremental.
Examples
Build, deploy, and monitor in one command:
# Default action: build + deploy
fbuild tests/platform/esp32c6
# Default action: build + deploy + monitor
fbuild tests/platform/esp32c6 --monitor
Deploy commands:
# Deploy with clean build
fbuild deploy tests/platform/esp32c6 --clean
# Deploy with monitoring and test patterns
fbuild deploy tests/platform/esp32c6 \
--monitor="--timeout 60 --halt-on-error \"TEST FAILED\" --halt-on-success \"TEST PASSED\""
# Deploy to the default emulator backend
fbuild deploy tests/platform/uno -e uno --to emu
# Deploy to the default emulator backend and open the monitor page
fbuild deploy tests/platform/uno -e uno --to emu --monitor
# Deploy ESP32-S3 to the default emulator backend
fbuild deploy tests/platform/esp32s3 -e esp32s3 --to emu --monitor --timeout 10 --verbose
# Deploy to an explicit emulator backend
fbuild deploy tests/platform/esp32s3 -e esp32s3 --to emu --emulator qemu --monitor --timeout 10
test-emu — build + run in emulator in one step (CI-friendly, exits with emulator exit code):
# Auto-detect emulator backend from the board
fbuild test-emu tests/platform/uno -e uno
# Explicit backend, with pattern matching
fbuild test-emu tests/platform/esp32s3 -e esp32s3 --emulator qemu --timeout 10
# AVR with simavr backend
fbuild test-emu tests/platform/mega -e megaatmega2560 --emulator simavr
# Halt on first test result
fbuild test-emu tests/platform/uno -e uno \
--halt-on-success "TEST PASSED" --halt-on-error "TEST FAILED"
| Option | Description |
|---|---|
--emulator <backend> |
Force backend: avr8js, qemu, or simavr (auto-detected if omitted) |
--timeout <secs> |
Kill the emulator after N seconds |
--halt-on-success <regex> |
Stop and report pass when pattern matches |
--halt-on-error <regex> |
Stop and report fail when pattern matches |
--expect <regex> |
Require this pattern in output (fail on timeout if missing) |
--no-timestamp |
Disable timestamp prefix on output lines |
-v, --verbose |
Show emulator command and build details |
Monitor command:
# Monitor serial output with pattern matching
fbuild monitor --timeout 60 --halt-on-error "TEST FAILED" --halt-on-success "TEST PASSED"
Serial monitoring requires pyserial to attach to the USB device. Port auto-detection works similarly to PlatformIO.
Emulator testing
fbuild can build and run firmware in emulators without physical hardware. Two entry points:
fbuild test-emu— one-shot build + emulate + exit (CI-friendly)fbuild deploy --to emu— deploy flow with optional--monitor
Both auto-detect the emulator backend from the board, or accept --emulator <backend>.
Emulator backends
| Backend | Platforms | MCUs | Requirements |
|---|---|---|---|
| avr8js | AtmelAVR | ATmega328P | Node.js (bundled headless script) |
| simavr | AtmelAVR, MegaAVR | ATmega2560, ATmega32U4, and others | simavr binary on PATH |
| qemu | Espressif32 | ESP32, ESP32-S3 (Xtensa); ESP32-C3, ESP32-C6, ESP32-H2 (RISC-V) | Native QEMU (auto-downloaded) |
Auto-detection rules when --emulator is omitted:
- ATmega328P defaults to avr8js (no external binary needed)
- Other AVR MCUs with
simavrindebug_toolsdefault to simavr - ESP32, ESP32-S3 (Xtensa) and ESP32-C3, ESP32-C6, ESP32-H2 (RISC-V) default to qemu
QEMU notes
ESP32-family QEMU runs from a normal Arduino environment. fbuild launches the correct Espressif QEMU binary (qemu-system-xtensa for ESP32/ESP32-S3; qemu-system-riscv32 for ESP32-C3/C6/H2) based on the selected board. The required QEMU build flags are injected automatically when deploying to --to emu.
[env:esp32s3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip
board = esp32-s3-devkitc-1
framework = arduino
board_build.flash_mode = dio
board_upload.flash_mode = dio
[env:esp32c3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip
board = esp32-c3-devkitm-1
framework = arduino
board_build.flash_mode = dio
board_upload.flash_mode = dio
QEMU requires DIO flash mode. Boards configured with qio or qout will fail fast before building.
QEMU runtime is native-only. Supported hosts: Linux x86_64/arm64, macOS x86_64/arm64, Windows x86_64. On Windows, fbuild stages the required QEMU runtime DLLs for the managed install.
Known limitations:
- ESP32 QEMU supports ESP32, ESP32-S3 (Xtensa) and ESP32-C3, ESP32-C6, ESP32-H2 (RISC-V). ESP32-S2 and ESP32-P4 are not yet supported by upstream Espressif QEMU.
- QEMU-specific firmware patching: fbuild patches the generated ESP32-S3 app image for QEMU to bypass an ADC calibration constructor that hangs under emulation, then repairs the image checksum and hash. RISC-V variants (C3/C6/H2) do not require this patch.
- Performance: QEMU emulation is slower than real hardware. Use it for functional validation, not timing-sensitive behavior.
- Peripheral coverage: Not all peripherals are fully emulated. Real hardware is still required for production validation.
CLI Usage
Build
# Build with auto-detected environment
fbuild build
# Build a specific environment
fbuild build --environment uno
fbuild build -e mega
# Clean build (remove all build artifacts)
fbuild build --clean
# Verbose output (shows all compiler commands)
fbuild build --verbose
# Build in a different directory
fbuild build --project-dir /path/to/project
Typical output:
Building environment: uno
Downloading toolchain: avr-gcc 7.3.0-atmel3.6.1-arduino7
Downloading: 100% ████████████████████ 50.1MB/50.1MB
Extracting package...
Toolchain ready at: .fbuild/cache/...
Downloading Arduino core: 1.8.6
Compiling sketch...
Compiling Arduino core...
Linking firmware...
Converting to Intel HEX...
✓ Build successful!
Firmware: .fbuild/build/uno/firmware.hex
Program: 1058 bytes (3.3% of 32256 bytes)
RAM: 9 bytes (0.4% of 2048 bytes)
Build time: 3.06s
Configuration
platformio.ini summary
Minimal configuration:
[env:uno]
platform = atmelavr
board = uno
framework = arduino
Fuller configuration:
[platformio]
default_envs = uno
[env:uno]
platform = atmelavr
board = uno
framework = arduino
upload_port = COM3
monitor_speed = 9600
build_flags =
-DDEBUG
-DLED_PIN=13
lib_deps =
https://github.com/FastLED/FastLED
https://github.com/adafruit/Adafruit_NeoPixel
Library dependencies
fbuild supports downloading and compiling Arduino libraries directly from GitHub URLs:
[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps =
https://github.com/FastLED/FastLED
Features:
- Automatic GitHub URL optimization (converts repo URLs to zip downloads)
- Automatic branch detection (main vs master)
- Proper Arduino library structure handling
- LTO (Link-Time Optimization) for optimal code size
- Support for complex libraries with assembly optimizations
Key features
- URL-based package management — direct URLs to toolchains and platforms, no hidden registries
- Library management — download and compile Arduino libraries from GitHub URLs
- Fast incremental builds — 0.76s rebuilds, 3s full builds (cached)
- LTO support — Link-Time Optimization for optimal code size
- Transparent architecture — know exactly what's happening at every step
- Real downloads, no mocks — all packages are real, validated, and checksummed
- Cross-platform — Windows, macOS, and Linux
platformio.inicompatible — drop-in replacement for PlatformIO builds
See docs/WHY.md for the full rationale, benefits, and performance benchmarks.
Supported platforms
fbuild supports AVR, MegaAVR, Renesas RA, ESP8266, ESP32 (all variants incl. S2/S3/C2/C3/C5/C6/H2/P4), CH32V/CH32X RISC-V, Teensy (LC–4.1), STM32, Atmel SAM/SAMD, RP2040/RP2350, Nordic NRF52, Apollo3, Silicon Labs EFR32, and WASM via Emscripten.
For the live per-platform CI badge matrix, per-board status, and family deep-dives, see docs/BOARD_STATUS.md.
Project structure
The repo is a Rust workspace. For the full crate dependency graph and per-crate responsibilities, see crates/CLAUDE.md.
A typical user project on disk looks like:
my-project/
├── platformio.ini # Configuration file
├── src/
│ ├── main.ino # Your Arduino sketch
│ └── helpers.cpp # Additional C++ files
└── .fbuild/ # Build artifacts (auto-generated)
├── cache/
│ ├── packages/ # Downloaded toolchains
│ └── extracted/ # Arduino cores
└── build/
└── uno/
├── src/ # Compiled sketch objects
├── core/ # Compiled Arduino core
└── firmware.hex # Final output ← upload this
Architecture
Architecture docs are decentralized under docs/architecture/. Start with overview.md, then read the subsystem-specific docs listed in docs/CLAUDE.md.
Development
Testing, troubleshooting, linting, and local setup instructions live in docs/DEVELOPMENT.md. Project-wide rules for contributors and LLM agents are in CLAUDE.md.
License
In the spirit of Dan Garcia's permissively licensed software, fbuild is presented as free software.
BSD 3-Clause License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fbuild-2.1.21-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: fbuild-2.1.21-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 13.4 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc2d890f00b21575023389679372fcce53107e9d00934033e206de80822d362
|
|
| MD5 |
36c75ace465e0d38eaa68bf461c609ec
|
|
| BLAKE2b-256 |
bdbf16169006e249b89e71950cf8f07c2b6966602b79f6a408cb86ab7f0180a8
|
File details
Details for the file fbuild-2.1.21-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fbuild-2.1.21-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 14.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
843b0cfcc73b0b1dbdc6bd980c61a33c03cc2617c663e4c7d82a141d87bbed58
|
|
| MD5 |
5ea7f73255473174b3a17409245d8484
|
|
| BLAKE2b-256 |
3242bb627daf74667c4efeffeabe92c024c8c8e5730a7dac124b0c67c3f215ae
|
File details
Details for the file fbuild-2.1.21-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: fbuild-2.1.21-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 12.7 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46f5be9f729b57610fc0cc7000de70b8f7baf71ca7afa93bce4bddc10455bb19
|
|
| MD5 |
aee4b9c0070298639346fa06cbf9255d
|
|
| BLAKE2b-256 |
30612de84c866e48816abea253c0ec15790d25bde744f0d18f73aadca4095c3c
|
File details
Details for the file fbuild-2.1.21-cp310-abi3-macosx_11_0_arm64.macosx_10_12_x86_64.whl.
File metadata
- Download URL: fbuild-2.1.21-cp310-abi3-macosx_11_0_arm64.macosx_10_12_x86_64.whl
- Upload date:
- Size: 12.7 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c541b6bc3aff01f31f9a6058917f00d75ad8f1e5dc8b7abd71988d17d78399a
|
|
| MD5 |
4661e12dc0dc3ac7400dabe76bfab52a
|
|
| BLAKE2b-256 |
39a37a6d0391be01c56827575c11a7636d2356010cdaf6148483151c12e7f4b3
|