• Stars
    star
    427
  • Rank 98,110 (Top 2 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 1 year ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compact tool for building and debugging applications for Flipper Zero.

uFBT - micro Flipper Build Tool

uFBT is a cross-platform tool for building applications for Flipper Zero. It is a simplified version of Flipper Build Tool (FBT).

uFBT has an official GitHub Action. With it, you can automate building and publishing your application using GitHub workflows.

uFBT enables basic development tasks for Flipper Zero, such as building and debugging applications, flashing firmware, creating VSCode development configurations. It uses prebuilt binaries and libraries, so you don't need to build the whole firmware to compile and debug your application for Flipper.

Installation

  • Linux & macOS: python3 -m pip install --upgrade ufbt
  • Windows: py -m pip install --upgrade ufbt

uFBT uses your system's Python for running bootstrap code. Minimal supported version is Python 3.8. For executing actual build tasks, uFBT will download and use its own Python binaries and a toolchain built for your platform.

On first run, uFBT will download and install required SDK components from release update channel of official firmware. For more information on how to switch to a different version of the SDK, see Managing the SDK section.

Usage

Building & running your application

Run ufbt in the root directory of your application (the one with application.fam file in it). It will build your application and place the resulting binary in dist subdirectory.

You can upload and start your application on Flipper attached over USB using ufbt launch.

To see other available commands and options, run ufbt -h.

Debugging

In order to debug your application, you need to be running the firmware distributed alongside with current SDK version. You can flash it to your Flipper using ufbt flash (over ST-Link), ufbt flash_usb (over USB) or ufbt flash_blackmagic (using Wi-Fi dev board running Blackmagic firmware).

You can attach to running firmware using ufbt debug (for ST-Link) or ufbt blackmagic (for Wi-Fi dev board).

VSCode integration

uFBT provides a configuration for VSCode that allows you to build and debug your application directly from the IDE. To deploy it, run ufbt vscode_dist in the root directory of your application. Then you can open the project in VSCode (File-Open Folder...) and use the provided launch (ctrl+shift+b) & debugging (ctrl+shift+d) configurations.

Application template

uFBT can create a template for your application. To do this, run ufbt create APPID=<app_id> in the directory where you want to create your application. It will create an application manifest and its main source file. You can then build and debug your application using the instructions above.

Application manifests are explained in the FBT documentation.

Other

  • ufbt cli starts a CLI session with the device;
  • ufbt lint, ufbt format run clang-format on application's sources.

Managing the SDK

To update the SDK, run ufbt update. This will download and install all required SDK components from previously used source.

  • To switch to SDK for a different release channel, run ufbt update --channel=[dev|rc|release].
    • uFBT also supports 3rd-party update indexers, following the same schema as official firmware. To use them, run ufbt update --index-url=<url>, where <url> is a URL to the index file, e.g. https://update.flipperzero.one/firmware/directory.json.
  • To use SDK for a certain release or a not-yet-merged branch from official repo, run ufbt update --branch=0.81.1 or ufbt update --branch=owner/my-awesome-feature.
    • You can also use branches from other repos, where build artifacts are available from an indexed directory, by specifying --index-url=<url>.
  • uFBT can also download and update the SDK from any fixed URL. To do this, run ufbt update --url=<url>.
  • To use a local copy of the SDK, run ufbt update --local=<path>. This will use the SDK located in <path> instead of downloading it. Useful for testing local builds of the SDK.

uFBT stores its state in .ufbt subfolder in your home directory. You can override this location by setting UFBT_HOME environment variable.

ufbt-bootstrap

Updating the SDK is handled by uFBT component called bootstrap. It has a dedicated entry point, ufbt-bootstrap, with additional options that might be useful in certain scenarios. Run ufbt-bootstrap --help to see them.

Troubleshooting

If something goes wrong and uFBT state becomes corrupted, you can reset it by running ufbt clean. If that doesn't work, you can try removing .ufbt subfolder manually from your home folder.

ufbt-bootstrap and SDK-related ufbt subcommands accept --verbose option that will print additional debug information.

More Repositories

1

flipperzero-firmware

Flipper Zero firmware source code
C
11,149
star
2

Flipper-Android-App

Android Mobile app to rule all Flipper's family
Kotlin
1,315
star
3

qFlipper

qFlipper β€” desktop application for updating Flipper Zero firmware via PC
C++
1,015
star
4

Flipper-iOS-App

iOS Mobile App to rule all Flipper's family
Swift
659
star
5

flipperzero-3d-models

Flipper Zero 3D models
476
star
6

blackmagic-esp32-s2

C
446
star
7

flipper-application-catalog

Flipper Application Catalog
Python
435
star
8

flipperzero-good-faps

Flipper Zero Official Apps maintained by Flipper Team and Friends
C
218
star
9

docs

Flipper Zero documentation repo
Python
172
star
10

flipperzero-sd-card-examples

Examples of all types of files stored on Flipper Zero SD card
154
star
11

lab.flipper.net

JavaScript
138
star
12

flipperzero-devboard-stlinkv3

Devboard for Flipper Zero based on ST-Link V3
100
star
13

flipperzero-toolchain

Flipper Zero Embedded Toolchain
Shell
95
star
14

flipperzero-nfc-tools

Repository contains nfc tools for Flipper companions
C
93
star
15

flipperzero-ufbt-action

Official ufbt Action wrapper for building Flipper Zero applications
81
star
16

flipperzero-game-engine

C
81
star
17

flipperzero-protobuf

65
star
18

flipperzero-catalog-sample-app

C
53
star
19

go-flipper

Go
51
star
20

flipperzero_protobuf_py

Python
49
star
21

video-game-module

C
45
star
22

flipperzero-remote-testbench-front

Remote testbench for Flipper zero - Frontend
JavaScript
41
star
23

flipperzero-nfc-rpc

Examples for control NFC over RPC
Python
37
star
24

webdfu

Driver for working with DFU in a browser over WebUSB
TypeScript
35
star
25

flipper-menu-generator

Generates menu tree image from markdown code
JavaScript
34
star
26

flipper-hackathon-moscow

Flipper Hackathon Moscow 2021
33
star
27

update.flipperzero.one

JavaScript
27
star
28

flipperzero-documentation

CSS
27
star
29

Casper-flipper-blog-theme

Handlebars
26
star
30

flipperzero-game-engine-example

Flipper Zero game engine example project
C
22
star
31

flipper-questions-and-answers

Flipper Question and Answer sessions archive
21
star
32

webflipper

Web client
JavaScript
19
star
33

homebrew-flipper

Ruby
18
star
34

stm32wb_copro_scripts

Python
18
star
35

flipper-update-indexer

Flipper update file uploader and indexer
Python
16
star
36

flipper-documentation-indexer

Python
16
star
37

flipper-update-server

Go
12
star
38

.github

12
star
39

map-gcc-parser-python

Python
10
star
40

flpr.app

HTML
9
star
41

flipper-tilda-webserver

Tilda exporter and webserver
Python
9
star
42

flipper-map-reporter

Map file analyser CI/CD
Shell
9
star
43

flipperzero-protobuf-jvm

8
star
44

floopper-bloopper

C
8
star
45

flipper-k8s-db-backuper

Make backups of databases in k8s
Shell
8
star
46

welcomer-bot

Go
7
star
47

stm32wb_copro

C++
7
star
48

sub-sync

Sync Ghost and Sendinblue subscribers
Go
7
star
49

discord-backers-bot

Go
6
star
50

docker-rsync-server

Shell
6
star
51

inotify-safe-mv

Dockerfile
6
star
52

flipper-factory-reset

Fully reset flipper and set it to the shipping state
Python
5
star
53

discord-notifier

Go
5
star
54

flipperzero-protobuf-metric

Protobuf for flipper metrics
5
star
55

thumbnail-autogen

Dockerfile
4
star
56

chmocker

Chroot-based Docker-like pseudo-containers for MacOS
Python
4
star
57

firmware-report-server

Flipper Zero FW build report analyzer backend
Python
4
star
58

QA-flipper-units

Simple script to run the unit tests inside flipper and validate the result
Python
4
star
59

firmware-report-client

Svelte
3
star
60

go-metric

Server for metric from application
Go
3
star
61

ship-flipp

Go
2
star
62

flipper-github-runner-docker-qa

Self-hosted github actions runners for QA
Python
1
star