SYS: FANTASI WIKI PAGE: DEPENDENCIES_
← HOME

Development environment dependencies

Everything needed to build, flash, test, and debug Fantasi across its targets (Flipper Zero / STM32WB55, Kiisu / STM32WB55, Chameleon Ultra / nRF52840, Proxmark3 / AT91SAM7S). Grouped by task - you only need the rows for what you're doing.

The Verified column is what's installed in the current development environment (and known-good); the Install column is how to get it on a fresh Debian/Ubuntu box. Versions other than the pinned ones below are usually fine.

Building firmware

DependencyRequiredVerifiedPurpose / install
arm-none-eabi-gcc + binutilsyesDebian gcc-arm-none-eabi 14.2.1 (15:14.2.rel1-1)Cross-compiler for all five firmwares. The build links against picolibc (--specs=picolibc.specs), so install via sudo apt install gcc-arm-none-eabi picolibc-arm-none-eabi. The upstream Arm GNU Toolchain tarball does not ship picolibc.specs required to build the firmware - use the Debian packages. make checks for a working toolchain (check-toolchain).
picolibc-arm-none-eabiyes1.8.10-2The bare-metal C library the firmware links (--specs=picolibc.specs): float printf, ctype, string/mem, plus the malloc symbols we wrap onto the FreeRTOS heap. sudo apt install picolibc-arm-none-eabi
GNU makeyes4.4.1Top-level + per-platform build driver. sudo apt install make
gityes2.47.2make auto-clones TinyUSB + LittleFS on demand (see below). sudo apt install git

Embedded third-party libraries (third_party/)

Pinned and reproducible. Two are fetched on first build; the rest are vendored in-tree.

LibraryVersionHow it's obtainedUsed by
TinyUSB0.17.0 (TUSB_TAG)git clone on demand (check-tinyusb)all targets (USB stack). check-tinyusb also applies the Fantasi patches under third_party/tinyusb_patches/ (SAM7S DCD for Proxmark3; the AT32 DWC2 port for Proxmark5).
LittleFSv2.11.3 (LFS_TAG)git clone on demand (check-littlefs)all targets (internal flash FS)
FatFsvendoredin third_party/external FAT volumes (Flipper SD card)
FreeRTOS-Kernelvendoredin third_party/all targets
nanopb (runtime)vendoredin third_party/protobuf encode/decode on device
CMSIS corevendoredin third_party/Cortex-M targets (incl. Proxmark5 core_cm4.h)
nRF52 MDKvendoredin third_party/Chameleon
STM32WB CMSISvendoredin third_party/Flipper, Kiisu

