1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 18:13:49 +01:00

boards: remove openocd/pyocd config conditionals

This commit is contained in:
Alexandre Abadie 2021-02-18 17:29:53 +01:00
parent 6f47505997
commit 74274d9e19
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
13 changed files with 44 additions and 75 deletions

View File

@ -1,13 +1,10 @@
# for this board we support flashing via openocd or pyocd # for this board we support flashing via openocd or pyocd
PROGRAMMER ?= openocd PROGRAMMER ?= openocd
ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
else ifeq (pyocd,$(PROGRAMMER))
# PyOCD doesn't recognize automatically the board ID, so target type has to # PyOCD doesn't recognize automatically the board ID, so target type has to
# be passed explicitly # be passed explicitly
PYOCD_FLASH_TARGET_TYPE ?= -t nrf51 PYOCD_FLASH_TARGET_TYPE ?= -t nrf51
endif
# include nrf51 boards common configuration # include nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -9,17 +9,17 @@ ifeq (bmp,$(PROGRAMMER))
endif endif
PROGRAMMER ?= jlink PROGRAMMER ?= jlink
ifeq (jlink,$(PROGRAMMER))
# setup JLink for flashing # setup JLink for flashing
JLINK_DEVICE = nrf52 JLINK_DEVICE = nrf52
else ifeq (openocd,$(PROGRAMMER))
ifneq (,$(filter $(BOARD),ruuvitag thingy52))
# openocd doesn't fully work with ruuvitag and thingy52
$(error Cannot use OpenOCD with $(BOARD) board)
endif
# setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support # setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support
# for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version # for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version
# build from source (master > 2018, August the 13rd) is required. # build from source (master > 2018, August the 13rd) is required.
OPENOCD_DEBUG_ADAPTER ?= jlink OPENOCD_DEBUG_ADAPTER ?= jlink
OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
ifneq (,$(filter $(BOARD),ruuvitag thingy52))
# openocd doesn't fully work with ruuvitag and thingy52
ifeq (openocd,$(PROGRAMMER))
$(error Cannot use OpenOCD with $(BOARD) board)
endif
endif endif

View File

@ -23,14 +23,11 @@ else
# For openocd, a version built against the development branch and containing # For openocd, a version built against the development branch and containing
# the support for nrf52 cpu is required. # the support for nrf52 cpu is required.
PROGRAMMER ?= pyocd PROGRAMMER ?= pyocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840 PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840
else ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER ?= dap OPENOCD_DEBUG_ADAPTER ?= dap
endif endif
endif
MONOFIRMWARETOOL = ${RIOTBOARD}/common/particle-mesh/monofirmware-tool.py MONOFIRMWARETOOL = ${RIOTBOARD}/common/particle-mesh/monofirmware-tool.py

View File

@ -1,12 +1,9 @@
# for this board, flash with OpenOCD by default. PyOCD is also supported. # for this board, flash with OpenOCD by default. PyOCD is also supported.
PROGRAMMER ?= openocd PROGRAMMER ?= openocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU)
else ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
endif
ifneq (,$(filter microbit,$(USEMODULE))) ifneq (,$(filter microbit,$(USEMODULE)))
INCLUDES += -I$(RIOTBOARD)/common/microbit/include INCLUDES += -I$(RIOTBOARD)/common/microbit/include

View File

@ -4,9 +4,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# for this board we support flashing via openocd or pyocd # for this board we support flashing via openocd or pyocd
PROGRAMMER ?= openocd PROGRAMMER ?= openocd
ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
endif
# QEMU 4.0 added microbit system emulation. # QEMU 4.0 added microbit system emulation.
RIOT_EMULATOR ?= qemu RIOT_EMULATOR ?= qemu

View File

