Versions Compared

Key

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

...

  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. 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
    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 bind --distribution=ubuntu --busid=<BUSID>

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

        Image RemovedImage Added

    4. Run usbipd attach --wsl --busid <BUSID>

Tools / Utils

Code Block
# 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"