Example of a simple rust app developed on windows and cross compiled to run on a RG35XX.
- Install WSL v2
- Install Docker Desktop
- Turn on Docker Desktop WSL 2
- Enable Docker support in WSL 2
- Download adb
- In your WSL Terminal
- Install build-essential
sudo apt install build-essential
- Install Rust (I used the default install)
- Install cross
- Install build-essential
- Clone this repo
- Optional
In windows, modify the files in this-repo (I use VS Code)
In your WSL Terminal
# Navigate to where you cloned this repo
# e.g. "cd /mnt/c/Users/your-name/rg35xx-rust"
# Build the Rust app
cross build --target armv7-unknown-linux-musleabihf
In your Windows Terminal
# Navigate to this cloned repo
# e.g. "cd c:\Users\your-name\rg35xx-rust"
# Navigate to the built app
cd target\armv7-unknown-linux-musleabihf\debug
# Copy it to the device
\path\to\adb.exe push --sync .\hellorust "/mnt/mmc/hellorust"
In your Windows Terminal
# Open a shell on your device
\path\to\adb.exe shell
# Run the app
/mnt/mmc/hellorust
- Easy to digest blog post Reproducible cross-compilation for Rust (with Docker) got me most of the way
- Hello World example in the official Rust docs
- Learned a lot from the Cross compiling for arm or aarch64 on Debian or Ubuntu video on YouTube and associated blog post
- Drone has a tutorial for another approach