Skip to content

Repository files navigation

fbuild

fbuild

fbuild is a fast, multi-platform compiler, deployer, emulator runner, and serial monitor for embedded development. It reads the same platformio.ini files already used by PlatformIO sketches, but uses a Rust-native, data-driven build pipeline.

Check UbuntuCheck macOSCheck WindowsFormattingDocumentationBuild Native Binaries

Build Matrix

These board builds are part of the front door. They show the platform breadth that fbuild actively protects in CI.

AVR

Build Arduino UnoBuild LeonardoBuild ATmega8ABuild ATtiny85Build ATtiny88Build ATtiny4313

MegaAVR

Build ATtiny1604Build ATtiny1616Build Nano Every

Renesas

Build UNO R4 WiFi

ESP8266

Build ESP8266

ESP32

Build ESP32 DevBuild ESP32-C2Build ESP32-C3Build ESP32-C5Build ESP32-C6Build ESP32-H2Build ESP32-P4Build ESP32-S2Build ESP32-S3

CH32V (RISC-V)

Build CH32V003Build CH32V103Build CH32V203Build CH32V208Build CH32V303Build CH32V307

CH32X (RISC-V, USB PD)

Build CH32X035

Teensy

Build Teensy 4.1Build Teensy 4.0Build Teensy 3.6Build Teensy 3.5Build Teensy 3.2Build Teensy 3.1Build Teensy 3.0Build Teensy LC

STM32

Build STM32F103C8Build STM32F103CBBuild STM32F103TBBuild STM32F411CEBuild STM32H747XIBuild Nucleo F429ZIBuild Nucleo F439ZIBuild Arduino Giga R1

SAM / SAMD

Build Arduino DueBuild SAMD21Build Arduino ZeroBuild SAMD51JBuild SAMD51P

RP2040 / RP2350

Build RP2040Build RP2350

Nordic NRF52

Build nRF52840 DKBuild SuperMini nRF52840Build nice!nano nRF52840Build nRFMicro nRF52840Build Adafruit Feather NRF52840 Sense

Apollo3

Build Apollo3 RedBoardBuild Apollo3 expLoRaBLE

NXP LPC (Cortex-M0+)

Build LPC804Build LPC845Build LPC845-BRKBuild LPCXpresso804Build LPCXpresso845-MAX

Silicon Labs

Build MGM240Build SparkFun Thing Plus Matter

Raspberry Pi Pico

Build Raspberry Pi PicoBuild Raspberry Pi Pico 2

Board descriptions and family deep-dives live in docs/BOARD_STATUS.md.

Build performance

Arduino CLI vs PlatformIO vs fbuild Blink build benchmark

The chart is regenerated nightly from clean-output (cold) and immediate repeat (warm) Arduino Uno Blink builds. Raw measurements are discoverable through the benchmark manifest.

Installation

pip install fbuild

For source installs, platform notes, and first-run cache behavior, start with the getting started guide.

Command Quick Start

fbuild reads the same platformio.ini files as PlatformIO. Use these commands as direct replacements for the most common PlatformIO workflows:

fbuildPlatformIO equivalentUse it to
fbuild buildpio runCompile the project.
fbuild build --cleanpio run --target clean, then pio runClean and compile the project.
fbuild deploypio run --target uploadBuild and upload firmware.
fbuild deploy --cleanClean, then pio run --target uploadClean, build, and upload firmware.
fbuild monitorpio device monitorMonitor serial output without flashing.
fbuild cipio ciBuild one or more sketches for CI.

Pass --platformio to build, deploy, or monitor to delegate that workflow to the installed PlatformIO CLI. fbuild ci is a fbuild-native, PlatformIO-compatible CI command; detailed flags and nested commands are in the CLI reference.

fbuild-only commands

These commands extend beyond the PlatformIO workflow surface:

