Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Jan 5, 2024
1 parent 3e1f00e commit 4da7ea3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Dockerfile.hardware
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ RUN apt update && apt install -y \
COPY --from=pkg-builder /ros_ws /ros_ws

# copy firmware built in previous stage
RUN curl -LJO https://github.com/husarion/rosbot-stm32-firmware/releases/download/$ROSBOT_FW_RELEASE/firmware_diff.bin -o /root/firmware_diff.bin && \
curl -LJO https://github.com/husarion/rosbot-stm32-firmware/releases/download/$ROSBOT_FW_RELEASE/firmware_bin.bin -o /root/firmware_mecanum.bin
RUN cd root && \
curl https://github.com/husarion/rosbot-stm32-firmware/releases/download/$ROSBOT_FW_RELEASE/firmware_diff.bin -o firmware_diff.bin && \
curl https://github.com/husarion/rosbot-stm32-firmware/releases/download/$ROSBOT_FW_RELEASE/firmware_mec.bin -o firmware_mecanum.bin

# copy scripts
COPY ./flash-firmware.py /
Expand Down
6 changes: 3 additions & 3 deletions flash-firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ def __init__(self, sys_arch, binary_file):

print(f"System architecture: {self.sys_arch}")

if self.sys_arch.stdout == b"armv7l\n":
if self.sys_arch == "armv7l\n":
# Setups ThinkerBoard pins
print("Device: ThinkerBoard\n")
self.port = "/dev/ttyS1"
boot0_pin_no = 164
reset_pin_no = 184

elif self.sys_arch.stdout == b"x86_64\n":
elif self.sys_arch == "x86_64\n":
# Setups UpBoard pins
print("Device: UpBoard\n")
self.port = "/dev/ttyS4"
boot0_pin_no = 17
reset_pin_no = 18

elif self.sys_arch.stdout == b"aarch64\n":
elif self.sys_arch == "aarch64\n":
# Setups RPi pins
print("Device: RPi\n")
self.port = "/dev/ttyAMA0"
Expand Down

0 comments on commit 4da7ea3

Please sign in to comment.