2017-10-06 14:53:26 +02:00
|
|
|
# ST-Link debug adapter
|
2018-01-30 08:37:56 +01:00
|
|
|
# Use st-link v2-1 by default
|
|
|
|
STLINK_VERSION ?= 2-1
|
|
|
|
|
2017-10-06 14:53:26 +02:00
|
|
|
# Use STLINK_VERSION to select which stlink version is used
|
|
|
|
OPENOCD_ADAPTER_INIT ?= \
|
|
|
|
-c 'source [find interface/stlink-v$(STLINK_VERSION).cfg]' \
|
|
|
|
-c 'transport select hla_swd'
|
|
|
|
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
|
|
|
|
ifneq (,$(DEBUG_ADAPTER_ID))
|
|
|
|
OPENOCD_ADAPTER_INIT += -c 'hla_serial $(DEBUG_ADAPTER_ID)'
|
|
|
|
endif
|
2018-01-30 08:37:56 +01:00
|
|
|
|
|
|
|
# if no openocd specific configuration file, check for default locations:
|
|
|
|
# 1. Using the default dist/openocd.cfg (automatically set by openocd.sh)
|
|
|
|
# 2. Using the common cpu specific config file
|
|
|
|
ifeq (,$(OPENOCD_CONFIG))
|
|
|
|
# if no openocd default configuration is provided by the board,
|
|
|
|
# use the STM32 common one
|
2019-09-09 17:23:01 +02:00
|
|
|
ifeq (0,$(words $(wildcard $(BOARDSDIR)/$(BOARD)/dist/openocd.cfg)))
|
2020-02-22 11:33:19 +01:00
|
|
|
OPENOCD_CONFIG = $(RIOTBASE)/boards/common/stm32/dist/$(CPU).cfg
|
2018-01-30 08:37:56 +01:00
|
|
|
endif
|
|
|
|
endif
|