From 3c31000a61b240064761e93270fcd5c4818b07f4 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 16 Jan 2024 15:15:06 +0100 Subject: [PATCH 1/4] boards/native: only use pyterm wrapper with term target --- boards/native/Makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index f17eab6cf3d3..ae1b891eafaf 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -10,6 +10,11 @@ else DEBUGGER ?= gdb endif +# only use pyterm wrapper if term target is requested +ifeq (,$(filter term,$(MAKECMDGOALS))) + RIOT_TERMINAL ?= native +endif + RESET ?= $(RIOTBOARD)/native/dist/reset.sh FLASHER ?= FLASHFILE ?= $(ELFFILE) From 7658e01223f82df74359f226cfe48ab9ab4ba1e2 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 16 Jan 2024 15:49:03 +0100 Subject: [PATCH 2/4] Revert "makefiles/tests/tests.inc.mk: use `native` term for tests" This reverts commit b1663273545fa5adfd4d73e252068818150c7615. --- makefiles/tests/tests.inc.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/makefiles/tests/tests.inc.mk b/makefiles/tests/tests.inc.mk index c182ae899395..8aaaa723872b 100644 --- a/makefiles/tests/tests.inc.mk +++ b/makefiles/tests/tests.inc.mk @@ -22,10 +22,6 @@ TEST_DEPS += $(TERMDEPS) TEST_EXECUTOR ?= TEST_EXECUTOR_FLAGS ?= -ifeq (native, $(BOARD)) - TEST_EXECUTOR := RIOT_TERMINAL=native $(TEST_EXECUTOR) -endif - test: $(TEST_DEPS) $(Q) for t in $(TESTS); do \ $(TEST_EXECUTOR) $(TEST_EXECUTOR_FLAGS) $$t || exit 1; \ From d0093cf9ccd86522a3baea4fd79c33e61d7f7b04 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 19 Jan 2024 12:59:14 +0100 Subject: [PATCH 3/4] Revert "riotctrl_ctrl: one more indirection to get native" This reverts commit 5e0c9b4bff88835190f6bb82f11e852fb8976e6e. --- dist/pythonlibs/riotctrl_ctrl/native.py | 5 ++--- dist/pythonlibs/riotctrl_ctrl/requirements.txt | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/pythonlibs/riotctrl_ctrl/native.py b/dist/pythonlibs/riotctrl_ctrl/native.py index 1695886a75d8..6e5bee1cd45e 100644 --- a/dist/pythonlibs/riotctrl_ctrl/native.py +++ b/dist/pythonlibs/riotctrl_ctrl/native.py @@ -27,6 +27,5 @@ def _set_debug_adapter_id(self, child): def start_term(self, *args, **kwargs): super().start_term(*args, **kwargs) for child in psutil.Process(pid=self._term_pid()).children(): - for grandchild in child.children(): - if self._set_debug_adapter_id(grandchild): - break + if self._set_debug_adapter_id(child): + break diff --git a/dist/pythonlibs/riotctrl_ctrl/requirements.txt b/dist/pythonlibs/riotctrl_ctrl/requirements.txt index 98fb754d0f69..a2b3329f101c 100644 --- a/dist/pythonlibs/riotctrl_ctrl/requirements.txt +++ b/dist/pythonlibs/riotctrl_ctrl/requirements.txt @@ -1,3 +1,2 @@ psutil -pyserial riotctrl From e5618f705b5649c8c37fda63545ab31d6199596f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 19 Jan 2024 14:41:05 +0100 Subject: [PATCH 4/4] boards/native: set and test for pyterm explicitly --- boards/native/Makefile.include | 45 ++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index ae1b891eafaf..814666e6b8fb 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -13,24 +13,36 @@ endif # only use pyterm wrapper if term target is requested ifeq (,$(filter term,$(MAKECMDGOALS))) RIOT_TERMINAL ?= native +else + RIOT_TERMINAL ?= pyterm endif RESET ?= $(RIOTBOARD)/native/dist/reset.sh FLASHER ?= FLASHFILE ?= $(ELFFILE) -ifeq (native,$(RIOT_TERMINAL)) +ifeq (pyterm,$(RIOT_TERMINAL)) + TERMFLAGS += -ps $(FLASHFILE) + PROCARGS := --process-args +else TERMPROG ?= $(FLASHFILE) +endif + +ZEP_IP ?= [::1] +ZEP_PORT_BASE ?= 17754 +ifeq (1,$(USE_ZEP)) +ifeq (pyterm,$(RIOT_TERMINAL)) + TERMFLAGS += --process-args '-z $(ZEP_IP):$(ZEP_PORT_BASE)' else - TERMFLAGS += -ps $(FLASHFILE) - ifeq (1,$(USE_ZEP)) - ZEP_IP ?= [::1] - ZEP_PORT_BASE ?= 17754 - TERMFLAGS += --process-args '-z $(ZEP_IP):$(ZEP_PORT_BASE)' - endif - ifneq (,$(ZEP_MAC)) - TERMFLAGS += --process-args '\-\-eui64=$(ZEP_MAC)' - endif + TERMFLAGS += -z $(ZEP_IP):$(ZEP_PORT_BASE) +endif +endif +ifneq (,$(ZEP_MAC)) +ifeq (pyterm,$(RIOT_TERMINAL)) + TERMFLAGS += --process-args '\-\-eui64=$(ZEP_MAC)' +else + TERMFLAGS += --eui64=$(ZEP_MAC) +endif endif export VALGRIND ?= valgrind @@ -106,12 +118,7 @@ LINKFLAGS += -ffunction-sections # set the tap interface for term/valgrind PORT ?= tap0 - -ifeq (native,$(RIOT_TERMINAL)) - TERMFLAGS += $(PORT) -else - TERMFLAGS += --process-args $(PORT) -endif +TERMFLAGS += $(PROCARGS) $(PORT) # Configure default eeprom file EEPROM_FILE ?= $(BINDIR)/native.eeprom @@ -119,10 +126,10 @@ EEPROM_FILE ?= $(BINDIR)/native.eeprom # set the eeprom file flags only when the periph_eeprom feature is used. ifneq (,$(filter periph_eeprom,$(FEATURES_USED))) EEPROM_FILE_FLAGS = --eeprom $(EEPROM_FILE) - ifeq (native,$(RIOT_TERMINAL)) - TERMFLAGS += $(EEPROM_FILE_FLAGS) - else + ifeq (pyterm,$(RIOT_TERMINAL)) TERMFLAGS += --process-args '$(EEPROM_FILE_FLAGS)' + else + TERMFLAGS += $(EEPROM_FILE_FLAGS) endif endif