"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
- [Optional] Switch to nightly version of Rust (required if you use
flipperzero-alloc
)rustup default nightly
- Install the
thumbv7em-none-eabihf
Rust target:rustup target add thumbv7em-none-eabihf
- Clone the
flipperzero-firmware
repository:git clone --recurse-submodules https://github.com/flipperdevices/flipperzero-firmware.git && cd flipperzero-firmware
- Clone this repository into
applications_user
:git clone https://github.com/dcoles/flipperzero-hello-rust.git applications_user/hello_rust
- Build the project as a Rust library:
(cd applications_user/hello_rust && cargo build --release)
- Build, upload and launch the app by executing:
./fbt launch_app APPSRC=applications_user/hello_rust
./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
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.