Skip to content

Commit

Permalink
Merge branch 'main' into feature/can-spec-ieee754-f32
Browse files Browse the repository at this point in the history
  • Loading branch information
harrison-e committed Dec 10, 2024
2 parents 5d4b634 + 4773522 commit 1d3d944
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 71 deletions.
33 changes: 17 additions & 16 deletions cangen/can-messages/mpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
]
},
{
Expand Down Expand Up @@ -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"
}
]
}
]
},
Expand Down Expand Up @@ -933,4 +934,4 @@
}
]
}
]
]
80 changes: 40 additions & 40 deletions cangen/can-messages/msb.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand All @@ -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,
Expand Down Expand Up @@ -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": [
{
Expand All @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand All @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand All @@ -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": [
{
Expand Down
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 1d3d944

Please sign in to comment.