CommandPurpose
fbuild symbolsReport per-symbol firmware size and bloat details.
fbuild bloatInspect symbol back-references and generate bloat graphs.
fbuild resetReset a device without flashing it.
fbuild purgePurge downloaded packages or run cache garbage collection.
fbuild syncResolve platformio.ini dependencies into a deterministic lock file.
fbuild daemonManage the background build daemon, locks, and cache.
fbuild showShow daemon logs and other runtime information.
fbuild deviceList devices and manage device leases.
fbuild mcpStart the Model Context Protocol server for AI integrations.
fbuild clang-tidyRun clang-tidy static analysis on project sources.
fbuild iwyuRun include-what-you-use analysis on project sources.
fbuild clangd-configGenerate clangd and VS Code configuration for the project.
fbuild test-emuBuild and run firmware in an emulator for testing.
fbuild clang-queryRun a clang-query matcher against project sources.
fbuild lnkFetch, verify, and create .lnk resource pointers.
fbuild lib-selectDiagnose the LDF-style library selection result.
fbuild compile-manyCompile many sketches against one board in parallel stages.
fbuild serialProbe serial ports and read them with board-aware settings.
fbuild bringupOrchestrate build, flash, reset, monitor, and bring-up steps.
fbuild portScan serial ports with vendor and product identification.
fbuild cacheSave, restore, list, and verify portable cache archives.

See fbuild help <command> or the full CLI reference for options and nested subcommands.

Quick Start

Create a minimal Arduino project:

mkdir my-project
cd my-project
mkdir src

Add platformio.ini:

[env:uno]platform = atmelavr
board = uno
framework = arduino

Add src/main.ino:

voidsetup() {
pinMode(LED_BUILTIN, OUTPUT);
}
voidloop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}

Build it:

fbuild build

On the first build, fbuild downloads the toolchain and framework packages it needs, then caches them for later builds. A successful Uno build writes .fbuild/build/uno/firmware.hex.

Examples

Common workflows:

fbuild build
fbuild deploy --clean
fbuild deploy --monitor
fbuild test-emu . -e uno
fbuild monitor --timeout 60 --halt-on-success "TEST PASSED"

Detailed build, deploy, monitor, and emulator examples live in the CLI reference and emulator testing guide.

Docs Index

The full FAQ-style map is docs/INDEX.md. Common entry points:

GoalStart here
Install fbuild and run the first builddocs/getting-started/
Use build, deploy, monitor, or test-emudocs/reference/cli.md
Configure platformio.inidocs/reference/platformio-ini.md
Check board and platform supportdocs/platforms/
Understand the project rationaledocs/WHY.md
Work on fbuild itselfdocs/development/
Read architecture internalsdocs/architecture/overview.md

Key Features

  • platformio.ini compatibility for existing Arduino and ESP32 sketches
  • Fast incremental builds with cached toolchains, frameworks, and libraries
  • URL-based package and library management, including GitHub lib_deps
  • Build, deploy, serial monitor, and emulator test workflows from one CLI
  • Cross-platform support on Windows, macOS, and Linux
  • Transparent architecture with Rust workspace internals documented under docs/architecture/

See docs/WHY.md for the full rationale, benefits, and performance notes.

CLI Usage

The user-facing command reference is docs/reference/cli.md. It covers core workflows (build, deploy, monitor, test-emu) and diagnostics such as symbols, bloat, lib-select, compile-many, and ci.

Configuration

fbuild reads platformio.ini project files. The configuration reference, including default_envs, build_flags, lib_deps, upload and monitor settings, and compatibility notes, lives in docs/reference/platformio-ini.md.

Emulator Testing

fbuild can build firmware and run it without hardware via fbuild test-emu or fbuild deploy --to emu. Emulator backends, auto-detection rules, QEMU notes, and known limitations live in docs/guides/emulator-testing.md.

PlatformIO Compatibility: .eh_frame Strip

On supported release builds, fbuild may strip unused GCC .eh_frame unwind metadata to reduce firmware size. The policy, opt-out controls, and rationale are documented in docs/reference/platformio-compatibility.md.

Supported Platforms

fbuild supports AVR, MegaAVR, Renesas RA, ESP8266, ESP32 variants, CH32 RISC-V, Teensy, STM32, SAM/SAMD, RP2040/RP2350, Nordic NRF52, Apollo3, Silicon Labs EFR32, NXP LPC, and WASM via Emscripten.

For the canonical per-board CI badge matrix, support table, and board-family notes, see docs/BOARD_STATUS.md or the platforms docs.

Project Structure

The repository is a Rust workspace with a Python package boundary. The human development guide is docs/development/, and the crate dependency map is crates/CLAUDE.md.

Architecture

Architecture docs are decentralized under docs/architecture/. Start with docs/architecture/overview.md, then follow the subsystem-specific docs.

Development

Testing, troubleshooting, linting, release, and local setup instructions live in docs/development/. 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

About

A blazing fast build tool for Esp32, Teensy, Avr, Nrf, Raspberri PI, Stm, Mgm240 and more.

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages