Convert Figma logo to code with AI

flipperdevices logoflipperzero-firmware

Flipper Zero firmware source code

14,167
2,957
14,167
198

Top Related Projects

RogueMaster Flipper Zero Firmware

Flipper Zero Unleashed Firmware

The Dom amongst the Flipper Zero Firmware. Give your Flipper the power and freedom it is really craving. Let it show you its true form. Dont delay, switch to the one and only true Master today!

15,183

Playground (and dump) of stuff I make or modify for the Flipper Zero

Flipper Zero Unleashed Firmware

Quick Overview

Flipper Zero Firmware is the official firmware for the Flipper Zero device, a portable multi-tool for pentesters and hardware enthusiasts. It provides a wide range of functionalities, including RFID, NFC, infrared, and sub-GHz communication capabilities, along with a user-friendly interface and customizable applications.

Pros

  • Open-source project with active community development and support
  • Extensive feature set covering various wireless protocols and hardware interfaces
  • Regular updates and improvements to enhance functionality and security
  • Well-documented codebase and development guidelines for contributors

Cons

  • Steep learning curve for beginners due to the complexity of embedded systems development
  • Potential for misuse if not used responsibly and ethically
  • Limited compatibility with certain proprietary systems and protocols
  • Requires specialized hardware (Flipper Zero device) to fully utilize the firmware

Code Examples

  1. Reading RFID card data:
#include <furi.h>
#include <furi_hal.h>
#include <rfid.h>

void read_rfid_card() {
    Rfid* rfid = rfid_alloc();
    if (rfid_read(rfid, RfidTypeEM4100)) {
        FuriString* uid = furi_string_alloc();
        rfid_get_uid_string(rfid, uid);
        FURI_LOG_I("RFID", "Card UID: %s", furi_string_get_cstr(uid));
        furi_string_free(uid);
    }
    rfid_free(rfid);
}
  1. Sending an infrared signal:
#include <furi.h>
#include <infrared.h>

void send_ir_signal() {
    InfraredMessage message = {
        .protocol = InfraredProtocolNEC,
        .address = 0x00,
        .command = 0x01,
    };
    infrared_send(&message, 1);
}
  1. Scanning for sub-GHz signals:
#include <furi.h>
#include <subghz.h>

void scan_subghz() {
    SubGhzReceiver* receiver = subghz_receiver_alloc();
    subghz_receiver_start(receiver, 433920000);
    
    while (!furi_hal_gpio_read(&gpio_button_back)) {
        if (subghz_receiver_is_data_available(receiver)) {
            SubGhzProtocolDecoderBase* decoder = subghz_receiver_get_decoder(receiver);
            FURI_LOG_I("SubGHz", "Detected: %s", decoder->protocol->name);
        }
        furi_delay_ms(100);
    }
    
    subghz_receiver_free(receiver);
}

Getting Started

To get started with Flipper Zero Firmware development:

  1. Clone the repository: git clone https://github.com/flipperdevices/flipperzero-firmware.git
  2. Install the required dependencies as described in the project's documentation
  3. Build the firmware: ./fbt
  4. Flash the firmware to your Flipper Zero device using the provided tools

For more detailed instructions and documentation, refer to the project's wiki and API documentation.

Competitor Comparisons

RogueMaster Flipper Zero Firmware

Pros of flipperzero-firmware-wPlugins

  • Includes additional plugins and features not found in the official firmware
  • More frequent updates and experimental features
  • Customizable UI themes and animations

Cons of flipperzero-firmware-wPlugins

  • Potentially less stable due to frequent changes and experimental features
  • May void warranty or cause issues with official support
  • Increased complexity for users unfamiliar with custom firmware

Code Comparison

flipperzero-firmware:

void flipper_start() {
    furi_hal_power_insomnia_enter();
    furi_hal_rtc_set_log_level(FuriHalRtcLogLevelPerf);
    furi_hal_interrupt_init();
    // ...
}

flipperzero-firmware-wPlugins:

