1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #13480 from aabadie/pr/tools/openocd_export_variables

tools/openocd: export configuration variables only to required targets
This commit is contained in:
Alexandre Abadie 2020-03-03 18:16:05 +01:00 committed by GitHub
commit 95d607b54d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 17 additions and 16 deletions

View File

@ -13,7 +13,7 @@ DEBUG_ADAPTER ?= stlink
# this board can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -13,7 +13,7 @@ DEBUG_ADAPTER ?= stlink
# The board can become un-flashable after some execution,
# use connect_assert_srst to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -21,7 +21,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# The board can become un-flashable after some execution,
# use connect_assert_srst to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -7,7 +7,7 @@ BAUD = 500000
include $(RIOTMAKE)/tools/serial.inc.mk
# Using connect_assert_srst removes errors on flash from invalid state
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
DEBUG_ADAPTER ?= iotlab

View File

@ -13,7 +13,7 @@ DEBUG_ADAPTER ?= stlink
# this board can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the boards.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -13,7 +13,7 @@ DEBUG_ADAPTER ?= stlink
# this board can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the boards.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -31,7 +31,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# The board can become un-flashable after some firmware, use connect_assert_srst
# to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -10,7 +10,7 @@ STLINK_VERSION ?= 2
# The board can become un-flashable after some execution,
# use connect_assert_srst to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -81,7 +81,9 @@ UNEXPORTED_VARIABLES+=('PORT_LINUX' 'PORT_DARWIN')
UNEXPORTED_VARIABLES+=('PORT[ ?=:]' 'PORT$')
UNEXPORTED_VARIABLES+=('LINKFLAGS' 'LINKER_SCRIPT')
UNEXPORTED_VARIABLES+=('USEMODULE_INCLUDES')
UNEXPORTED_VARIABLES+=('OPENOCD_ADAPTER_INIT')
UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG')
UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST')
EXPORTED_VARIABLES_ONLY_IN_VARS=()
EXPORTED_VARIABLES_ONLY_IN_VARS+=('APPDEPS')

View File

@ -23,7 +23,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk
ifeq (openocd,$(PROGRAMMER))
# STM32 boards can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the boards.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# For STM32 boards the ST-link adapter is the default adapter, e.g. all
# Nucleo boards have an on-board ST-link adapter

View File

@ -4,4 +4,3 @@ OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/cmsis-dap.cfg]'
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'cmsis_dap_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT

View File

@ -5,4 +5,3 @@ OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/ftdi/iotlab-usb.cfg]'
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'ftdi_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT

View File

@ -4,4 +4,3 @@ OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/jlink.cfg]'
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'jlink serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT

View File

@ -30,4 +30,3 @@ OPENOCD_ADAPTER_INIT ?= -f '$(RIOTBASE)/boards/mulle/dist/openocd/mulle-programm
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'ftdi_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT

View File

@ -10,7 +10,6 @@ OPENOCD_ADAPTER_INIT ?= \
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'hla_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT
# if no openocd specific configuration file, check for default locations:
# 1. Using the default dist/openocd.cfg (automatically set by openocd.sh)

View File

@ -11,5 +11,3 @@ OPENOCD_ADAPTER_INIT ?= \
-c 'sysfsgpio_srst_num $(SRST_PIN)' \
-c 'adapter_nsrst_delay 100' \
-c 'adapter_nsrst_assert_width 100'
export OPENOCD_ADAPTER_INIT

View File

@ -18,3 +18,9 @@ OPENOCD_CONFIG ?= $(BOARDSDIR)/$(BOARD)/dist/openocd.cfg
# Export OPENOCD_CONFIG to required targets
OPENOCD_TARGETS = debug% flash% reset
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_CONFIG)
# Export OPENOCD_ADAPTER_INIT to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_ADAPTER_INIT)
# Export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_RESET_USE_CONNECT_ASSERT_SRST)