diff --git a/cangen/can-messages/mpu.json b/cangen/can-messages/mpu.json index 41216d4..9a9f236 100644 --- a/cangen/can-messages/mpu.json +++ b/cangen/can-messages/mpu.json @@ -131,21 +131,6 @@ } ] } - , - { - "name": "MPU/State/TorqueLimit", - "unit": "percentage", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 0.1, - "sim_inc_max": 0.1, - "points": [ - { - "size": 8, - "format": "divide100" - } - ] - } ] }, { @@ -373,6 +358,22 @@ "format": "divide10000" } ] + }, + { + "name": "MPU/Sense/SOC", + "unit": "%", + "sim": { + "min": 5, + "max": 99, + "inc_min": 0.1, + "inc_max": 0.5 + }, + "points": [ + { + "size": 8, + "endianness": "little" + } + ] } ] }, @@ -933,4 +934,4 @@ } ] } -] \ No newline at end of file +] diff --git a/cangen/can-messages/msb.json b/cangen/can-messages/msb.json index 858f44d..03892c3 100644 --- a/cangen/can-messages/msb.json +++ b/cangen/can-messages/msb.json @@ -43,12 +43,12 @@ "fields": [ { "name": "MSB/FL/Accel", - "unit": "g", + "unit": "mg", "sim": { - "min": 0, - "max": 2, - "inc_min": 0.01, - "inc_max": 0.25 + "min": -2000, + "max": 2000, + "inc_min": 0.1, + "inc_max": 2.5 }, "points": [ { @@ -74,13 +74,13 @@ "fields": [ { "name": "MSB/FL/Gyro", + "unit": "mdps", "sim": { - "min": 0, - "max": 15, - "inc_min": 0.1, - "inc_max": 0.5 + "min": -500000, + "max": 500000, + "inc_min": 10, + "inc_max": 1000 }, - "unit": "", "points": [ { "size": 16, @@ -234,12 +234,12 @@ "fields": [ { "name": "MSB/FR/Accel", - "unit": "g", + "unit": "mg", "sim": { - "min": 0, - "max": 2, - "inc_min": 0.01, - "inc_max": 0.25 + "min": -2000, + "max": 2000, + "inc_min": 0.1, + "inc_max": 2.5 }, "points": [ { @@ -265,12 +265,12 @@ "fields": [ { "name": "MSB/FR/Gyro", - "unit": "", + "unit": "mdps", "sim": { - "min": 0, - "max": 15, - "inc_min": 0.1, - "inc_max": 0.5 + "min": -500000, + "max": 500000, + "inc_min": 10, + "inc_max": 1000 }, "points": [ { @@ -425,12 +425,12 @@ "fields": [ { "name": "MSB/BL/Accel", - "unit": "g", + "unit": "mg", "sim": { - "min": 0, - "max": 2, - "inc_min": 0.01, - "inc_max": 0.25 + "min": -2000, + "max": 2000, + "inc_min": 0.1, + "inc_max": 2.5 }, "points": [ { @@ -456,12 +456,12 @@ "fields": [ { "name": "MSB/BL/Gyro", - "unit": "", + "unit": "mdps", "sim": { - "min": 0, - "max": 15, - "inc_min": 0.1, - "inc_max": 0.5 + "min": -500000, + "max": 500000, + "inc_min": 10, + "inc_max": 1000 }, "points": [ { @@ -616,12 +616,12 @@ "fields": [ { "name": "MSB/BR/Accel", - "unit": "g", + "unit": "mg", "sim": { - "min": 0, - "max": 2, - "inc_min": 0.01, - "inc_max": 0.25 + "min": -2000, + "max": 2000, + "inc_min": 0.1, + "inc_max": 2.5 }, "points": [ { @@ -647,12 +647,12 @@ "fields": [ { "name": "MSB/BR/Gyro", - "unit": "", + "unit": "mdps", "sim": { - "min": 0, - "max": 15, - "inc_min": 0.1, - "inc_max": 0.5 + "min": -500000, + "max": 500000, + "inc_min": 10, + "inc_max": 1000 }, "points": [ { diff --git a/dev/Dockerfile b/dev/Dockerfile index 70ba5f2..d273ca1 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -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 \ @@ -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 @@ -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 + diff --git a/dev/scripts/gdb.sh b/dev/scripts/gdb.sh index 91153f5..3b36e1f 100755 --- a/dev/scripts/gdb.sh +++ b/dev/scripts/gdb.sh @@ -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) diff --git a/ner_environment/build_system/build_system.py b/ner_environment/build_system/build_system.py index 0d13062..4a92a0a 100644 --- a/ner_environment/build_system/build_system.py +++ b/ner_environment/build_system/build_system.py @@ -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: @@ -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) @@ -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: diff --git a/ner_environment/build_system/miniterm.py b/ner_environment/build_system/miniterm.py index b34d4a7..04413c7 100644 --- a/ner_environment/build_system/miniterm.py +++ b/ner_environment/build_system/miniterm.py @@ -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)