From eb25aa623fb3cdbc131c966fe2c516caa85da7a7 Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Fri, 27 May 2011 06:54:00 -0400 Subject: openocd: Add missing file Forgot openocd support script in 0e5eb75c80bd8036bf85bfe0cce09d1fce56f50a. --- support/scripts/openocd-wrapper.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 support/scripts/openocd-wrapper.sh (limited to 'support') diff --git a/support/scripts/openocd-wrapper.sh b/support/scripts/openocd-wrapper.sh new file mode 100755 index 0000000..73be92e --- /dev/null +++ b/support/scripts/openocd-wrapper.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Helper to decide which openocd script to use. We only support 0.3.x and 0.4.x. + +if [ $# -ne 1 ] +then + echo "Usage: `basename $0` {flash|debug}" + exit 1 +fi + +OPENOCD_VERSION=`openocd -v 2>&1 | head -n1 | \ + awk '{print $4}' | sed 's/\([0-9]*\.[0-9]*\)\.[0-9]*/\1/'` + +CFG_FILE=$1_${OPENOCD_VERSION}.cfg + +openocd -f support/openocd/$CFG_FILE -- cgit v1.2.3