Rust code to be cross compiled from a Mac for running on a Raspi. Contains an LED blink demo (GPIO) and a fibonacci speed test.
# Pi
rustup target add armv7-unknown-linux-gnueabihf
# Pi 0
rustup target add arm-unknown-linux-gnueabihf
- Clone cross and build
git clone [email protected]:rust-embedded/cross.git
cd cross
cargo build --release
- Ensure Docker is running
- Run the build command
~/Projects/cross/target/release/cross build --release --target=armv7-unknown-linux-gnueabihf
- Copy files to your Pi
scp target/armv7-unknown-linux-gnueabihf/release/rust-cross-pi [email protected]:/home/pi
- SSH into the Pi
- If using LED Blink demo, simply run the command
./rust-cross-pi
- If using fibonacci speed test, run command with a number argument. This will be the seed for the fibonacci algorithm
./rust-cross-pi 30