A "Hello, Rust!" program for the Flipper Zero

Overview

"Hello, Rust!" for the Flipper Zero

This is an example of how to build a Rust-based Flipper application that runs from the SD-card.

Note: This depends upon the Flipper Application SDK which is included in the 0.67 release and some Rust-specific fixes which are included in 0.68.1 release.

Building

  1. [Optional] Switch to nightly version of Rust (required if you use flipperzero-alloc)
    rustup default nightly
    
  2. Install the thumbv7em-none-eabihf Rust target:
    rustup target add thumbv7em-none-eabihf
    
  3. Clone the flipperzero-firmware repository:
    git clone --recurse-submodules https://github.com/flipperdevices/flipperzero-firmware.git && cd flipperzero-firmware
    
  4. Clone this repository into applications_user:
    git clone https://github.com/dcoles/flipperzero-hello-rust.git applications_user/hello_rust
    
  5. Build the project as a Rust library:
    (cd applications_user/hello_rust && cargo build --release)
    
  6. Build, upload and launch the app by executing:
    ./fbt launch_app APPSRC=applications_user/hello_rust
    
    Or do it manually by calling:
    ./fbt firmware_hello_rust
    ./scripts/storage.py mkdir /ext/apps/Misc
    ./scripts/storage.py send build/f7-firmware-D/hello_rust.fap /ext/apps/Misc/hello_rust.fap
    
    And after that launch the app on Flipper via Menu->Applications->Misc->Hello, Rust.

Build Tasks

This project uses cargo-make to help automate some common tasks.

cargo make build

Builds application by running cargo build and then fbt.

cargo make install

Copy most recent build of application to connected Flipper Zero.

cargo make build-install

Shorthand for cargo make build followed by cargo make install.

cargo make build-run

Build and launch most recent build of application on connected Flipper Zero.

cargo make cli

Connect to the Flipper Zero's serial command-line interface.

License

Licensed under the MIT License. See LICENSE for details.

You might also like...
Following "ZK HACK III - Building On-chain Apps Off-chain Using RISC Zero"

RISC Zero Rust Starter Template Welcome to the RISC Zero Rust Starter Template! This template is intended to give you a starting point for building a

zero-dependency 3d math library in rust

dualquat A lightweight, zero-dependency 3d math library for use in Dual Quaternion based physics simulation. Capable of representing and transforming

An Interpreter for Brainfuck programming language implemented in the Rust programming language with zero dependencies.

Brainfuck Hello, Visitor! Hey there, welcome to my project showcase website! It's great to have you here. I hope you're ready to check out some awesom

A zero-config leptos component to display markdown
A zero-config leptos component to display markdown

