From 02a631521198a1f7bf5dfe2eba07cef8f3a0e1d8 Mon Sep 17 00:00:00 2001 From: Jack Rubacha Date: Wed, 22 May 2024 19:02:07 -0400 Subject: [PATCH] add msb compose (#3) --- README.md | 67 ++++------------------------------------------------- art | 7 ++++++ compose.yml | 22 ++++++++++++++++++ 3 files changed, 33 insertions(+), 63 deletions(-) create mode 100644 art create mode 100644 compose.yml diff --git a/README.md b/README.md index e71ff66..1ecd3a1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Cerberus -> FreeRTOS Application that collects mechanical data across the car +# MSB-FW +Our FreeRTOS Application for Distributed Sensing ## Setting up Docker Environment > For initial installation, visit here: https://nerdocs.atlassian.net/wiki/spaces/NER/pages/108888108/Setting+Up+STM32+Dev+Env @@ -7,68 +7,9 @@ ``` # TLDR: # Pull Container: -docker pull nwdepatie/ner-gcc-arm +docker compose pull # Run Container -# macOS: -docker run --rm -it --privileged -v "$PWD:/home/app" nwdepatie/ner-gcc-arm:latest bash - -# Windows: -docker run --rm -it --privileged -v "%cd%:/home/app" nwdepatie/ner-gcc-arm:latest bash -# or -docker run --rm -it --privileged -v "$(PWD):/home/app" nwdepatie/ner-gcc-arm:latest bash - -# Linux: -sudo docker run --rm -it --privileged -v "$PWD:/home/app" nwdepatie/ner-gcc-arm:latest bash -``` - -## Container Tools and Utilities -> This container is packed with tools that can be utilized by developers to give them more insight into their developed software, we've used bash aliases to make the commands more compact for ease of use -``` -## Tools / Utils - -# to build project -make all - -# to run Renode emulation -emulate -start -# Actual command is: -# renode cerberus.resc - -# to open a serial port with Rasberry Pi Probe (make sure /dev/tty0/ACM0 exists first) -serial -# Actual command is: -# minicom -b 115200 -o -D /dev/ttyACM0 - -# to flash STM board with Raspberry Pi Probe (WIP) -flash -# Actual command is: -# openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "program ./build/cerberus.elf verify reset exit" +docker compose run --rm ner-gcc-arm ``` -### Mounting Hardware to Docker Container in Windows -> Very specific use case but nonetheless needed, also documented in the above confluence page, on macOS and Linux this happens by default when running privileged docker container -**We now have a Python script to automatically mount hardware! Run:** `python3 mount.py` - -For manually mounting, follow the process below: -``` -# Connect probe and open two terminals - -# Terminal 1: -wsl -d ubuntu - -# Terminal 2 -usbipd wsl list -usbipd wsl attach --distribution=ubuntu --busid= # Terminal might need to be elevated to admin privileges for this - -# Close the other wsl window, the device should be mounted to any WSL instance -# Start docker container -``` -## Building Docker Container -> Typically this isn't needed unless making local changes to Dockerfile, please default to the first method via pulling the docker container -``` -# if need to rebuild image -sudo docker image prune -a -sudo docker build -f ./Dockerfile -t ner-gcc-arm . -``` diff --git a/art b/art new file mode 100644 index 0000000..1861504 --- /dev/null +++ b/art @@ -0,0 +1,7 @@ + ___ ___ _____ ____ _____ __ __ +| | |/ ___/| \ | || |__| | +| _ _ ( \_ | o ) _____ | __|| | | | +| \_/ |\__ || || || |_ | | | | +| | |/ \ || O ||_____|| _] | ` ' | +| | |\ || | | | \ / +|___|___| \___||_____| |__| \_/\_/ diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..14ef1a2 --- /dev/null +++ b/compose.yml @@ -0,0 +1,22 @@ +name: msb-fw + +services: + ner-gcc-arm: + image: ghcr.io/northeastern-electric-racing/embedded-base:main + build: . + # network_mode: host + privileged: true + volumes: + - type: bind + source: . + target: /home/app + tty: true + #expose: + # - "3240" + environment: + - DEBUG_PORT=/dev/ttyACM0 + - STM_TARGET_NAME=stm32f4 + # - USBIP_PORT=1-1.4 + devices: + - "/dev/ttyACM0:/dev/ttyACM0" +