mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
dist/tools/openocd/stlink: handle new and old Openocd version
This commit is contained in:
parent
48e5bbc8ba
commit
f18d3f5663
12
dist/tools/openocd/adapters/stlink.cfg
vendored
Normal file
12
dist/tools/openocd/adapters/stlink.cfg
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# OpenOCD currently uses a single configuration file for all ST-Link
|
||||
# adapters. However not all supported distributions use the latest
|
||||
# OpenOCD.
|
||||
# If the default script isn't available then use the old method via
|
||||
# specifying the correct version.
|
||||
try {
|
||||
source [find interface/stlink.cfg]
|
||||
} on error {} {
|
||||
puts "WARNING: using old version of OpenOCD"
|
||||
puts "Using STLINK_VERSION $stlink_version"
|
||||
source [find interface/stlink-v${stlink_version}.cfg]
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
# ST-Link debug adapter
|
||||
# Use st-link v2-1 by default
|
||||
|
||||
# Set the default version for the old OpenOCD versions
|
||||
STLINK_VERSION ?= 2-1
|
||||
|
||||
# Use STLINK_VERSION to select which stlink version is used
|
||||
OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/stlink-v$(STLINK_VERSION).cfg]'
|
||||
# Determine which configuration file to use for OpenOCD.
|
||||
# Also pass the correct version of the ST-Link adapter to the script.
|
||||
OPENOCD_ADAPTER_INIT ?= -c 'set stlink_version $(STLINK_VERSION);source $(RIOTBASE)/dist/tools/openocd/adapters/stlink.cfg'
|
||||
|
||||
# If swd / jtag is selected by the board, prefix it with hla_
|
||||
ifneq (,$(filter swd jtag,$(OPENOCD_TRANSPORT)))
|
||||
|
Loading…
Reference in New Issue
Block a user