Table of Contents |
---|
Installation
MacOS / Linux
...
Clone repo
...
...
Run Docker Desktop
...
Open a terminal in the repo directory
...
Note |
---|
NER has phased out some direct docker usage. Please see the firmware page for more info. |
Table of Contents |
---|
Overview
Embedded Software
For embedded firmware, we use a centralized docker container to contain embedded tools that work best on a single, Linux-based platform. This helps ensure we can allow all members to have easy and consistent access to certain tools that may not be available of work as well on different platforms. While in our setup, you may not manually need to interact with the container much, it is encouraged to understand how and why its used, as its a very industry-standard tool
Installation
Install docker. For Mac and Windows, you must install docker desktop instead.
If using Windows follow two more steps because Docker for Windows runs on WSL (Windows Subsystem for Linux):
Install WSL by running
wsl --install
Setup wsl by launching ubuntu from the start menu
Usage
Note |
---|
This has been phased out, see NER Build System for the new way. |
MacOS
Make sure Docker Desktop is started
Clone and open a terminal in a embedded project.
Pull down the Docker container you are using by running
docker compose pull
.Start the container by running
docker compose run --rm ner-gcc-arm
.Note that you only have to do this once really or if the environment was updated, not every time you want to develop
Start sample STM dockerfile:
sudo docker run --rm -it --privileged -v "$PWD:/home/app" ner-gcc-arm:latest bash
Windows
Installation of this environment is a bit more annoying in Windows smh
Clone repo
Update wsl2 stuff https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package and install a distro (do Ubuntu, makes it much easier, I was just able to run
wsl --install
and it worked)- Open a Windows terminal
Make sure you are running it in the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)
Linux
Clone and open a terminal in a embedded project.
Pull down the Docker container you are using by running
docker compose pull
.Start the container by running
docker compose run --rm ner-gcc-arm
.Make sure you are running it in the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)
Windows
Make sure Docker Desktop is started and wsl ubuntu is installed (see above setup)
To mount any flashing hardware (this may be condensed into a script in the future):
Open a Windows terminal with admin privileges and run
winget install usbipd
Open a WSL terminal (
wsl
sudo apt install linux-tools-virtual hwdata
andsudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 2
(might need to runsudo update-alternatives
before running that last command ?)Open Docker Desktop
Open a terminal in the repo directory
Build sample STM dockerfile with
docker build -f ./Dockerfile -t ner-gcc-arm .
Note that you only have to do this once really or if the environment was updated, not every time you want to develop
Start sample STM dockerfile with
docker run --rm -it --privileged -v "$(PWD):/home/app" ner-gcc-arm:latest bash
- Start the Ubuntu WSL client with
wsl -d ubuntu
in one terminal) and run the following commands to enable mounting Windows USB devices in the Docker container
Leave the terminal open
(If interacting with hardware) Mount the Raspberry Pi probe by finding the device in another Windows terminal with
usbipd
list
and mount the device in a Windows terminal window (with admin privileges the first time you do this) with
usbipd bind --busid=<BUSID>
You’re looking for the
CMSIS-DAP v2 Interface
device
Run
usbipd attach --
wsl=ubuntu --busid
<BUSID>
Usage
Start Container on MacOS/Linux
In any terminal that is in the directory:
Code Block |
---|
# if need to rebuild image
sudo docker build -f ./Dockerfile -t ner-gcc-arm .
sudo docker run --rm -it --privileged -v "$(PWD):/home/app" ner-gcc-arm:latest bash |
Start Container on Windows
In any terminal that is in the directory:
Code Block |
---|
# if need to rebuild image
# docker build -f ./Dockerfile -t ner-gcc-arm .
docker run --rm -it --privileged -v "$(PWD):/home/app" ner-gcc-arm:latest bash
# mounting probe
# in another terminal run wsl -d ubuntu
usbipd wsl list
usbipd wsl attach --distribution=ubuntu --busid=<BUSID>
# close the other wsl window, the device should be mounted to any wsl instance |
Tools / Utils
...
.
Clone and open a terminal in a embedded project.
Pull down the Docker container you are using by running
docker compose pull
.Start the container by running
docker compose run --rm ner-gcc-arm
.Make sure you are running it in the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)
All future mounts after the first time on the device should be:
Open docker desktop and plug in debug probe
usbipd list
to get the pi debug probe BUS IDusbipd attach --wsl --busid <BUSID>
docker compose run --rm ner-gcc-arm