Merge pull request #14856 from jhaand/master
Updated stlink makefile to use OpenOCD's single configuration file.
This commit is contained in:
commit
c11a06224c
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
|
# ST-Link debug adapter
|
||||||
# Use st-link v2-1 by default
|
|
||||||
|
# Set the default version for the old OpenOCD versions
|
||||||
STLINK_VERSION ?= 2-1
|
STLINK_VERSION ?= 2-1
|
||||||
|
|
||||||
# Use STLINK_VERSION to select which stlink version is used
|
# Determine which configuration file to use for OpenOCD.
|
||||||
OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/stlink-v$(STLINK_VERSION).cfg]'
|
# 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_
|
# If swd / jtag is selected by the board, prefix it with hla_
|
||||||
ifneq (,$(filter swd jtag,$(OPENOCD_TRANSPORT)))
|
ifneq (,$(filter swd jtag,$(OPENOCD_TRANSPORT)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user