These are the instructions for setting up a development environment OS version Windows 10 using the Windows Subsystem for Linux (WSL). Take care to validate at each ✔️Check point before moving on to the next step. If you hit a snag, reach out on Piazza or come to office hours for help!
You may need to restart your computer a few times throughout this process, so it’s a good idea to save all work before starting so you can restart when prompted.
These instructions are newly updated for Winter Quarter 2020. We did our testing on Windows 10 version 1903 and recommend that your version match ours. Confirm your OS version by typing “winver” into the start menu search bar and run the suggested command. A panel appears that reports the OS version as shown in this screenshot:
If your OS version is 1903 (or newer), you are good to go!
Enable WSL with Ubuntu 16.04
Windows OS does not natively support the development tools used in this course. Enabling WSL (Windows Subsystem for Linux) allows you to run an Ubuntu instance on top of Windows OS. You will install the necessary development tools into the Ubuntu WSL environment and do your coursework there.
Enable WSL in Settings
- Type “features” into start bar and open the Control panel to “Turn Windows features on or off”.
- In the panel, find the checkbox “Windows Subsystem for Linux”. Check the box, and click “OK”. Wait for it to complete the requested changes and then restart your computer when prompted.
Install Ubuntu 16.04
We will use Ubuntu version 16.04 under WSL.
- Open the Microsoft Store app. Search for “Ubuntu”, select
Ubuntu 16.04 LTSand install it.
- Once it’s done, launch the application. A terminal window will open that says “Installing, this may take a few minutes…”.
- Once that command finishes, you’ll be prompted to enter a new username and password for your Ubuntu account. You’ll need this name and password for administrator privileges, so be sure to remember it!
You now have a linux terminal running on Windows. It’s a good idea to bring the OS up-to-date, so we’ll do that first. Run the following commands:
$ sudo apt update $ sudo apt upgrade
✔️Check: confirm Ubuntu release:
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial
You now have an up-to-date version of Ubuntu running on top of your Windows OS.
Accessing WSL files from Windows
An important thing to note about WSL is that it hosts its own file system. The files you access within the WSL terminal are separate from your regular Windows file system. You can integrate your WSL files into the Windows File Explorer by changing to a particular directory in the WSL terminal and using the command:
$ explorer.exe .
A File Explorer window opens in Windows that shows the WSL files in the current directory. Windows applications can now access these files that live in the WSL file system. This allows you to edit WSL text files using your favorite Windows text editing app. Nifty!
Install arm-none-eabi toolchain
We use a cross-compiler toolchain to compile programs for the Raspberry Pi.
Install the gcc compiler and gdb debugger packages.
$ sudo apt install gcc-arm-none-eabi gdb-arm-none-eabi
✔️Check: confirm toolchain installation with these two commands:
$ arm-none-eabi-gcc --version arm-none-eabi-gcc (15:4.9.3+svn231177-1) 4.9.3 20150529 Copyright (C) 2014 Free Software Foundation, Inc. $ grep gdbsim `which arm-none-eabi-gdb` Binary file /usr/bin/arm-none-eabi-gdb matches
Install Python3 and packages
rpi-install.py script will be used to send programs from your computer to the Pi. This script requires installation of python3 and two support modules.
Note: Ubuntu 16.04 comes with a version of python installed, but it is an older version (version 2) which is nearing end of life. You need python version 3.
Install python3 and pip. Run the following command from your WSL terminal:
$ sudo apt install python3-pip
$ python3 --version Python 3.5.2
Install the pyserial and xmodem packages for python3:
$ python3 -m pip install pyserial xmodem
You may see a warning about the pip version being slightly out of date, this is harmless and can be ignored.
xmodemare listed as installed packages for python3:
$ python3 -m pip list --user pyserial (3.4) xmodem (0.4.5)
After following the above steps, you’ve installed the development tools. Continue on to follow the instructions to configure your user account.