Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Installation

MacOS / Linux

  1. Clone repo

  2. Install docker

  3. Run Docker Desktop

  4. Open a terminal in the repo directory

  5. Build sample STM dockerfile: sudo docker build -f ./Dockerfile -t ner-gcc-arm .

    1. Note that you only have to do this once really or if the environment was updated, not every time you want to develop

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

  1. Clone repo

  2. Install docker

  3. 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)

  4. Open a Windows terminal and run winget install usbipd

  5. Open a WSL terminal (wsl -d ubuntu) and run sudo apt install linux-tools-virtual hwdata and sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 2 (might need to run sudo update-alternatives before running that last command ?)

    1. If the first command produces errors, try running sudo apt-get update and then rerun the command

  6. Open Docker Desktop

  7. Open a terminal in the repo directory

  8. Build sample STM dockerfile with docker build -f ./Dockerfile -t ner-gcc-arm .

    1. Note that you only have to do this once really or if the environment was updated, not every time you want to develop

  9. Start sample STM dockerfile with docker run --rm -it --privileged -v "$(PWD):/home/app" ner-gcc-arm:latest bash

  10. Start the Ubuntu WSL client with wsl -d ubuntu in one terminal

  11. (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 --busid=<BUSID>

Usage

Start Container on MacOS/Linux

In any terminal that is in the directory:

# 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:

# 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

# 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 flash STM board with Raspberry Pi Probe (WIP)
openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "program ./build/cerberus.elf verify reset exit"
  • No labels