void flipper_start() {
    furi_hal_power_insomnia_enter();
    furi_hal_rtc_set_log_level(FuriHalRtcLogLevelPerf);
    furi_hal_interrupt_init();
    custom_plugin_init();
    // ...
}

The main difference in the code is the addition of custom_plugin_init() in the flipperzero-firmware-wPlugins version, which initializes the extra plugins and features not present in the official firmware.

Flipper Zero Unleashed Firmware

Pros of unleashed-firmware

  • More frequent updates and feature additions
  • Includes additional applications and plugins not found in the official firmware
  • Greater customization options for advanced users

Cons of unleashed-firmware

  • Potentially less stable due to rapid development and experimental features
  • May void warranty or support from Flipper Devices
  • Increased risk of security vulnerabilities due to third-party contributions

Code Comparison

flipperzero-firmware:

void nfc_scene_read_success_on_enter(void* context) {
    Nfc* nfc = context;
    // Standard NFC read success handling
    dolphin_deed(DolphinDeedNfcRead);
    nfc_text_store_set(nfc, "UID:");
    scene_manager_set_scene_state(nfc->scene_manager, NfcSceneReadSuccess, 0);
    view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
}

unleashed-firmware:

void nfc_scene_read_success_on_enter(void* context) {
    Nfc* nfc = context;
    // Enhanced NFC read success handling with additional features
    dolphin_deed(DolphinDeedNfcRead);
    nfc_text_store_set(nfc, "UID:");
    scene_manager_set_scene_state(nfc->scene_manager, NfcSceneReadSuccess, 0);
    view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
    // Additional custom functionality
    unleashed_nfc_extra_features(nfc);
}

The Dom amongst the Flipper Zero Firmware. Give your Flipper the power and freedom it is really craving. Let it show you its true form. Dont delay, switch to the one and only true Master today!

Pros of Xtreme-Firmware

  • Enhanced feature set with additional functionalities
  • More frequent updates and community-driven development
  • Greater customization options for users

Cons of Xtreme-Firmware

  • Potential stability issues due to rapid development cycle
  • May void warranty or support from official Flipper Zero team
  • Increased complexity for novice users

Code Comparison

flipperzero-firmware:

void flipper_application_entry(void* p) {
    UNUSED(p);
    flipper_application_init();
    flipper_application_run();
}

Xtreme-Firmware:

void flipper_application_entry(void* p) {
    UNUSED(p);
    flipper_application_init();
    xtreme_features_init();
    flipper_application_run();
}

The Xtreme-Firmware adds an extra initialization step for its custom features before running the main application.

15,183

Playground (and dump) of stuff I make or modify for the Flipper Zero

Pros of Flipper

  • More extensive collection of community-contributed scripts and applications
  • Includes additional features and modifications not found in the official firmware
  • Regularly updated with new content and improvements from the community

Cons of Flipper

  • May include potentially risky or untested modifications
  • Less stable and thoroughly tested compared to the official firmware
  • Potential legal and ethical concerns with some included features

Code Comparison

Flipper-Zero-Firmware:

void gpio_init() {
    furi_hal_gpio_init_simple(&gpio_ext_pc0, GpioModeOutputPushPull);
    furi_hal_gpio_init_simple(&gpio_ext_pc1, GpioModeOutputPushPull);
    furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
}

Flipper:

void gpio_init() {
    furi_hal_gpio_init_simple(&gpio_ext_pc0, GpioModeOutputPushPull);
    furi_hal_gpio_init_simple(&gpio_ext_pc1, GpioModeOutputPushPull);
    furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
    // Additional custom GPIO initialization
    furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull);
}

The code comparison shows that Flipper may include additional customizations or modifications to the original firmware, potentially expanding functionality but also introducing potential instability or compatibility issues.

Flipper Zero Unleashed Firmware

Pros of unleashed-firmware

  • More frequent updates and feature additions
  • Includes additional applications and plugins not found in the official firmware
  • Greater customization options for advanced users

