summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2017-10-26 22:10:03 +0000
committerKarl Palsson <karlp@tweak.net.au>2017-10-26 22:10:03 +0000
commit8366c945925a223dfb38786d4336394e5efc7114 (patch)
treecaa0680187d7d54ffc6ad0d05fff41fa2724da18
parent0d9dca3ac952c34dffe95976e04d6098def8fda9 (diff)
downloadolsndot-8366c945925a223dfb38786d4336394e5efc7114.tar.gz
olsndot-8366c945925a223dfb38786d4336394e5efc7114.tar.bz2
olsndot-8366c945925a223dfb38786d4336394e5efc7114.zip
common openocd: use -s to find files from test dirs.
The sourcing of the common.cfg and the optional local files was failing when invoked from a test directory. Use -s and properly use [find ...] to search paths nicely.
-rw-r--r--openocd/openocd.common.cfg2
-rw-r--r--openocd/openocd.stm32f072disco.cfg2
-rw-r--r--openocd/openocd.stm32f4-disco.cfg2
-rw-r--r--openocd/openocd.stm32l053disco.cfg14
-rw-r--r--rules.mk2
5 files changed, 18 insertions, 4 deletions
diff --git a/openocd/openocd.common.cfg b/openocd/openocd.common.cfg
index b601cde..188b484 100644
--- a/openocd/openocd.common.cfg
+++ b/openocd/openocd.common.cfg
@@ -5,6 +5,6 @@
proc optional_local { LOCAL_FILE } {
if { [ file exists $LOCAL_FILE ] } {
puts "Loading custom local settings from $LOCAL_FILE"
- source $LOCAL_FILE
+ source [find $LOCAL_FILE]
}
}
diff --git a/openocd/openocd.stm32f072disco.cfg b/openocd/openocd.stm32f072disco.cfg
index b7cc25b..f43f168 100644
--- a/openocd/openocd.stm32f072disco.cfg
+++ b/openocd/openocd.stm32f072disco.cfg
@@ -2,7 +2,7 @@ source [find interface/stlink-v2.cfg]
set WORKAREASIZE 0x4000
source [find target/stm32f0x.cfg]
-source openocd.common.cfg
+source [find openocd.common.cfg]
optional_local "openocd.stm32f072disco.local.cfg"
# no trace on cm0
diff --git a/openocd/openocd.stm32f4-disco.cfg b/openocd/openocd.stm32f4-disco.cfg
index a93997c..a349319 100644
--- a/openocd/openocd.stm32f4-disco.cfg
+++ b/openocd/openocd.stm32f4-disco.cfg
@@ -2,7 +2,7 @@ source [find interface/stlink-v2.cfg]
set WORKAREASIZE 0x4000
source [find target/stm32f4x.cfg]
-source openocd.common.cfg
+source [find openocd.common.cfg]
optional_local "openocd.stm32f4-disco.local.cfg"
tpiu config internal swodump.stm32f4disco.log uart off 168000000
diff --git a/openocd/openocd.stm32l053disco.cfg b/openocd/openocd.stm32l053disco.cfg
new file mode 100644
index 0000000..83c592b
--- /dev/null
+++ b/openocd/openocd.stm32l053disco.cfg
@@ -0,0 +1,14 @@
+source [find interface/stlink-v2-1.cfg]
+set WORKAREASIZE 0x1000
+source [find target/stm32l0.cfg]
+
+source [find openocd.common.cfg]
+optional_local "openocd.stm32l053disco.local.cfg"
+
+# no trace on cm0
+#tpiu config internal swodump.stm32f4disco.log uart off 168000000
+
+# Uncomment to reset on connect, for grabbing under WFI et al
+reset_config srst_only srst_nogate
+# reset_config srst_only srst_nogate connect_assert_srst
+
diff --git a/rules.mk b/rules.mk
index 2cb7248..7f9b393 100644
--- a/rules.mk
+++ b/rules.mk
@@ -157,7 +157,7 @@ ifeq (,$(OOCD_FILE))
$(NULL)
else
$(Q)(echo "halt; program $(realpath $(*).elf) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
- $(OOCD) -f $(OOCD_FILE) \
+ $(OOCD) -s ../../openocd/ -f $(OOCD_FILE) \
-c "program $(*).elf verify reset exit" \
$(NULL)
endif