Overview
Data & Controls
For D&C, we are going to be using a central 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
Create a Docker account and sign in locally
If Windows follow two more steps because Docker for Windows runs on WSL (Windows Subsystem for Linux):
Update WSL by running
wsl --update
Set the default WSL version to 2 by running
wsl --set-default-version 2
Install the Ubuntu WSL distro by running
wsl --install
If you want to install a different distribution, I think you can set flags but Ubuntu is easier imo
Running
exit
will get you out of WSL if you are in the distro
Usage
MacOS
Make sure Docker Desktop is started
Pull down the Docker container you are using by running
docker pull <CONTAINER_NAME>
where CONTAINER_NAME can benwdepatie/ner-gcc-arm
for microcontroller developmentStart the container by running
docker run --rm -it --privileged -v "$PWD:/home/app" <CONTAINER_NAME>:latest bash
using the same container you just pulled.Make sure you are running it in whatever directory you want to operate on
Any flashing hardware should be mounted to container automatically
Linux
Make sure Docker is started (I just run
docker
and it works but results may vary)Pull down the Docker container you are using by running
docker pull <CONTAINER_NAME>
where CONTAINER_NAME can benwdepatie/ner-gcc-arm
for microcontroller developmentStart the container by running
sudo docker run --rm -it --privileged -v "$PWD:/home/app" <CONTAINER_NAME>:latest bash
using the same container you just pulled.Make sure you are running it in whatever directory you want to operate on
Any flashing hardware should be mounted onto container automatically
Windows
Make sure Docker Desktop is started
Pull down the Docker container you are using by running
docker pull <CONTAINER_NAME>
where CONTAINER_NAME can benwdepatie/ner-gcc-arm
for microcontroller developmentStart the container by running
docker run --rm -it --privileged -v "$(PWD):/home/app" <CONTAINER_NAME>:latest bash
using the same container you just pulled.Make sure you are running it in whatever directory you want to operate on
If the above command doesn’t work, try
docker run --rm -it --privileged -v "%cd%:/home/app" <CONTAINER_NAME>:latest bash
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
) and run the following commands to enable mounting Windows USB devices in the Docker containersudo apt update
sudo apt install linux-tools-virtual hwdata
sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
(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) withusbipd bind --busid=<BUSID>
You’re looking for the
CMSIS-DAP v2 Interface
device
Run
usbipd attach --wsl --busid <BUSID>
Tools / Utils
# to build project make all # to open a serial port (make sure /dev/tty0/ACM0 exists first) minicom -b 115200 -o -D /dev/ttyACM0 # to emulate MCU code renode # to flash STM board with Raspberry Pi Probe openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "program ./build/cerberus.elf verify reset exit"