Cons of unleashed-firmware

  • Potentially less stable due to rapid development and experimental features
  • May void warranty or support from Flipper Devices
  • Increased risk of security vulnerabilities due to third-party contributions

Code Comparison

flipperzero-firmware:

void nfc_scene_read_success_on_enter(void* context) {
    Nfc* nfc = context;
    // Standard NFC read success handling
    dolphin_deed(DolphinDeedNfcRead);
    nfc_text_store_set(nfc, "UID:");
    scene_manager_set_scene_state(nfc->scene_manager, NfcSceneReadSuccess, 0);
    view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
}

unleashed-firmware:

void nfc_scene_read_success_on_enter(void* context) {
    Nfc* nfc = context;
    // Enhanced NFC read success handling with additional features
    dolphin_deed(DolphinDeedNfcRead);
    nfc_text_store_set(nfc, "UID:");
    scene_manager_set_scene_state(nfc->scene_manager, NfcSceneReadSuccess, 0);
    view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
    // Additional custom functionality
    unleashed_nfc_extra_features(nfc);
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

A pixel art of a Dophin with text: Flipper Zero Official Repo

Flipper Zero Firmware

Contributing

Our main goal is to build a healthy and sustainable community around Flipper, so we're open to any new ideas and contributions. We also have some rules and taboos here, so please read this page and our Code of Conduct carefully.

I need help

The best place to search for answers is our User Documentation. If you can't find the answer there, check our Discord Server or our Forum. If you want to contribute to the firmware development or modify it for your own needs, you can also check our Developer Documentation.

I want to report an issue

If you've found an issue and want to report it, please check our Issues page. Make sure the description contains information about the firmware version you're using, your platform, and a clear explanation of the steps to reproduce the issue.

I want to contribute code

Before opening a PR, please confirm that your changes must be contained in the firmware. Many ideas can easily be implemented as external applications and published in the Flipper Application Catalog. If you are unsure, reach out to us on the Discord Server or the Issues page, and we'll help you find the right place for your code.

Also, please read our Contribution Guide and our Coding Style, and make sure your code is compatible with our Project License.

Finally, open a Pull Request and make sure that CI/CD statuses are all green.

Development

Flipper Zero Firmware is written in C, with some bits and pieces written in C++ and armv7m assembly languages. An intermediate level of C knowledge is recommended for comfortable programming. C, C++, and armv7m assembly languages are supported for Flipper applications.

Firmware RoadMap

Firmware RoadMap Miro Board

Requirements

Supported development platforms:

  • Windows 10+ with PowerShell and Git (x86_64)
  • macOS 12+ with Command Line tools (x86_64, arm64)
  • Ubuntu 20.04+ with build-essential and Git (x86_64)

Supported in-circuit debuggers (optional but highly recommended):

Flipper Build System will take care of all the other dependencies.

Cloning source code

Make sure you have enough space and clone the source code:

git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git

Building

Build firmware using Flipper Build Tool:

./fbt

Flashing firmware using an in-circuit debugger

Connect your in-circuit debugger to your Flipper and flash firmware using Flipper Build Tool:

./fbt flash

Flashing firmware using USB

Make sure your Flipper is on, and your firmware is functioning. Connect your Flipper with a USB cable and flash firmware using Flipper Build Tool:

./fbt flash_usb

Documentation

Project structure

  • applications - Applications and services used in firmware
  • applications_users - Place for your additional applications and services
  • assets - Assets used by applications and services
  • documentation - Documentation generation system configs and input files
  • furi - Furi Core: OS-level primitives and helpers
  • lib - Our and 3rd party libraries, drivers, tools and etc...
  • site_scons - Build system configuration and modules
  • scripts - Supplementary scripts and various python libraries
  • targets - Firmware targets: platform specific code

Also, see ReadMe.md files inside those directories for further details.

Links

SAST Tools

  • PVS-Studio - static analyzer for C, C++, C#, and Java code.