Skip to content

Commit

Permalink
add openocd support
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Apr 17, 2024
1 parent 5f06b3f commit ffad0e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ RUN apt-get update && apt-get install -y \
cmake \
libssl-dev \
python3 \
python3-pip
python3-pip \
udevadm \
usbutils

# Install and setup rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
Expand Down
1 change: 1 addition & 0 deletions dev/scripts/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ alias flash='/home/dev/scripts/flash.sh'
alias emulate='/home/dev/scripts/emulate.sh'
alias debug='/home/dev/scripts/gdb.sh'
alias ody-connect='source /home/dev/scripts/ody-connect.sh'
alias curr-serial='/home/dev/scripts/curr-serial.sh'
5 changes: 5 additions & 0 deletions dev/scripts/curr-serial.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

serial_num=$(udevadm info "$DEBUG_PORT" -a | sed -n -e 's/^.*ATTRS{serial}=="//p' | head -n 1 | sed 's/.$//')

echo "$serial_num"
2 changes: 1 addition & 1 deletion dev/scripts/flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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 "program $elf_file verify reset exit"
openocd -f interface/cmsis-dap.cfg -f target/"$STM_TARGET_NAME"x.cfg -c "adapter speed 5000" -c "cmsis_dap_serial serial_string $(curr-serial)" -c "program $elf_file verify reset exit"

0 comments on commit ffad0e4

Please sign in to comment.