Skip to main content

uFBT - micro Flipper Build Tool. Tool for building and developing applications (.fap) for Flipper Zero and its device family.

Project description

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 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>.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ufbt-0.2.0b10.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ufbt-0.2.0b10-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file ufbt-0.2.0b10.tar.gz.

File metadata

  • Download URL: ufbt-0.2.0b10.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ufbt-0.2.0b10.tar.gz
Algorithm Hash digest
SHA256 4e5a6ff54b7a8573f665f2101a5eaa4faf469a1f306f5cadeb48239090565022
MD5 25fbc1fc9c5c48545ee63f29bd037ba7
BLAKE2b-256 3ef08676e1d11615f45e7330b8b6acba7d8ea044b0919b6e2d66c18400701be3

See more details on using hashes here.

File details

Details for the file ufbt-0.2.0b10-py3-none-any.whl.

File metadata

  • Download URL: ufbt-0.2.0b10-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ufbt-0.2.0b10-py3-none-any.whl
Algorithm Hash digest
SHA256 5c2252167b6754bd5d39e3b9009963e91955c9192dd77605a035c5bcf8d6d236
MD5 a943427f2c7b83d8f29a395c3d936297
BLAKE2b-256 38429e4a91613584fbd0f3eb2c142cccb1ce049c6b298d0fc45ebacbb5aadb37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page