Skip to content

Commit

Permalink
Detect SWD programmer
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jan 20, 2020
1 parent f7412af commit ea92c60
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/nrf52/flash-boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
set -e # Exit when any command fails.
set -x # Echo all commands.

# Identify SWD programmer. /proc/device-tree/model contains
# Raspberry Pi 4 Model B Rev 1.1
# Raspberry Pi 3 Model B Plus Rev 1.3
swd_device=stlink
if [ -e /proc/device-tree/model ]; then
swd_device=pi
fi

openocd/bin/openocd \
-f scripts/nrf52/swd-stlink.ocd \
-f scripts/nrf52/swd-$swd_device.ocd \
-f scripts/nrf52/flash-boot.ocd

0 comments on commit ea92c60

Please sign in to comment.