My experience trying to build a new app

This message lists the traps and pitfalls I had to face to in order to compile my first app and make it run in the flipper device…

  1. as soon as I received my flipper, I upgraded it to v0.98.3 firmware

  2. I downloaded the fbt toolkit for Linux and the source code of the metronome app

  3. the command “./fbt fap_metronome” failed because the source code uses mutex functions that are no longer available ! I didn’t find any up-to-date documentation about the changes in the mutex functions, so I tried to do it by myself and rewrite some parts of the code

  4. once the build step succedeed, I transfered the fap file to the flipper. But when I used the interface to select the new app, the icon was not displayed (I could see an interrogation mark instead). When I pushed the button to start the app, an error message said “API to new - update the firmware”… but I’m already using the last stable firmware ! Note that the build process stated that the app used API version 58.0

  5. after many hours trying to find out what the problem was, I downloaded the ufbt toolkit (pip3 install ufbt)

  6. but the command “ufbt” failed because the app includes the “m-string.h” file which is missing in the toolchain downloaded by ufbt. Since the file had been downloaded by fbt, I copied it in the right directory for ufbt

  7. now the command “ufbt” works well ! But it said that the app used API version 54.0…

  8. I’ve copied the fap file on the flipper SD-Card, the app is now well recognized (with the right icon) and can be started

Conclusion :

  • the SDK documentation is not up-to-date (problem with the mutex library)
  • the fbt toolchain has created an app for API version 58 which is not compatible with the lastest firmware (v0.98.3)
  • the ufbt toolchain not include all the necessary header files and creates app with API version 54.0

Pfuuuu ! Now I can start really coding

2 Likes