Building Firmware from Source: Toolchain & Compiling
Why Build From Source
Beyond just installing a pre-built custom firmware release, building from source is the actual entry point if you want to modify firmware behavior yourself, contribute to an open-source firmware project, or build a bleeding-edge/dev-branch version not yet available as a packaged release.
Picking a Firmware Base
Official firmware, Momentum, Unleashed, and RogueMaster are all forks with different feature sets and philosophies — check each project's GitHub repo for current build instructions specifically, since exact toolchain requirements do shift over firmware releases and this guide covers the general pattern rather than one project's exact current commands.
General Toolchain Requirements
- Git (to clone the firmware repo and its submodules)
- Python 3.8+ (the build system's scripting layer, fbt — Flipper Build Tool — is Python-based)
- The ARM GCC toolchain — most firmware build systems handle downloading the correct pinned version automatically via their build script rather than requiring manual toolchain install
General Clone + Build Pattern
git clone --recursive https://github.com/[firmware-project]/flipperzero-firmware.git cd flipperzero-firmware ./fbtThe --recursive flag matters — firmware repos use git submodules for various libraries, and a non-recursive clone leaves those empty, causing confusing build failures that look unrelated to the actual missing-submodule cause.
Common Build Targets
./fbt firmware_all # full firmware build ./fbt flash # build and flash directly to a connected Flipper ./fbt faps # build just the custom apps (FAPs) without full firmwareFirst-Build Troubleshooting
- Submodule errors: run git submodule update --init --recursive if you cloned without --recursive initially.
- Python version mismatches: check the specific firmware's documented minimum Python version — fbt's dependency resolution can fail confusingly on too-old Python.
- Toolchain download failures: fbt downloads a pinned ARM GCC toolchain on first run — if this fails partway (network issue), delete the partial download directory (path shown in the error output) and re-run rather than assuming it's a deeper problem.
Making a Small Modification and Rebuilding
Once a clean build succeeds, the actual development loop is: edit source, ./fbt flash (builds and pushes directly to a connected device), test on hardware, repeat. This is meaningfully faster than the SWD flashing method for active development since fbt flash handles the whole USB-based update path automatically.
Where to Go From Here
If your actual goal is writing a new app rather than modifying firmware internals, see the dedicated "Writing Your First FAP App" guide — FAP app development uses much of this same toolchain but targets a narrower, more approachable scope than full firmware modification.
Related Guides
- Flipper Zero: Getting Started with BadUSB, Sub-GHz, and NFC
- Updating Flipper Zero Firmware and Installing Unleashed or RogueMaster
- Getting Started with Flipper Zero: The Complete Beginner Guide
- Flashing Firmware via ST-Link/SWD: Recovery & Custom Builds
- Writing Your First FAP App
- Building Your First Custom Flipper Zero App: ufbt Setup, GUI, and GPIO
- How to Build a Custom Mechanical Keyboard from Scratch: Hand-Wiring and QMK Firmware
- How to Install Klipper on Any 3D Printer: Complete Setup Guide