(I'm assuming crosscompiling then running on Linux, not bare-metal (but that also should be possible)) Not a big project, but I've run simple HTTP server on one. To be honest, with Rust it mostly just: rustup target add arm-unknown-linux-musleabihf cargo build --target arm-unknown-linux-musleabihf You might need to adjust target, depending on which Raspberry Pi version you're using. In my case, because I've fairly old one (RPi 1 B+), I had to additionally download gcc toolchain (for linking) from arm's website, as the one from distro didn't support armv6. Answer from Shadow0133 on reddit.com
🌐
Medium
medium.com › swlh › compiling-rust-for-raspberry-pi-arm-922b55dbb050
Compile Rust for Raspberry Pi ARM | by Tiziano Santoro | The Startup | Medium
October 17, 2020 - In this article we will build a simple HTTP server application in Rust, cross-compile it for the Raspberry Pi ARM architecture, deploy it to a Raspberry Pi board over a network connection, and install it as a persistent service so that it restarts automatically at boot time and upon crash.
Discussions

How can I compile Rust code to run on a Raspberry Pi 2? - Stack Overflow
This answer works fine on Raspberry Pi 2s and 3s, but not on 1s or Zeros. See my answer for a setup that builds binaries that work across all Pi versions. 2018-01-04T00:53:37.22Z+00:00 ... I had to use sudo apt install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross libc6-dev-armhf-cross binutils-doc gcc-7-locales cpp-doc gcc-7-multilib-arm-linux-gnueabihf gcc-7-doc libgcc1-dbg-armhf-cross on Ubuntu 18.04. 2018-11-14T07:13:53.217Z+00:00 ... The Rust ... More on stackoverflow.com
🌐 stackoverflow.com
Has anyone programmed a Raspberry Pi with Rust?

(I'm assuming crosscompiling then running on Linux, not bare-metal (but that also should be possible)) Not a big project, but I've run simple HTTP server on one. To be honest, with Rust it mostly just:

rustup target add arm-unknown-linux-musleabihf
cargo build --target arm-unknown-linux-musleabihf

You might need to adjust target, depending on which Raspberry Pi version you're using.

In my case, because I've fairly old one (RPi 1 B+), I had to additionally download gcc toolchain (for linking) from arm's website, as the one from distro didn't support armv6.

More on reddit.com
🌐 r/rust
25
57
July 1, 2022
RustDesk finally released a raspberry build: an open source TeamViewer alternative
Sounds more like it's inspired by AnyDesk just based on the name. More on reddit.com
🌐 r/raspberry_pi
7
5
June 4, 2022
Tutorial: Compile RustDesk-Server for a Raspberry Pi 1 (ARMv6)
To ensure hbbr and hbbs are always running, you can put something like this in the crontab, which will run every minute (adjust all paths as needed) I would recommend a solution that doesn't mask any issues that may be causing the service(s) to regularly crash/restart. Something like monit can monitor the service(s), restart as-required, and notifiy you when such action is taken. More on reddit.com
🌐 r/rustdesk
4
6
June 17, 2023
🌐
Chacin
chacin.dev › blog › cross-compiling-rust-for-the-raspberry-pi
Cross Compiling Rust for the Raspberry Pi | Carlos Chacin
January 28, 2020 - [build] # Pi 0/1 [target.arm-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc" # Pi 2/3/4 [target.armv7-unknown-linux-gnueabihf] linker = "arm-none-linux-gnueabihf-gcc" # (Optional) Set default target for cargo build # target = "armv7-unknown-linux-gnueabihf" # rustflags = ["-C", "linker=arm-none-linux-gnueabihf-gcc"] Below is a quick example workflow you can use to quickly deploy your project on a Pi. ... PI_IP=192.168.2.159 # Be sure to change this! TARGET=armv7-unknown-linux-gnueabihf # Pi 2/3/4 #TARGET=arm-unknown-linux-gnueabihf # Pi 0/1 # build binary cargo build --target $TARGET # upload binary sshpass -p 'raspberry' scp -r ./target/$TARGET/debug/pi_project pi@$PI_IP:/home/pi # execute binary sshpass -p 'raspberry' ssh pi@$PI_IP './pi_project'
🌐
GitHub
github.com › rust-embedded › rust-raspberrypi-OS-tutorials
GitHub - rust-embedded/rust-raspberrypi-OS-tutorials: :books: Learn to write an embedded OS in Rust :crab: · GitHub
All that we need for cross-compiling from an x86 host to the Raspberry Pi's AArch64 architecture will be automatically installed by rustup. However, besides the Rust compiler, we will use some more tools.
Starred by 14.6K users
Forked by 870 users
Languages   Rust 82.2% | Makefile 8.5% | Ruby 5.9% | Assembly 3.2%
🌐
GitHub
github.com › robamu-org › rpi-rs-crosscompile
GitHub - robamu-org/rpi-rs-crosscompile: Cross-compile and Debug Rust applications for the Raspberry Pi with the CLI and with VS Code · GitHub
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ... Install a cross-compile toolchain and add it to your path. Unix: You can download one built with crosstool-ng from here. Windows: It is recommended to install the toolchain from SysProgs · Copy the .cargo/def-config.toml file to .cargo/config.toml and then adapt it to your needs to have a starting configuration for the Raspberry Pi.
Author   robamu-org
🌐
Shaneutt
shaneutt.com › blog › rust-x86-arm-raspberry-pi-4
Rust - X86 to ARM builds for Raspberry Pi 4
January 19, 2020 - Build your Raspberry Pi 4 binary with: cargo build --target armv7-unknown-linux-musleabihf --release · For a quick test you can use scp to copy the binary over to your Pi and run it: scp target/armv7-unknown-linux-musleabihf/release/testpi root@${SERVER_IP}:/usr/local/bin/testpi ssh ...
🌐
YouTube
youtube.com › dario
Epic Rust Raspberry PI Setup | Step-by-Step Tutorial
On this video I'll setup my Apple M1 for doing embedded #rustlang raspberry PI Development.I'll use Docker so that I can use my M1 to compile, then transfer ...
Published   September 7, 2022
Views   4K
Find elsewhere
🌐
fabian writes.
capnfabs.net › posts › cross-compiling-rust-apps-raspberry-pi
Cross-Compiling Rust apps for the Raspberry Pi || fabian writes.
October 22, 2020 - Now, we can theoretically tell the Ubuntu install on the Docker container to “enable the Raspberry Pi architecture (armhf) and install the required packages”: # Use the container that comes with `cross` as a base. It's already got # a cross-compile toolchain installed, so that's less work for us. FROM rustembedded/cross:armv7-unknown-linux-gnueabihf-0.2.1 RUN apt-get update RUN dpkg --add-architecture armhf && \ apt-get update && \ apt-get install --assume-yes libssl-dev:armhf libasound2-dev:armhf
🌐
HackerNoon
hackernoon.com › compiling-rust-for-the-raspberry-pi-49fdcd7df658
Cross Compiling Rust for the Raspberry Pi on Linux | HackerNoon
January 14, 2017 - Lets build a simple “Hello Pi” program in Rust and compile it for the Raspberry Pi running a Linux version. I am using a Raspberry Pi 3 and Raspbian. Why do we want to compile this on a PC? Assuming you do development of your application on a PC, it would be much faster to compile and test ...
🌐
HackerNoon
hackernoon.com › building-a-wireless-thermostat-in-rust-for-raspberry-pi-part-2
Rust Cross Compiling to the Raspberry Pi | HackerNoon
October 31, 2022 - Efficiently set up a development environment for cross-compiling Rust code for other platforms, including Raspberry Pi and AWS Lambda.
🌐
DEV Community
dev.to › h_ajsf › cross-compiling-rust-for-raspberry-pi-4iai
Cross compiling Rust for Raspberry Pi - DEV Community
September 11, 2019 - For compiling to RPi the linker required is arm-linux-gnueabihf-gcc which can be installed easily in Linux sudo apt-get install gcc-arm-linux-gnueabi make git-core ncurses-dev you can check this but it took half day from me to find how to do ...
🌐
freeCodeCamp
freecodecamp.org › news › embedded-rust-programming-on-raspberry-pi-zero-w
Embedded Rust Programming on Raspberry Pi Zero W
June 9, 2022 - my-pc:~ $ git clone https://github.com/raspberrypi/tools $HOME/rpi_tools · Edit the ~/.cargo/config file using your favourite text editor: ... [target.arm-unknown-linux-gnueabihf] linker = "/rpi_tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc" Start by creating a new Rust project, and opening the main.rs file in your favourite text editor: my-pc:~ $ cargo new blink my-pc:~ $ cd blink my-pc:~/blink $ nano src/main.rs · Import the rust_gpiozero crate, and program an LED to alternate between on and off every second:
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › other programming languages
Installing Rust on Pi 4, 32 bit Pi OS. - Raspberry Pi Forums
Seems the installer decides the Pi 4 is a 64 bit machine and it all goes wrong. To get it to work: 1) Download the installer as per the link above: ... $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 2) When prompted select option "2) Custom installation" 3) When prompted for "Default host triple?" enter "arm-unknown-linux-gnueabihf" Other options are up to you, I selected "nightly" for the default toolchain, "complete" for the profile and "y" to update my PATH.
🌐
Opensource.com
opensource.com › article › 19 › 3 › physical-computing-rust-raspberry-pi
Program the real world using Rust on Raspberry Pi | Opensource.com
March 16, 2019 - rust_gpizero uses the Rust programming language to do physical computing on the Raspberry Pi.
🌐
MakeUseOf
makeuseof.com › home › programming › how to get started with rust on raspberry pi
How to Get Started With Rust on Raspberry Pi
September 4, 2019 - Luckily Rust does this for you, and all you need to do is reboot your Pi, or log out and in again. Now checking for Rust and Cargo should work. You'll be compiling and building all of your scripts from the terminal, but you'll also need a code editor. In this project I'll be using Code-OSS, a community build of VS Code which you can install on the Pi, but it's not essential.
🌐
Medium
medium.com › hackernoon › compiling-rust-for-the-raspberry-pi-49fdcd7df658
Cross Compiling Rust for the Raspberry Pi on Linux | by Laurent Zuijdwijk | HackerNoon.com | Medium
October 15, 2020 - $ cargo build --target=armv7-unknown-linux-gnueabihf · Let’s see if we have successfully created an arm binary · $ file target/armv7-unknown-linux-gnueabihf/debug/hello-rpitarget/armv7-unknown-linux-gnueabihf/debug/hello-rpi: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, Success! When we transfer hello-rpi to our Raspberry Pi, we will be able to run it and get a fantastic “hello world!” on the command line!
🌐
GitHub
github.com › pitrk › rust_raspberry_build
GitHub - pitrk/rust_raspberry_build: Cross-compilation: Raspberry Pi Zero
> TARGET_HOST=pi@raspberry ./build_push_run.sh + : pi@raspberry + : /home/pi/raspberry_build + : arm-unknown-linux-musleabihf + : ./target/arm-unknown-linux-musleabihf/release/raspberry_build + cargo build --release --target=arm-unknown-linux-musleabihf Compiling raspberry_build v0.1.0 (/home/uname/raspberry_build) Finished release [optimized] target(s) in 0.77s + scp ./target/arm-unknown-linux-musleabihf/release/raspberry_build pi@raspberry:/home/pi/raspberry_build raspberry_build 100% 3642KB 955.9KB/s 00:02 + ssh -t pi@raspberry /home/pi/raspberry_build Hello, world! Connection to raspberry closed. cargo b # build cargo r # (build &) run cargo t # test ... siscia@RedBeardLab - Rust and glibc version - move from arm-unknown-linux-gnueabihf to arm-unknown-linux-musleabihf
Author   pitrk
🌐
Collabora
collabora.com › news-and-blog › blog › 2020 › 06 › 23 › cross-building-rust-gstreamer-plugins-for-the-raspberry-pi
Cross building Rust GStreamer plugins for the Raspberry Pi
We also need openssl as it is another build dependency of the Rust plugins. RUN dpkg --add-architecture armhf && \ apt-get update && \ apt-get install -y libgstreamer1.0-dev:armhf libgstreamer-plugins-base1.0-dev:armhf libssl-dev:armhf · Finally we need to tweak PKG_CONFIG_PATH so the build system will pick-up the right lib when building: