-
-
Notifications
You must be signed in to change notification settings - Fork 845
-
I'm running Windows 10 Home, and I did not want to bother with setting up a Linux VM. Here are some of the things I had to do to get the tutorial running (at least through tutorial 5). These tips are not meant as a definitive guide, but just to give an idea of what is involved.
I'm running Windows 10 Home 20H2. I already had a Rust development environment for a Windows target (Rust 1.48, Visual Studio Code 1.51.2 + Rust extensions, Visual Studio Community 2019).
- Enable Windows Services for Linux (WSL). I used this guide.
- Install a WSL Linux distribution from the Microsoft Store. I picked Ubuntu.
- It's in the install guide, but make sure your Linux distribution is running WSL 2 (not 1). This took me a while to figure out because the wsl command kept telling me I had no Linux installed. Eventually wsl found my Linux, and I set it to be WSL 2. I have BOINC running in the background that might have slowed things down for me.
- Install Docker Desktop for Windows, link. Note that if your Windows account is not an administrator account, the account will not be added to the docker-users group. In a Windows admin shell use
net localgroup docker-users "your-user-id" /ADD
to add the account to the group. - Add the "Remote - WSL' extension to VS Code.
- From the File menu of VS Code select 'Open Folder in WSL...' and selct the 01_wait_forever folder.
- From the Terminal menu select New Terminal to get a Linux shell.
- From here I just kept typing make and adding missing packages until the make succeeded.
- apt install make
- curl https://sh.rustup.fs -sSf | sh
- apt install build-essential
- cargo install cargo-binutils
- cargo install rustfilt
Beta Was this translation helpful? Give feedback.
All reactions
-
🚀 1
Replies: 1 comment
-
Just a quick followup, not really related to the tutorial...
If after doing the above to get WSL set up for Rust and you want to cross compile for Raspian, only a little more is required.
- In the Ubuntu WSL I ran
sudo apt-get install gcc-multilib-arm-linux-gnueabihf
- Also in the Ubuntu WSL, I added the following lines to ~/.cargo/config:
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
Then using a 'Hello, world!" example, in Ubuntu WSL:
- Create the hello project:
cargo new hello-rpi --bin
- Build the hello project:
cargo build --target=armv7-unknown-linux-gnueabihf
- Copy the hello binary to the Raspberry Pi:
scp target/armv7-unknown-linux-gnueabihf/debug/hello-rpi raspberrypi:hello-rpi
Then on the Raspberry Pi target,
$ ./hello-rpi
Hello, world!
Beta Was this translation helpful? Give feedback.
All reactions
-
🚀 1