From 28a5ec39115662a3c7f629f505efbb3fe6258423 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 5 Dec 2023 19:05:20 +0100 Subject: [PATCH 1/6] boards/esp32-*-kit*: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now select relatively robustly the most recently connected ESP32 Ethernet Kit / ESP32 Wrover Kit board, even with other TTYs present. This is because the FTDI Dual RS232-HS with two USB2UART bridges in the chip would be an expensive overkill for most boards, unless one is using the FTDI chip to big-bang JTAG as well - as done on the Ethernet Kit and Wrover Kit boards. --- boards/esp32-ethernet-kit-v1_0/Makefile.include | 4 ++++ boards/esp32-wrover-kit/Makefile.include | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/boards/esp32-ethernet-kit-v1_0/Makefile.include b/boards/esp32-ethernet-kit-v1_0/Makefile.include index 1e3b2497a0..0106995d08 100644 --- a/boards/esp32-ethernet-kit-v1_0/Makefile.include +++ b/boards/esp32-ethernet-kit-v1_0/Makefile.include @@ -6,4 +6,8 @@ ifneq (,$(filter esp_jtag,$(USEMODULE))) OPENOCD_CONFIG ?= board/esp32-ethernet-kit-3.3v.cfg endif +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'ftdi_sio' --vendor FTDI --model 'Dual RS232-HS' --iface-num 1 + include $(RIOTBOARD)/common/esp32/Makefile.include diff --git a/boards/esp32-wrover-kit/Makefile.include b/boards/esp32-wrover-kit/Makefile.include index 4a4f25c479..5fe61f1358 100644 --- a/boards/esp32-wrover-kit/Makefile.include +++ b/boards/esp32-wrover-kit/Makefile.include @@ -3,6 +3,10 @@ PSEUDOMODULES += esp32_wrover_kit_camera # configure the serial interface PORT_LINUX ?= /dev/ttyUSB1 +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'ftdi_sio' --vendor FTDI --model 'Dual RS232-HS' --iface-num 1 + ifneq (,$(filter esp_jtag,$(USEMODULE))) OPENOCD_CONFIG ?= board/esp32-wrover-kit-3.3v.cfg endif From 03a1a02ec280780a7a8ba8def9ffb6a5be017b1a Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 6 Dec 2023 09:20:56 +0100 Subject: [PATCH 2/6] boards/esp32-wroom-32: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now only consider plausible TTYs and select the most recently connected one. The filter is a bit broad, though, and will match any board with a CP2102 USB2UART bridge. But depending on the boards attached, it might be good enough to reliably tell it apart from other boards. --- boards/esp32-wroom-32/Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/esp32-wroom-32/Makefile.include b/boards/esp32-wroom-32/Makefile.include index 30a3389a47..2887a14b1b 100644 --- a/boards/esp32-wroom-32/Makefile.include +++ b/boards/esp32-wroom-32/Makefile.include @@ -1 +1,5 @@ include $(RIOTBOARD)/common/esp32/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102 USB to UART Bridge Controller' From 7228cf1108a4bf7a169ec6c154a0067a4634b77b Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 6 Dec 2023 09:25:15 +0100 Subject: [PATCH 3/6] boards/esp32*-devkit: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now only consider plausible TTYs and select the most recently connected one. The filter is a bit broad, though, and will match any board with a CP2102N USB2UART bridge. But depending on the boards attached, it might be good enough to reliably tell it apart from other boards. --- boards/esp32c3-devkit/Makefile.include | 4 ++++ boards/esp32s2-devkit/Makefile.include | 4 ++++ boards/esp32s3-devkit/Makefile.include | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/boards/esp32c3-devkit/Makefile.include b/boards/esp32c3-devkit/Makefile.include index 5bd8fde8dd..728ae3c44d 100644 --- a/boards/esp32c3-devkit/Makefile.include +++ b/boards/esp32c3-devkit/Makefile.include @@ -1 +1,5 @@ include $(RIOTBOARD)/common/esp32c3/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller' diff --git a/boards/esp32s2-devkit/Makefile.include b/boards/esp32s2-devkit/Makefile.include index 43032c89f2..12997eb0f6 100644 --- a/boards/esp32s2-devkit/Makefile.include +++ b/boards/esp32s2-devkit/Makefile.include @@ -6,3 +6,7 @@ PSEUDOMODULES += esp32s2_saola_1 PSEUDOMODULES += esp32s2_saola_1r include $(RIOTBOARD)/common/esp32s2/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller' diff --git a/boards/esp32s3-devkit/Makefile.include b/boards/esp32s3-devkit/Makefile.include index c1027951e0..403fb40c37 100644 --- a/boards/esp32s3-devkit/Makefile.include +++ b/boards/esp32s3-devkit/Makefile.include @@ -10,3 +10,7 @@ PSEUDOMODULES += esp32s3_devkitm_1_n8r8 PSEUDOMODULES += esp32s3_devkitm_1u_n8r8 include $(RIOTBOARD)/common/esp32s3/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller' From 9308a6f526044bbce7f02a7101226f6fa920faeb Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 6 Dec 2023 10:04:46 +0100 Subject: [PATCH 4/6] boards/esp32-mh-et-live-minikit,esp32-ttgo-t-beam: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now only consider plausible TTYs and select the most recently connected one. The filter is a bit broad, though, and will match any board with a CP2104 USB2UART bridge. But depending on the boards attached, it might be good enough to reliably tell it apart from other boards. --- boards/esp32-mh-et-live-minikit/Makefile.include | 4 ++++ boards/esp32-ttgo-t-beam/Makefile.include | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/boards/esp32-mh-et-live-minikit/Makefile.include b/boards/esp32-mh-et-live-minikit/Makefile.include index 30a3389a47..b1f1a76ce2 100644 --- a/boards/esp32-mh-et-live-minikit/Makefile.include +++ b/boards/esp32-mh-et-live-minikit/Makefile.include @@ -1 +1,5 @@ include $(RIOTBOARD)/common/esp32/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2104 USB to UART Bridge Controller' diff --git a/boards/esp32-ttgo-t-beam/Makefile.include b/boards/esp32-ttgo-t-beam/Makefile.include index 1c6db773f3..e3e3e449ac 100644 --- a/boards/esp32-ttgo-t-beam/Makefile.include +++ b/boards/esp32-ttgo-t-beam/Makefile.include @@ -1,3 +1,7 @@ PSEUDOMODULES += esp32_ttgo_t_beam_v1_0 include $(RIOTBOARD)/common/esp32/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2104 USB to UART Bridge Controller' From 9dcbab218a244b6fe84866e11d1b41473280e59c Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 6 Dec 2023 10:08:46 +0100 Subject: [PATCH 5/6] boards/esp32-olimex-evb,esp32-wemos-lolin-d32-pro: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now only consider plausible TTYs and select the most recently connected one. The filter is a bit broad, though, and will match any board with a CH430 USB 2.0 UART2USB bridge. But depending on the boards attached, it might be good enough to reliably tell it apart from other boards. --- boards/esp32-olimex-evb/Makefile.include | 4 ++++ boards/esp32-wemos-lolin-d32-pro/Makefile.include | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/boards/esp32-olimex-evb/Makefile.include b/boards/esp32-olimex-evb/Makefile.include index 6d21df9fa5..331cf84c6e 100644 --- a/boards/esp32-olimex-evb/Makefile.include +++ b/boards/esp32-olimex-evb/Makefile.include @@ -1,3 +1,7 @@ PSEUDOMODULES += olimex_esp32_gateway include $(RIOTBOARD)/common/esp32/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'ch341' --vendor '1a86' --model 'USB2.0-Serial' diff --git a/boards/esp32-wemos-lolin-d32-pro/Makefile.include b/boards/esp32-wemos-lolin-d32-pro/Makefile.include index 782a1579a8..826398d8eb 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Makefile.include +++ b/boards/esp32-wemos-lolin-d32-pro/Makefile.include @@ -1,3 +1,7 @@ PSEUDOMODULES += esp_lolin_tft include $(RIOTBOARD)/common/esp32/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'ch341' --vendor '1a86' --model 'USB2.0-Serial' From f80f47ccf630a09e45556a5c4692b27acda8ac5d Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 6 Dec 2023 10:10:28 +0100 Subject: [PATCH 6/6] boards/esp32s2-lilygo-ttgo-t8: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now only consider plausible TTYs and select the most recently connected one. The filter is a bit broad, though, and will match any board with a CH430 UART2USB bridge. But depending on the boards attached, it might be good enough to reliably tell it apart from other boards. --- boards/esp32s2-lilygo-ttgo-t8/Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/esp32s2-lilygo-ttgo-t8/Makefile.include b/boards/esp32s2-lilygo-ttgo-t8/Makefile.include index 9d387f6803..65924a77f3 100644 --- a/boards/esp32s2-lilygo-ttgo-t8/Makefile.include +++ b/boards/esp32s2-lilygo-ttgo-t8/Makefile.include @@ -5,3 +5,7 @@ ifneq (,$(filter esp32s2-lilygo-ttgo-t8-usb,$(USEMODULE))) endif include $(RIOTBOARD)/common/esp32s2/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'ch341' --vendor '1a86' --model 'USB Serial'