Contains the correct linker setup and a Cargo Makefile that builds and transfers the cross compiled program to the Raspberry pi. Follow the instructions to cross compile.
You'll need to point the path in ./.cargo/config.toml:
[target.armv7-unknown-linux-gnueabihf]
linker = "path/to/the/linker/you/downloaded
Develop the files in WSL. Change the environment variables in Makefile.toml
they're
correct for the project and the raspberry pi.
Build the program using one of the commands:
cargo make debug
cargo make release
Log on to the Rpi and run the program.
- Start the pi and set a password
- Enable SSH:
sudo raspi-config
> Interfacing Options
> SSH
> Enable
- Find the IP:
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
- Confirm additional information
whoami > returns "pi"
hostname > returns "raspberrypi"
Install rustup and Rust.
- Install the correct target
rustup target add armv7-unknown-linux-gnueabihf
- Install the linker
- Add path to extracted toolchain to ".bashrc":
export PATH="$HOME/PATH_TO_YOUR_DOWNLOAD/PATH_TO_TOOLCHAIN_FOLDER/bin:$PATH"
- Install sshpass
sudo apt install sshpass
- Install cargo make
cargo install cargo-make