A friend recently very generously gifted me a flipper zero, and it’s been a lot of fun to kick the tires. After exploring the stock firmware for a while, I wanted to customize it more than was possible with stock firmware, play with some apps people have built, and try my hand at running my own code on there.

Initial Setup

First, I grabbed a microSD card, formatted it, installed qflipper on my machine, and followed the instructions here to get everything updated.

After I found my way around the stock firmware, cloned a couple of MiFare 1K Classic NFC tokens out of my parts drawer, and read my car key fob, I used awesome-flipperzero and flipc to see what kinds of things people had been building. I also watched some of @TalkingSasquach’s videos.

Custom Firmware

Before playing with anything custom, I learned to build my own official firmware. While they warn against building from an ARM linux system (like a pi or pinebook), rosetta made their downloadable toolchains just work from a mac. It looks like it’d be workable from Windows, but if I wanted to build firmware from a Windows system, I’d probably use WSL and just follow the Linux documentation.

Once I managed that, I read this page to get a view of the differences between the various firmware forks and decided to try out Xtreme-Firmware on my flipper. The build was straightforward again:

$ git clone --recursive --jobs 8 https://github.com/Flipper-XFW/Xtreme-Firmware
$ cd Xtreme-Firmware
$ bash ./fbt updater_package

After that, I browsed to the .tgz file in dist/f7 and used qflipper to load it to my flipper.

Building Custom Apps

I’m still finding my way around. It looks like many developers use fbt to build their apps in the firmware source tree. There doesn’t seem to be a stable API/ABI, so apps need to be built for the specific firmware installed on the flipper where you plan to run them.

There’s also a tool called ufbt that makes it easier to work outside the source tree. It’s appealing to work outside the firmware source tree for many reasons… not least because the history is enormous, so git commands within that tree tend to be relatively slow. The documentation I found for ufbt really didn’t say much about using it with custom firmware. Here’s how I wound up doing it:

# create a virtual environment for ufbt
$ python3 -mvenv venv
# activate so pip commands only alter that environment
$ source venv/bin/activate
# install ufbt
(venv) $ pip install --upgrade ufbt
# tell ufbt to use the SDK that I just built with my firmware when building apps
(venv) $ ufbt  --verbose update  --hw-target=f7 --local=$HOME/Xtreme-Firmware/dist/f7-C/flipper-z-f7-sdk-XFW-DEV_@721EE9D.zip

From there, I was able to easily check out a sample application, build it, and launch it on my device:

(venv) $ git clone git@github.com:instantiator/flipper-zero-experimental-apps.git
(venv) $ cd flipper-zero-experimental-apps/resistors
(venv) $ ufbt launch

Now I’m ready to follow along with this nice tutorial for building apps without needing to revert to the upstream firmware.