Skip to content

Commit

Permalink
added safe dir (#207)
Browse files Browse the repository at this point in the history
* added safe dir

* removed tmux and libncurses

* removed more packages

* poop fart
  • Loading branch information
dyldonahue authored Dec 8, 2024
1 parent f6ffa63 commit 4773522
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
13 changes: 4 additions & 9 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ RUN apt-get update && apt-get install -y \
minicom \
vim \
clang-format \
tmux \
libncurses5 \
linux-tools-generic \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
Expand All @@ -27,13 +25,6 @@ RUN apt-get update && apt-get install -y \
python3 \
python3-pip

# Install and setup rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup target add armv7-unknown-linux-gnueabihf

# Install Python YAML Parser
RUN pip install "ruamel.yaml<0.18.0"

RUN wget https://builds.renode.io/renode-1.14.0+20231003gitf86ac3cf.linux-portable.tar.gz
RUN mkdir renode_portable && tar -xvf renode-*.linux-portable.tar.gz -C renode_portable --strip-components=1
Expand All @@ -56,3 +47,7 @@ RUN wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021
ENV PATH $PATH:/home/dev/gcc-arm-none-eabi-10.3-2021.10/bin

WORKDIR /home/app

# Set up safe directory
RUN git config --global --add safe.directory /home/app

2 changes: 1 addition & 1 deletion dev/scripts/gdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ elf_file=$(ls /home/app/build/*.elf)

printf "$elf_file"

openocd -f interface/cmsis-dap.cfg -f target/"$STM_TARGET_NAME"x.cfg -c "adapter speed 5000" -c "init" -c "reset halt" & sleep 1 && arm-none-eabi-gdb $elf_file -ex "target remote localhost:3333"
openocd -f interface/cmsis-dap.cfg -f target/"$STM_TARGET_NAME"x.cfg -c "adapter speed 5000" -c "init" -c "reset halt" & sleep 1 && gdb $elf_file -ex "target remote localhost:3333"

kill $(pidof openocd)
7 changes: 4 additions & 3 deletions ner_environment/build_system/build_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def build(profile: str = typer.Option(None, "--profile", "-p", callback=unsuppor

@app.command(help="Configure autoformatter settings")
def clang(disable: bool = typer.Option(False, "--disable","-d", help="Disable clang-format"),
enable: bool = typer.Option(False, "--enable", "-e", help="Enable clang-format"),
enablrune: bool = typer.Option(False, "--enable", "-e", help="Enable clang-format"),
run: bool = typer.Option(False, "--run", "-r", help="Run clang-format")):

if disable:
Expand Down Expand Up @@ -113,7 +113,7 @@ def debug(ftdi: bool = typer.Option(False, "--ftdi", help="Set this flag if the
if platform.system() == "Linux" and is_wsl() == 0:
gdb_uri = "localhost"

send_command = ["docker", "compose", "run", "--rm", "ner-gcc-arm", "arm-none-eabi-gdb", f"/home/app/build/{elf_file}", "-ex", f"target extended-remote {gdb_uri}:3333"]
send_command = ["docker", "compose", "run", "--rm", "ner-gcc-arm", "gdb", f"/home/app/build/{elf_file}", "-ex", f"target extended-remote {gdb_uri}:3333"]

subprocess.run(send_command)

Expand Down Expand Up @@ -168,7 +168,8 @@ def flash(ftdi: bool = typer.Option(False, "--ftdi", help="Set this flag if the
# ==============================================================================

@app.command(help="Open UART terminal of conneced device")
def serial(ls: bool = typer.Option(False, "--list", help="Specify the device to connect or disconnect (e.g., /dev/ttyACM0,/dev/ttyUSB0,/dev/ttyUSB1,COM1)"),
def serial(ls: bool = typer.Option(False, "--list", help='''Specify the device to connect or disconnect (e.g., /dev/ttyACM0,/dev/ttyUSB0,/dev/ttyUSB1,COM1)
Mandatory on MacOS, may be optional on otherwise. On Mac, find this by running `ls /dev/tty.usb*' '''),
device: str = typer.Option("", "--device", "-d", help="Specify the board to connect to")):

if ls:
Expand Down
3 changes: 1 addition & 2 deletions ner_environment/build_system/miniterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def list_usb_devices():
print(f"Failed to list USB devices on Windows: {e}", file=sys.stderr)
sys.exit(1)

elif os_name == 'Linux' or os_name == 'Darwin': # Darwin is macOS
# List USB devices on Unix-like systems
elif os_name == 'Linux':
try:
result = subprocess.run(['ls /dev/tty*'], shell=True, capture_output=True, text=True)

Expand Down

0 comments on commit 4773522

Please sign in to comment.