A port of yew-markdown using leptos ! Usage You can use this component to render both static and dynamic markdown. Static markdown use leptos::*; {

Opinionated, zero-config linter for JavaScript monorepos
Opinionated, zero-config linter for JavaScript monorepos

Sherif: Opinionated, zero-config linter for JavaScript monorepos About Sherif is an opinionated, zero-config linter for JavaScript monorepos. It runs

excss is a small, simple, zero-runtime CSS-in-JS library with just two APIs.

excss excss is a small, simple, zero-runtime CSS-in-JS library with just two APIs.

 Cover your tracks during Linux Exploitation by leaving zero traces on system logs and filesystem timestamps.
Cover your tracks during Linux Exploitation by leaving zero traces on system logs and filesystem timestamps.

moonwalk-back Cover your tracks during Linux Exploitation / Penetration Testing by leaving zero traces on system logs and filesystem timestamps. 📖 Ta

Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.
Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.

paleatra v.0.0.1 Command-Line program that takes an image and produces the copy of the image with a thin frame and palette made of the 10 most frequen

Tokei is a program that displays statistics about your code.

Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language.

Comments
  • Broken on head

    Broken on head

    I imagine theyve redone a bunch of the build system, but yeah the instructions no longer work:

    (venv) flipperzero-chrootenv:xxx@xxx:/tmp/flipperzero-firmware$ ./fbt firmware_hello_rust
    	LINK	build/f7-firmware-D/.extapps/hello_rust_d.elf
    /nix/store/6gvjdldjgwxbyiwzj5awzhs1nm2my0bv-gcc-arm-embedded-10.3.1/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: --gc-sections requires a defined symbol root specified by -e or -u
    collect2: error: ld returned 1 exit status
    scons: *** [build/f7-firmware-D/.extapps/hello_rust_d.elf] Error 1
    ********** ERRORS **********
    Failed building build/f7-firmware-D/.extapps/hello_rust_d.elf: Error 1
    (venv) flipperzero-chrootenv:xxx@xxx:/tmp/flipperzero-firmware$ readelf -h build/f7-firmware-D/.extapps/hello_rust_d.elf
    readelf: Error: 'build/f7-firmware-D/.extapps/hello_rust_d.elf': No such file
    
    opened by twitchyliquid64 5
  • Cannot build app

    Cannot build app

    hello_rust % cargo build --release            
    error: failed to get `flipperzero` as a dependency of package `hello_rust v0.1.0 (/Users/drzlo/work/flipperzero-firmware/applications_user/hello_rust)`
    
    Caused by:
      failed to load source for dependency `flipperzero`
    
    Caused by:
      Unable to update /Users/drzlo/work/flipperzero-rs/crates/flipperzero
    
    Caused by:
      failed to read `/Users/drzlo/work/flipperzero-rs/crates/flipperzero/Cargo.toml`
    
    Caused by:
      No such file or directory (os error 2)
    

    Looks like it caused by:

    [dependencies]
    flipperzero = { version = "0.2.0-alpha", path = "../../../flipperzero-rs/crates/flipperzero" }
    flipperzero-sys = { version = "0.2.0-alpha", path = "../../../flipperzero-rs/crates/sys" }
    
    bug 
    opened by DrZlo13 1
  • Updates

    Updates

    1. Added cargo make build-run command.
    2. README.md has been updated to accommodate the latest changes to the flipperzero-firmware.
    3. README.md has been updated to use unstable rust features.
    opened by DrZlo13 0
Owner
David Coles
https://twitter.com/davidcoles
David Coles
A simple program for C program IO testing. Written in Rust

A simple program for C program IO testing. Written in Rust, using concurrency to speed up valgrind testing. Make sure to update settings at your first run of the program!

null 1 Feb 22, 2022
That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.

?? This program is designed to translate text into the correct layout when typing is incorrect. ?? Example ghbdtn -> привет Just (by default) pressing

Gest Se 5 Jan 26, 2023
zero runtime cost default arguments in rust

Default Arguments in Rust Enables default arguments in rust by macro in zero cost. Just wrap function with default_args! and macro with name of functi

Jaeyong Sung 73 Sep 6, 2022
Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and at compile-time.

rgb2ansi256 rgb2ansi256 is a small Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and const fn. Th

Linda_pp 7 Nov 17, 2022
A very opinionated, zero-configuration shell prompt

A very opinionated, zero-configuration shell prompt

amy null 8 Nov 4, 2021
A zero-dependency crate for writing repetitive code easier and faster.

akin A zero-dependency crate for writing repetitive code easier and faster. Check Syntax for information about how to use it. Why? Example Syntax NONE

LyonSyonII 36 Dec 29, 2022
Python/Rust implementations and notes from Proofs Arguments and Zero Knowledge study group

What is this? This is where I'll be collecting resources related to the Study Group on Dr. Justin Thaler's Proofs Arguments And Zero Knowledge Book. T

Thor 65 Dec 16, 2022
A truly zero-dependency crate providing quick, easy, reliable, and scalable access to the name "jordin"

jordin Finally! A truly zero-dependency crate providing quick, easy, reliable, and scalable access to the name "jordin". Additionally, this one-of-a-k

jordin 2 Aug 4, 2022
A lightweight, zero-dependency struct diffing library which allows changed fields to be collected and applied

structdiff A lightweight, zero-dependency struct diffing library which allows changed fields to be collected and applied. Derive Difference on a struc

null 7 Dec 25, 2022
Pure rust library for reading / writing DNG files providing access to the raw data in a zero-copy friendly way.

DNG-rs   A pure rust library for reading / writing DNG files providing access to the raw data in a zero-copy friendly way. Also containing code for re

apertus° - open source cinema 4 Dec 1, 2022