@ -5,9 +5,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
PROGRAMMER ?= openocd PROGRAMMER ?= openocd
# dap debug adapter is required for openocd # dap debug adapter is required for openocd
ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
endif
# include nrf51 boards common configuration # include nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -5,9 +5,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
PROGRAMMER ?= jlink PROGRAMMER ?= jlink
# set required jlink debug adapter for openocd if it's used # set required jlink debug adapter for openocd if it's used
ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = jlink OPENOCD_DEBUG_ADAPTER = jlink
endif
# include nrf51 boards common configuration # include nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -3,12 +3,9 @@
# For openocd, a version built against the development branch and containing # For openocd, a version built against the development branch and containing
# the support for nrf52 cpu is required. # the support for nrf52 cpu is required.
PROGRAMMER ?= pyocd PROGRAMMER ?= pyocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU)
else ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
endif
include $(RIOTBOARD)/common/nrf52/Makefile.include include $(RIOTBOARD)/common/nrf52/Makefile.include

View File

@ -3,12 +3,9 @@
# For openocd, a version built against the development branch and containing # For openocd, a version built against the development branch and containing
# the support for nrf52 cpu is required. # the support for nrf52 cpu is required.
PROGRAMMER ?= pyocd PROGRAMMER ?= pyocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840 PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840
else ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
endif
include $(RIOTBOARD)/common/nrf52/Makefile.include include $(RIOTBOARD)/common/nrf52/Makefile.include

View File

@ -6,9 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
PROGRAMMER ?= jlink PROGRAMMER ?= jlink
# set required debug adapter for openocd if it's used # set required debug adapter for openocd if it's used
ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = jlink OPENOCD_DEBUG_ADAPTER = jlink
endif
# include nrf51 boards common configuration # include nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -2,9 +2,7 @@
PROGRAMMER ?= openocd PROGRAMMER ?= openocd
# dap debug adapter is required for openocd # dap debug adapter is required for openocd
ifeq (openocd,$(PROGRAMMER))
OPENOCD_DEBUG_ADAPTER = dap OPENOCD_DEBUG_ADAPTER = dap
endif
# Enable direct write to FCF (required for setting FOPT byte). # Enable direct write to FCF (required for setting FOPT byte).
OPENOCD_PRE_FLASH_CMDS += "-c kinetis fcf_source write" OPENOCD_PRE_FLASH_CMDS += "-c kinetis fcf_source write"

View File

@ -2,9 +2,7 @@
RIOT_TERMINAL ?= jlink RIOT_TERMINAL ?= jlink
# define pyocd as programmer to program with stlink # define pyocd as programmer to program with stlink
ifeq (pyocd,$(PROGRAMMER))
PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU)
endif
# use shared Makefile.include # use shared Makefile.include
include $(RIOTBOARD)/common/nrf52/Makefile.include include $(RIOTBOARD)/common/nrf52/Makefile.include

View File

@ -13,7 +13,6 @@ ifeq (bmp,$(PROGRAMMER))
PORT_DARWIN ?= $(wordlist 2, 2, $(sort $(wildcard /dev/tty.usbmodem*))) PORT_DARWIN ?= $(wordlist 2, 2, $(sort $(wildcard /dev/tty.usbmodem*)))
endif endif
ifeq (openocd,$(PROGRAMMER))
# STM32 boards can become un-flashable after a hardfault, # STM32 boards can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the boards. # use connect_assert_srst to always be able to flash or reset the boards.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
@ -21,11 +20,8 @@ ifeq (openocd,$(PROGRAMMER))
# For STM32 boards the ST-link adapter is the default adapter, e.g. all # For STM32 boards the ST-link adapter is the default adapter, e.g. all
# Nucleo boards have an on-board ST-link adapter # Nucleo boards have an on-board ST-link adapter
OPENOCD_DEBUG_ADAPTER ?= stlink OPENOCD_DEBUG_ADAPTER ?= stlink
endif
ifeq (jlink,$(PROGRAMMER))
JLINK_DEVICE ?= $(CPU_MODEL) JLINK_DEVICE ?= $(CPU_MODEL)
endif
ifeq (dfu-util,$(PROGRAMMER)) ifeq (dfu-util,$(PROGRAMMER))
# optionally, use dfu-util to flash via usb # optionally, use dfu-util to flash via usb