From 64d4aec81281bc798286509b956c78b7ddd78803 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 10 Jan 2023 09:37:29 +0100 Subject: [PATCH] boards: Provide debug adapter ID from serial where possible Set `DEBUG_ADAPTER_ID_IS_TTY_SERIAL` to `1` for those boards to allow automatic detection of the debug adapter with `MOST_RECENT_PORT=1`. --- boards/common/nucleo/Makefile.include | 4 ++++ boards/hifive1b/Makefile.include | 4 ++++ boards/microbit-v2/Makefile.include | 4 ++++ boards/nrf52840dk/Makefile.include | 4 ++++ boards/qn9080dk/Makefile.include | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/boards/common/nucleo/Makefile.include b/boards/common/nucleo/Makefile.include index a5da8b7d53..d25e33a0b1 100644 --- a/boards/common/nucleo/Makefile.include +++ b/boards/common/nucleo/Makefile.include @@ -11,6 +11,10 @@ include $(RIOTMAKE)/boards/stm32.inc.mk # USB serials to only select the UART bridge of embedded STLink debuggers. TTY_BOARD_FILTER := --model 'STM32 STLink' +# The TTY serial also is the ID of the debug adapter, as the TTY is provided by +# the debug adapter +DEBUG_ADAPTER_ID_IS_TTY_SERIAL := 1 + # variable needed by cpy2remed PROGRAMMER # it contains name of ST-Link removable media diff --git a/boards/hifive1b/Makefile.include b/boards/hifive1b/Makefile.include index 5d45a49bcd..c78c19baa6 100644 --- a/boards/hifive1b/Makefile.include +++ b/boards/hifive1b/Makefile.include @@ -25,5 +25,9 @@ endif # the UART bridge to the ESP32-SOLO-1 MCU instead of the FE310 MCU on the board. TTY_BOARD_FILTER := --model HiFive --iface-num 0 +# The TTY serial also is the ID of the debug adapter, as the TTY is provided by +# the debug adapter +DEBUG_ADAPTER_ID_IS_TTY_SERIAL := 1 + TESTRUNNER_RESET_DELAY = 1 $(call target-export-variables,test,TESTRUNNER_RESET_DELAY) diff --git a/boards/microbit-v2/Makefile.include b/boards/microbit-v2/Makefile.include index e853d5000d..c16ff76aee 100644 --- a/boards/microbit-v2/Makefile.include +++ b/boards/microbit-v2/Makefile.include @@ -7,6 +7,10 @@ PROGRAMMERS_SUPPORTED += pyocd # programmer firmware revisions "fix" that. TTY_BOARD_FILTER := --model ".?BBC micro:bit CMSIS-DAP.?" +# The TTY serial also is the ID of the debug adapter, as the TTY is provided by +# the debug adapter +DEBUG_ADAPTER_ID_IS_TTY_SERIAL := 1 + # The board is not recognized automatically by pyocd, so the CPU target # option is passed explicitly PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) diff --git a/boards/nrf52840dk/Makefile.include b/boards/nrf52840dk/Makefile.include index c86c0c8eab..7a7fc118c9 100644 --- a/boards/nrf52840dk/Makefile.include +++ b/boards/nrf52840dk/Makefile.include @@ -2,4 +2,8 @@ # USB serials to only select the UART bridge of integrated J-Link debugger. TTY_BOARD_FILTER := --model J-Link +# The TTY serial also is the ID of the debug adapter, as the TTY is provided by +# the debug adapter +DEBUG_ADAPTER_ID_IS_TTY_SERIAL := 1 + include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.include diff --git a/boards/qn9080dk/Makefile.include b/boards/qn9080dk/Makefile.include index 29929054de..9e02f2cd32 100644 --- a/boards/qn9080dk/Makefile.include +++ b/boards/qn9080dk/Makefile.include @@ -7,5 +7,9 @@ CFLAGS += \ QN908X_JLINK ?= $(QN9080DK_JLINK) JLINK_DEVICE ?= QN9080A +# The TTY serial also is the ID of the debug adapter, as the TTY is provided by +# the debug adapter +DEBUG_ADAPTER_ID_IS_TTY_SERIAL := 1 + # Include default QN908x board config include $(RIOTBOARD)/common/qn908x/Makefile.include