Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

NER has phased out some direct docker usage. Please see the firmware page for more info.

Table of Contents

Overview

...

Embedded Software

For D&Cembedded firmware, we are going to be using a central use a centralized docker container for all projects just to try and make development a bit easier. This docker container is specialized for embedded development to replace the awful and bloated embedded tools and IDE’s we would otherwise have to work with (*cough cough STM32 Microchip TI cough cough*).

Installation

...

Install docker

...

Create a Docker account and sign in locally

...

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

  1. Install docker. For Mac and Windows, you must install docker desktop instead.

  2. If using Windows follow two more steps because Docker for Windows runs on WSL (Windows Subsystem for Linux):

    1. Update Install WSL by running wsl --update

    2. Set the default WSL version to 2 by running wsl --set-default-version 2

    3. Install the Ubuntu WSL distro by running wsl --install

    4. If you want to install a different distribution, I think you can set flags but Ubuntu is easier imo

    5. Running exit will get you out of WSL if you are in the distro

Usage

    1. install

    2. 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

  1. Make sure Docker Desktop is started

  2. Clone and open a terminal in a embedded project.

  3. Pull down the Docker container you are using by running docker pull <CONTAINER_NAME> where CONTAINER_NAME can be nwdepatie/ner-gcc-arm for microcontroller developmentcompose pull.

  4. Start the container by running docker compose run --rm ner-it --privileged -v "$PWD:/home/app" <CONTAINER_NAME>:latest bash using the same container you just pulledgcc-arm.

    1. Make sure you are running it in whatever directory you want to operate on

  5. Any flashing hardware should be mounted to container automatically

Linux

  1. Make sure Docker is started (I just run docker and it works but results may vary)
    1. the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)

Linux

  1. Clone and open a terminal in a embedded project.

  2. Pull down the Docker container you are using by running docker pull <CONTAINER_NAME> where CONTAINER_NAME can be nwdepatie/ner-gcc-arm for microcontroller developmentcompose pull.

  3. Start the container by running sudo docker compose run --rm ner-it --privileged -v "$PWD:/home/app" <CONTAINER_NAME>:latest bash using the same container you just pulledgcc-arm.

    1. Make sure you are running it in whatever directory you want to operate on

  4. Any flashing hardware should be mounted onto container automatically

    1. the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)

Windows

  1. Make sure Docker Desktop is started

  2. Pull down the Docker container you are using by running docker pull <CONTAINER_NAME> where CONTAINER_NAME can be nwdepatie/ner-gcc-arm for microcontroller development

  3. Start the container by running docker run --rm -it --privileged -v "$(PWD):/home/app" <CONTAINER_NAME>:latest bash using the same container you just pulled.

    1. Make sure you are running it in whatever directory you want to operate on

    2. If the above command doesn’t work, try docker run --rm -it --privileged -v "%cd%:/home/app" <CONTAINER_NAME>:latest bash

  4. and wsl ubuntu is installed (see above setup)

  5. To mount any flashing hardware (this may be condensed into a script in the future):

    1. Open a Windows terminal with admin privileges and run winget install usbipd

    2. Open a WSL terminal (wsl -d ubuntu) and run the following commands to enable mounting Windows USB devices in the Docker container

      1. sudo apt update

      2. sudo apt install linux-tools-virtual hwdata

      3. sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20

      Start Docker container by running docker run --rm -it --privileged -v "$(PWD):/home/app" <CONTAINER_NAME>:latest bash replacing CONTAINER_NAME with the container name in one terminal
      1. Leave the terminal open

    3. (If interacting with hardware) Mount the Raspberry Pi probe by finding the device in another Windows terminal with usbipd wsl list and mount the device in a Windows terminal window (with admin privileges the first time you do this) with usbipd wsl attach --distribution=ubuntu bind --busid=<BUSID>

      1. You’re looking for the CMSIS-DAP v2 Interface device

        Image Removed

Tools / Utils

...

      1. Image Added

    1. Run usbipd attach --wsl=ubuntu --busid <BUSID>.

    2. Clone and open a terminal in a embedded project.

    3. Pull down the Docker container you are using by running docker compose pull.

    4. Start the container by running docker compose run --rm ner-gcc-arm.

      1. 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:

  1. Open docker desktop and plug in debug probe

  2. usbipd list to get the pi debug probe BUS ID

  3. usbipd attach --wsl --busid <BUSID>

  4. docker compose run --rm ner-gcc-arm