Merge pull request #10475 from chrysn-pull-requests/openocd-for-stk3700
boards/any silabs: Allow selecting OpenOCD
This commit is contained in:
commit
4671fd2fe4
@ -1,2 +1,13 @@
|
||||
INCLUDES += -I$(RIOTBOARD)/common/silabs/include
|
||||
INCLUDES += -I$(RIOTBOARD)/common/silabs/drivers/include
|
||||
|
||||
PROGRAMMER ?= jlink
|
||||
|
||||
export JLINK_DEVICE ?= ${CPU_MODEL}
|
||||
export OPENOCD_CONFIG ?= board/efm32.cfg
|
||||
|
||||
ifeq ($(PROGRAMMER),jlink)
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
else ifeq ($(PROGRAMMER),openocd)
|
||||
include $(RIOTMAKE)/tools/openocd.inc.mk
|
||||
endif
|
||||
|
||||
@ -13,7 +13,6 @@ include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := $(MODULE_JLINK_DEVICE)
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
|
||||
# include board common
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.include
|
||||
|
||||
@ -6,9 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := $(CPU_MODEL)
|
||||
export JLINK_PRE_FLASH = r
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
|
||||
# include board common
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.include
|
||||
|
||||
@ -6,9 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := $(CPU_MODEL)
|
||||
export JLINK_PRE_FLASH = r
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
|
||||
# include board common
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.include
|
||||
|
||||
@ -8,7 +8,6 @@ include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := EFR32MG1PxxxF256
|
||||
export JLINK_PRE_FLASH = r
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
|
||||
# include board common
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.include
|
||||
|
||||
@ -5,9 +5,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := $(CPU_MODEL)
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
|
||||
# include board common
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.include
|
||||
|
||||
@ -5,9 +5,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := $(CPU_MODEL)
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
|
||||
# include board common
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.include
|
||||
|
||||
10
dist/tools/openocd/openocd.sh
vendored
10
dist/tools/openocd/openocd.sh
vendored
@ -4,7 +4,8 @@
|
||||
#
|
||||
# This script is supposed to be called from RIOTs make system,
|
||||
# as it depends on certain environment variables. An OpenOCD
|
||||
# configuration file must be present in a the boards dist folder.
|
||||
# configuration file must be present in a the boards dist folder
|
||||
# or be given as "board/[...].cfg" to use an OpenOCD shipped configuration.
|
||||
#
|
||||
# Any extra command line arguments after the command name are passed on the
|
||||
# openocd command line after the configuration file name but before any other
|
||||
@ -12,6 +13,11 @@
|
||||
#
|
||||
# Global environment variables used:
|
||||
# OPENOCD: OpenOCD command name, default: "openocd"
|
||||
# Care must be taken when specifying an OpenOCD version in
|
||||
# its build directory, as it does not look up its own
|
||||
# configuration files relative to the executable -- the
|
||||
# scripts directory needs to be passed in like this:
|
||||
# `OPENOCD="~/openocd/src/openocd -s ~/openocd/tcl"`.
|
||||
# OPENOCD_CONFIG: OpenOCD configuration file name,
|
||||
# default: "${BOARDSDIR}/${BOARD}/dist/openocd.cfg"
|
||||
#
|
||||
@ -133,7 +139,7 @@ fi
|
||||
# a couple of tests for certain configuration options
|
||||
#
|
||||
test_config() {
|
||||
if [ ! -f "${OPENOCD_CONFIG}" ]; then
|
||||
if [ ! -f "${OPENOCD_CONFIG}" ] && [[ ! "${OPENOCD_CONFIG}" == board/* ]] ; then
|
||||
echo "Error: Unable to locate OpenOCD configuration file"
|
||||
echo " (${OPENOCD_CONFIG})"
|
||||
exit 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user