To bump TinyUSB/LittleFS, edit TUSB_TAG/LFS_TAG in the top-level Makefile (don't track a moving branch - it breaks reproducibility).

Building the host CLI (build/cli/fantasi)

Built with the host compiler, not the cross-toolchain (make cli).

DependencyRequiredVerifiedPurpose / install
host cc/gccyesDebian gcc 14.2.0compiles the CLI. sudo apt install build-essential
libreadline-devyesinstalledline editing + history. sudo apt install libreadline-dev
pkg-configfor BLE-detects libsystemd at build time. sudo apt install pkg-config
libsystemd-devoptionalinstalledenables the BLE transport (--ble) via BlueZ over D-Bus. Without it the CLI still builds; the --ble flags are just unavailable. sudo apt install libsystemd-dev

Host-side storage access (MSC)

The CLI exposes device storage as a synthetic FAT volume and drives it with ordinary file I/O against an OS mount.

DependencyRequiredVerifiedPurpose / install
udisks2 (udisksctl)yesinstalledmounts the FAT volume without root. sudo apt install udisks2
util-linux (findmnt)yes2.41resolves the mountpoint. (base system)

Flashing

See Flashing for the full per-target procedure and recovery. make flash (auto-detect) / make PLATFORM=<x> flash orchestrate these via tools/flash.py.

TargetToolRequiredVerifiedInstall
Flipper (STM32WB55)dfu-utilyes0.11sudo apt install dfu-util
Kiisu (STM32WB55)dfu-utilyes0.11sudo apt install dfu-util
Chameleon (nRF52840)nrfutil + device + nrf5sdk-tools commandsyesdevice 2.13.2, nrf5sdk-tools 1.1.0install nrfutil, then nrfutil install device nrf5sdk-tools (used for signed pkg generate / dfu / settings)
Proxmark3 (AT91SAM7S)tools/pm3_flasher.py → pyserialyespyserial 3.5pip install pyserial

Debugging (SWD / JTAG)

Optional - only for low-level bring-up. See Flashing and Architecture.

DependencyPurposeVerifiedInstall
pyocdSWD over CMSIS-DAP (e.g. a Flipper acting as a DAP, or a DAP-Link probe); non-halting reads, RAM reset, breakpoints0.43.1pip install pyocd
Black Magic Probe + gdbalternative SWD path (FZ); do not use it to flash here - only the flashing scripts flash-vendor probe + gdb-multiarch
tools/radio_flash.py → pyserialflash an STM32WB wireless (BLE) stack via ROM DFUpyserial 3.5pip install pyserial

BLE (host side)

Needed for the --ble CLI transport and the BLE integration tests.

DependencyRequiredVerifiedPurpose / install
BlueZ (bluetoothctl)for BLE5.82host Bluetooth stack; tests pair/scan via it. sudo apt install bluez
D-Bus + libsystemdfor --bleinstalledCLI BLE transport (see host-CLI table)
pexpect (Python)BLE tests4.9.0drives bluetoothctl passkey pairing. pip install pexpect
a Bluetooth adapterfor BLE-any BlueZ-supported BT 4.0+ adapter

Tests

  • Unit tests (make test-unit, what CI runs): hardware-free - only Python 3.
  • Integration tests (make PLATFORM=<x> test): need a connected device plus the relevant flashing/storage/BLE deps above. pyserial is required for the serial-command helpers; pyusb for the WebUSB vendor-pipe helpers (returning a switch-mode PM3 to CDC, and the cross-channel ps_kill test); BLE tests additionally need BlueZ + pexpect.

Protobuf regeneration (make proto)

Only when editing proto/fantasi.proto (the committed *.pb.{c,h} are what builds compile).

DependencyVerifiedInstall
nanopb_generatornanopb 0.4.9.1pip install nanopb (override path with make proto NANOPB=/path/to/nanopb_generator)

Python

DependencyRequiredVerifiedNotes
Python 3yes3.13.5runs tools/flash.py, tools/launch.py, the test runners. 3.9+ expected.
pyserialflashing/tests3.5PM3/radio flashers + integration serial helpers
pyusbtests1.3.1WebUSB vendor-pipe helpers (switch-mode CDC recovery, cross-channel ps_kill); also tools/radio_flash.py
pexpectBLE tests4.9.0bluetoothctl automation
nanopbproto only0.4.9.1code generator (above)

The launch helper (tools/launch.py, used by make launch APP=<name>) relies only on the Python standard library (pty, termios, select).

One-shot install (Debian/Ubuntu)

System packages:

sudo apt install build-essential make git \
                 gcc-arm-none-eabi picolibc-arm-none-eabi \
                 libreadline-dev libsystemd-dev pkg-config \
                 udisks2 util-linux \
                 dfu-util bluez

Python packages (a venv or --user is fine):

pip install pyserial pyusb pexpect nanopb pyocd

nrfutil (Chameleon flashing) is a separate vendor binary - install it, then:

nrfutil install device nrf5sdk-tools

Note: the firmware links against picolibc (--specs=picolibc.specs), which the Debian gcc-arm-none-eabi package supplies alongside picolibc-arm-none-eabi. The upstream Arm GNU Toolchain tarball does not bundle picolibc.specs, so it is recommended to use the Debian packages.

★ DREAM // HACK ★