...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Environment Setup
PLEASE READ IF USING Windows
We use WSL on Windows. All commands henceforth are either from WSL (labelled WSL) or the Windows “terminal” app (labelled Windows) .
To get ready for this guide, run with Windows Terminal app:
Code Block |
---|
wsl --update |
1. Install Python
...
We use various packages and tools from these ecosystems, and so its essential to have both installed on your machine. Obviously, you can skip this step if you already have these installed.
...
Code Block |
---|
brew install python |
Linux
...
and WSL
Install python with whatever package manager you like, if not already installed
ex on Debian based systems with apt (including WSL):
Code Block |
---|
sudo apt update sudo apt install python3 python3-pip python3-venv |
...
We use WSL on Windows. All commands henceforth are either from wsl (labelled wsl) or the Windows “terminal” app (labelled Windows) .
From Windows:
Code Block |
---|
wsl --update |
2. Install Git
Same deal with package managers as above, but generally:
...
Follow the guidelines found here : Setting Up Docker Windows to install Docker (Linux) or Docker Desktop (Macos and Windows) Setting Up Docker
Windows users: Turn on WSL integration in Docker Desktop settings. Do this by going to Settings → Resources → WSL Integration → Check off Turn on “Ubuntu”
4. Setup Scripts
Info |
---|
It is strongly recommended to maintain a directory structure like the following |
...
Info |
---|
Windows users: For better build performance, clone this to a folder within the Ubuntu disk. Do this by entering the ~ folder with |
Open the Embedded-Base repo, and run
...
Without this alias, activating the ner-venv (or any python venv for that matter) is done by going to the directory where the venv is located (for this case, it should be one higher directory level than the “Embedded-Base” repo) and running:
On To begin developing on Linux/Mac/WSL:
Code Block |
---|
source ner-venv/bin/activate |
The virtual environment can then be deactivated from anywhere by running “deactivate”
Windows users, see below to https://nerdocs.atlassian.net/wiki/spaces/NER/pages/edit-v2/524451844#c.-(Windows-only)-WSL-passthrough when you want to interact with external hardware!
The virtual environment can then be deactivated from anywhere by running “deactivate”
Note |
---|
You always need the venv active when trying to interact with our build system |
...
See /wiki/spaces/NER/pages/611516420 for a full overview of the NER build system
c. (Windows only) WSL passthrough
Basically, WSL doesnt get the USB devices such as our circuit boards, by default. A program usbipd
fixes that. But, it cannot be run from WSL and therefore not automated.
First, to install, run winget install usbipd
in a Windows (non WSL) terminal.
Now, every time a new circuit board is plugged in for the first time, open a adminstrator command prompt terminal and run:
Code Block | ||
---|---|---|
| ||
usbipd list
# identify the device from the list (usually called FTDI or CMSIS-DAP), and enter its bus ID below
usbipd bind --busid <BUS_ID> |
Every time you plug in the device, run from a non-adminstrator windows terminal (not wsl):
Code Block |
---|
usbipd attach --wsl --busid <BUS_ID> |
Learning Resources
a. Git
View file | ||
---|---|---|
|
...