From b93bbe9e6ba49b23cb7059d44a773511f856bd81 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 26 May 2023 10:43:17 +0200 Subject: [PATCH 01/11] pkg/micropython: model in Kconfig --- pkg/Kconfig | 1 + pkg/micropython/Kconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkg/micropython/Kconfig diff --git a/pkg/Kconfig b/pkg/Kconfig index e150bac93e..d5805173da 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -51,6 +51,7 @@ rsource "lz4/Kconfig" rsource "mbedtls/Kconfig" rsource "micro-ecc/Kconfig" rsource "microcoap/Kconfig" +rsource "micropython/Kconfig" rsource "minmea/Kconfig" rsource "monocypher/Kconfig" rsource "mynewt-core/Kconfig" diff --git a/pkg/micropython/Kconfig b/pkg/micropython/Kconfig new file mode 100644 index 0000000000..8ae73279b1 --- /dev/null +++ b/pkg/micropython/Kconfig @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config PACKAGE_MICROPYTHON + bool "MicroPython port package" + depends on TEST_KCONFIG + + select MODULE_XTIMER + select MODULE_ZTIMER_USEC + select MODULE_STDIN From c7f122658871de9fa32d867a98b617e5ea2dab03 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 26 May 2023 10:43:35 +0200 Subject: [PATCH 02/11] examples/micropython: add Kconfig config --- examples/micropython/Kconfig | 14 ++++++++++++++ examples/micropython/Makefile | 3 +++ examples/micropython/app.config.test | 1 + 3 files changed, 18 insertions(+) create mode 100644 examples/micropython/Kconfig create mode 100644 examples/micropython/app.config.test diff --git a/examples/micropython/Kconfig b/examples/micropython/Kconfig new file mode 100644 index 0000000000..32980b2927 --- /dev/null +++ b/examples/micropython/Kconfig @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config APPLICATION + bool + default y + depends on TEST_KCONFIG + + select MODULE_PERIPH_ADC if HAS_PERIPH_ADC + select MODULE_PERIPH_SPI if HAS_PERIPH_SPI diff --git a/examples/micropython/Makefile b/examples/micropython/Makefile index 247540cfbe..e5e7829693 100644 --- a/examples/micropython/Makefile +++ b/examples/micropython/Makefile @@ -34,4 +34,7 @@ TESTRUNNER_RESET_AFTER_TERM ?= 1 # failing on native with floating point exception (#15870) TEST_ON_CI_BLACKLIST = native +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/examples/micropython/app.config.test b/examples/micropython/app.config.test new file mode 100644 index 0000000000..d2c7fc42c9 --- /dev/null +++ b/examples/micropython/app.config.test @@ -0,0 +1 @@ +CONFIG_PACKAGE_MICROPYTHON=y From bfd9153391cf9a8eb58f18d73e4a86bb96faec7e Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Thu, 9 Feb 2023 18:54:07 +0100 Subject: [PATCH 03/11] tools/kconfiglib: Update to RIOT-OS package --- dist/tools/kconfiglib/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/tools/kconfiglib/Makefile b/dist/tools/kconfiglib/Makefile index 300bd8fe51..b69c60e67f 100644 --- a/dist/tools/kconfiglib/Makefile +++ b/dist/tools/kconfiglib/Makefile @@ -1,6 +1,6 @@ PKG_NAME=kconfiglib -PKG_URL=https://github.com/ulfalizer/Kconfiglib -PKG_VERSION=061e71f7d78cb057762d88de088055361863deff +PKG_URL=https://github.com/RIOT-OS/Kconfiglib +PKG_VERSION=110688d78edba9fa7eb09cbe001c62fbbee86abf PKG_LICENSE=ISC include $(RIOTBASE)/pkg/pkg.mk From e481571b4ed3c11b9cb72ed2e6d192192da32f6a Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 5 Apr 2023 14:58:36 +0200 Subject: [PATCH 04/11] cpu/esp32: Move MODULE_STDIO_USB_SERIAL_JTAG to cpu --- cpu/esp32/Kconfig | 1 + cpu/esp32/stdio_usb_serial_jtag/Kconfig | 9 +++++++++ sys/Kconfig.stdio | 6 ------ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 cpu/esp32/stdio_usb_serial_jtag/Kconfig diff --git a/cpu/esp32/Kconfig b/cpu/esp32/Kconfig index 06598dc835..97cbf9da06 100644 --- a/cpu/esp32/Kconfig +++ b/cpu/esp32/Kconfig @@ -94,5 +94,6 @@ rsource "Kconfig.esp32" rsource "Kconfig.esp32c3" rsource "Kconfig.esp32s3" rsource "Kconfig.esp32s2" +rsource "stdio_usb_serial_jtag/Kconfig" source "$(RIOTCPU)/esp_common/Kconfig" diff --git a/cpu/esp32/stdio_usb_serial_jtag/Kconfig b/cpu/esp32/stdio_usb_serial_jtag/Kconfig new file mode 100644 index 0000000000..8965c6aa5b --- /dev/null +++ b/cpu/esp32/stdio_usb_serial_jtag/Kconfig @@ -0,0 +1,9 @@ +choice STDIO_IMPLEMENTATION + +config MODULE_STDIO_USB_SERIAL_JTAG + bool "STDIO via ESP32 Debug USB Serial/JTAG interface" + depends on TEST_KCONFIG + depends on CPU_FAM_ESP32C3 || CPU_FAM_ESP32S3 + select MODULE_TSRB + +endchoice diff --git a/sys/Kconfig.stdio b/sys/Kconfig.stdio index 7ee523cb71..bd55e3078e 100644 --- a/sys/Kconfig.stdio +++ b/sys/Kconfig.stdio @@ -49,12 +49,6 @@ config MODULE_STDIO_ETHOS select MODULE_ETHOS_STDIO select USE_STDOUT_BUFFERED -config MODULE_STDIO_USB_SERIAL_JTAG - bool "STDIO via ESP32 Debug USB Serial/JTAG interface" - depends on TEST_KCONFIG - depends on CPU_FAM_ESP32C3 || CPU_FAM_ESP32S3 - select MODULE_TSRB - endchoice config MODULE_STDIN From adff099d616774bfe40a1af43fe5f17f901411d7 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 5 Apr 2023 15:04:48 +0200 Subject: [PATCH 05/11] sys/Kconfig.stdio: Add FORCE_ and REQUIRES_ USB --- sys/Kconfig.stdio | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/Kconfig.stdio b/sys/Kconfig.stdio index bd55e3078e..75d01ae825 100644 --- a/sys/Kconfig.stdio +++ b/sys/Kconfig.stdio @@ -8,6 +8,15 @@ menu "Standard Input/Output (STDIO)" depends on TEST_KCONFIG +config FORCE_USB_STDIO + bool "Force a USB based STDIO" + depends on HAS_PERIPH_USBDEV || HAS_TINYUSB_DEVICE + select KCONFIG_USB + select REQUIRES_USB_STDIO + help + To prevent a circular dependency, can force the USB modules to that + STDIO will select some sort of USB based STDIO backend. + choice STDIO_IMPLEMENTATION bool "STDIO implementation" default MODULE_STDIO_NATIVE if CPU_ARCH_NATIVE @@ -85,4 +94,9 @@ config USE_STDOUT_BUFFERED help Select this to prefer buffered standard output if provided by the implementation. +config REQUIRES_USB_STDIO + bool + help + Indicates that the STDIO requires some USB implementation to be enabled. + endmenu # Standard Input/Output (STDIO) From d419898d6a7916c8ccd1032fbac2a11dc9a49853 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 5 Apr 2023 15:07:01 +0200 Subject: [PATCH 06/11] sys/usb: Rework usb kconfig model --- sys/include/usb/usbus.h | 3 ++- sys/usb/Kconfig | 31 +++++++++++++++++++++++++------ sys/usb/usbus/Kconfig | 8 ++++++-- sys/usb/usbus/cdc/acm/Kconfig | 18 ++++++++++-------- sys/usb/usbus/cdc/ecm/Kconfig | 10 ++++++++-- sys/usb/usbus/dfu/Kconfig | 8 ++++++-- sys/usb/usbus/hid/Kconfig | 1 - 7 files changed, 57 insertions(+), 22 deletions(-) diff --git a/sys/include/usb/usbus.h b/sys/include/usb/usbus.h index 7a142b9fdc..d772314df4 100644 --- a/sys/include/usb/usbus.h +++ b/sys/include/usb/usbus.h @@ -68,7 +68,8 @@ extern "C" { * that the USB peripheral is ready for use. */ #ifndef CONFIG_USBUS_AUTO_ATTACH -#if !IS_ACTIVE(KCONFIG_MODULE_USBUS) +/* Check for Kconfig usage */ +#if !IS_ACTIVE(CONFIG_MODULE_USBUS) #define CONFIG_USBUS_AUTO_ATTACH 1 #endif #endif diff --git a/sys/usb/Kconfig b/sys/usb/Kconfig index 20c665e605..4899043ca3 100644 --- a/sys/usb/Kconfig +++ b/sys/usb/Kconfig @@ -5,13 +5,24 @@ # directory for more details. # menuconfig KCONFIG_USB - bool "Configure USB" - depends on MODULE_USBUS || PACKAGE_TINYUSB + bool "USB device" + depends on HAS_PERIPH_USBDEV || HAS_TINYUSB_DEVICE || MODULE_USBDEV_MOCK + depends on TEST_KCONFIG help - Configure the USB peripheral via Kconfig. + Enable the USB device peripheral. + if KCONFIG_USB +choice USB_IMPLEMENTATION + bool "USB implementation" + help + Select the USB implementation. + +endchoice + +rsource "usbus/Kconfig" + menu "Power management" config USB_MAX_POWER @@ -42,16 +53,26 @@ config USB_SPEC_BCDVERSION_1_1 endchoice +config CUSTOM_USB_VID_PID + bool "Use custom VID and PID" + help + If using in USB in application then one must set a VID and PID. + If RIOT is internally using the USB, say for STDIO, then the VID and + PID depending in the internal peripheral configuration used. + config USB_PID hex "Product ID" + depends on CUSTOM_USB_VID_PID range 0x0000 0xFFFF - default 0x7D01 + # default 0x7002 if MODULE_RIOTBOOT_DFU + default 0x7001 help You must provide your own PID. config USB_VID hex "Vendor ID" range 0x0000 0xFFFF + depends on CUSTOM_USB_VID_PID default 0x1209 help You must provide your own VID. @@ -109,5 +130,3 @@ comment "WARNING: The serial string is empty!" depends on USB_SERIAL_STR = "" && USB_CUSTOM_SERIAL_STR endif # KCONFIG_USB - -rsource "usbus/Kconfig" diff --git a/sys/usb/usbus/Kconfig b/sys/usb/usbus/Kconfig index 89330ad772..7fcf93cea0 100644 --- a/sys/usb/usbus/Kconfig +++ b/sys/usb/usbus/Kconfig @@ -4,6 +4,7 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. # +choice USB_IMPLEMENTATION menuconfig MODULE_USBUS bool "USB Unified Stack (USBUS)" @@ -13,8 +14,11 @@ menuconfig MODULE_USBUS select MODULE_EVENT select MODULE_LUID select MODULE_FMT + select MODULE_USBUS_CDC_ACM if REQUIRES_USB_STDIO select MODULE_PERIPH_USBDEV if HAS_PERIPH_USBDEV && !MODULE_USBDEV_MOCK +endchoice + if MODULE_USBUS config MODULE_AUTO_INIT_USBUS @@ -31,7 +35,7 @@ menuconfig KCONFIG_USEMODULE_USBUS help Configure the USBUS module via Kconfig. -if KCONFIG_USEMODULE_USBUS +if KCONFIG_USEMODULE_USBUS || MODULE_USBUS config USBUS_AUTO_ATTACH bool "Auto attach" @@ -63,7 +67,7 @@ config USBUS_EP0_SIZE_64 endchoice -endif # KCONFIG_USEMODULE_USBUS +endif # KCONFIG_USEMODULE_USBUS || MODULE_USBUS rsource "cdc/Kconfig" rsource "dfu/Kconfig" diff --git a/sys/usb/usbus/cdc/acm/Kconfig b/sys/usb/usbus/cdc/acm/Kconfig index f99a68adc3..524e4b9cb1 100644 --- a/sys/usb/usbus/cdc/acm/Kconfig +++ b/sys/usb/usbus/cdc/acm/Kconfig @@ -11,13 +11,19 @@ menuconfig KCONFIG_USEMODULE_USBUS_CDC_ACM help Configure the USBUS CDC ACM module via Kconfig. -if KCONFIG_USEMODULE_USBUS_CDC_ACM +menuconfig MODULE_USBUS_CDC_ACM + bool "Configure USBUS CDC ACM" + depends on MODULE_USBUS + help + Configure the USBUS CDC ACM module via Kconfig. + +if MODULE_USBUS_CDC_ACM || KCONFIG_USEMODULE_USBUS_CDC_ACM config USBUS_CDC_ACM_STDIO_BUF_SIZE_EXP int "Buffer size for STDIN and STDOUT data (as exponent of 2^n)" + depends on USEMODULE_STDIO_CDC_ACM || MODULE_STDIO_CDC_ACM default 7 range 0 31 - depends on USEMODULE_STDIO_CDC_ACM help As buffer size ALWAYS needs to be power of two, this changes this option represents the exponent of 2^n, which will be used as the size of the @@ -44,18 +50,14 @@ config USBUS_CDC_ACM_BULK_EP_SIZE_64 endchoice -endif # KCONFIG_USEMODULE_USBUS_CDC_ACM - -config MODULE_USBUS_CDC_ACM - bool "USB CDC ACM support" - depends on MODULE_USBUS - select MODULE_TSRB +endif # MODULE_USBUS_CDC_ACM # extend STDIO options choice STDIO_IMPLEMENTATION config MODULE_STDIO_CDC_ACM bool "CDC ACM" + depends on MODULE_USBUS || KCONFIG_USEMODULE_USBUS depends on MODULE_USBUS_CDC_ACM && !MODULE_TINYUSB_DEVICE select MODULE_ISRPIPE select MODULE_STDIO_AVAILABLE diff --git a/sys/usb/usbus/cdc/ecm/Kconfig b/sys/usb/usbus/cdc/ecm/Kconfig index 90b34830f8..de2fc59b23 100644 --- a/sys/usb/usbus/cdc/ecm/Kconfig +++ b/sys/usb/usbus/cdc/ecm/Kconfig @@ -11,7 +11,13 @@ menuconfig KCONFIG_USEMODULE_USBUS_CDC_ECM help Configure the USBUS CDC ECM module via Kconfig. -if KCONFIG_USEMODULE_USBUS_CDC_ECM +menuconfig MODULE_USBUS_CDC_ECM + bool "Configure USBUS CDC ECM" + depends on MODULE_USBUS + help + Configure the USBUS CDC ECM module via Kconfig. + +if KCONFIG_USEMODULE_USBUS_CDC_ECM || MODULE_USBUS_CDC_ECM config USBUS_CDC_ECM_CONFIG_SPEED_IND bool "Configure upload and download speeds independently" @@ -41,4 +47,4 @@ config USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM This is the link upload speed, defined in bits/second, that the USB peripheral will report to the host. -endif # KCONFIG_USEMODULE_USBUS_CDC_ECM +endif # KCONFIG_USEMODULE_USBUS_CDC_ECM || MODULE_USBUS_CDC_ECM diff --git a/sys/usb/usbus/dfu/Kconfig b/sys/usb/usbus/dfu/Kconfig index ee67fa04e6..34c8e0e457 100644 --- a/sys/usb/usbus/dfu/Kconfig +++ b/sys/usb/usbus/dfu/Kconfig @@ -9,10 +9,14 @@ menuconfig KCONFIG_USEMODULE_USBUS_DFU bool "Configure USBUS DFU" depends on USEMODULE_USBUS_DFU depends on KCONFIG_USEMODULE_USBUS + +menuconfig MODULE_USBUS_DFU + bool "Configure USBUS DFU" + depends on MODULE_USBUS help Configure the USBUS DFU module via Kconfig. -if KCONFIG_USEMODULE_USBUS_DFU +if KCONFIG_USEMODULE_USBUS_DFU || MODULE_USBUS_DFU config USB_DFU_DETACH_TIMEOUT_MS int @@ -33,4 +37,4 @@ config RIOTBOOT_MAGIC_ADDR int "DFU magic address" depends on CUSTOM_RIOTBOOT_MAGIC_ADDR -endif # KCONFIG_USEMODULE_USBUS_DFU +endif # KCONFIG_USEMODULE_USBUS_DFU || MODULE_USBUS_DFU diff --git a/sys/usb/usbus/hid/Kconfig b/sys/usb/usbus/hid/Kconfig index 2639a1bfdf..6a004280b4 100644 --- a/sys/usb/usbus/hid/Kconfig +++ b/sys/usb/usbus/hid/Kconfig @@ -7,7 +7,6 @@ menuconfig MODULE_USBUS_HID bool "USB HID support" - depends on TEST_KCONFIG depends on MODULE_USBUS select MODULE_ISRPIPE_READ_TIMEOUT From afd81528009c031a87718ad38435867875951ff6 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 5 Apr 2023 15:08:16 +0200 Subject: [PATCH 07/11] pkg/tinyusb: Rework the tinyUSB kconfig model --- pkg/tinyusb/Kconfig | 17 +++++++++++++++++ pkg/tinyusb/cdc_acm_stdio/Kconfig | 2 +- pkg/tinyusb/netdev/Kconfig | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pkg/tinyusb/Kconfig b/pkg/tinyusb/Kconfig index daa10a765e..22bf0bf29a 100644 --- a/pkg/tinyusb/Kconfig +++ b/pkg/tinyusb/Kconfig @@ -15,6 +15,20 @@ config HAS_TINYUSB_HOST help Indicates that the hardware supports tinyUSB host stack +config REQUIRES_TINYUSB_DEVICE + bool + help + Indicates that the application requires tinyUSB stack + +config ERROR_TINYUSB_DEVICE + bool + default y if REQUIRES_TINYUSB_DEVICE && !MODULE_TINYUSB_DEVICE + help + The USB implmentation is required to be tinyUSB but cannot be set + +choice USB_IMPLEMENTATION + default PACKAGE_TINYUSB if REQUIRES_TINYUSB_DEVICE + menuconfig PACKAGE_TINYUSB bool "TinyUSB stack package" depends on TEST_KCONFIG @@ -117,6 +131,7 @@ config MODULE_TINYUSB_HW config MODULE_TINYUSB_DEVICE bool "Device Stack" depends on HAS_TINYUSB_DEVICE + select MODULE_TINYUSB_CLASS_CDC if REQUIRES_USB_STDIO default y help Select to enable tinyUSB device stack @@ -242,4 +257,6 @@ config MODULE_RIOTBOOT_TINYUSB_DFU endif # MODULE_TINYUSB_DEVICE endif # PACKAGE_TINYUSB +endchoice + rsource "cdc_acm_stdio/Kconfig" diff --git a/pkg/tinyusb/cdc_acm_stdio/Kconfig b/pkg/tinyusb/cdc_acm_stdio/Kconfig index 3b61bd990b..b25cf791e5 100644 --- a/pkg/tinyusb/cdc_acm_stdio/Kconfig +++ b/pkg/tinyusb/cdc_acm_stdio/Kconfig @@ -12,7 +12,7 @@ choice STDIO_IMPLEMENTATION config MODULE_STDIO_TINYUSB_CDC_ACM bool "CDC ACM (tinyUSB)" depends on MODULE_TINYUSB_DEVICE + depends on MODULE_TINYUSB_CLASS_CDC select MODULE_STDIO_AVAILABLE - select MODULE_TINYUSB_CLASS_CDC endchoice diff --git a/pkg/tinyusb/netdev/Kconfig b/pkg/tinyusb/netdev/Kconfig index b163156dc2..77a73c1694 100644 --- a/pkg/tinyusb/netdev/Kconfig +++ b/pkg/tinyusb/netdev/Kconfig @@ -12,5 +12,5 @@ config MODULE_TINYUSB_NETDEV select MODULE_LUID select MODULE_NETDEV_ETH select MODULE_TINYUSB_CLASS_NET - select MODULE_TINYUSB_DEVICE - select PACKAGE_TINYUSB + select KCONFIG_USB + select REQUIRES_TINYUSB_DEVICE From 7f134c6c74213203fae1337b13aed0304af85154 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Thu, 6 Apr 2023 09:18:29 +0200 Subject: [PATCH 08/11] sys/usb: Add PID/VID check in macro --- sys/include/usb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/include/usb.h b/sys/include/usb.h index da96abac4c..2706d2ec35 100644 --- a/sys/include/usb.h +++ b/sys/include/usb.h @@ -53,7 +53,15 @@ extern "C" { #error Please configure your vendor and product IDs. For development, you may \ set USB_VID=${USB_VID_TESTING} USB_PID=${USB_PID_TESTING}. #endif +#else +#if CONFIG_USB_VID == INTERNAL_PERIPHERAL_VID && \ + CONFIG_USB_PID == INTERNAL_PERIPHERAL_PID +#error Please configure your vendor and product IDs differently than the \ + INTERNAL_PERIPHERAL_* settings. For development, you may set \ + USB_VID=${USB_VID_TESTING} \ + USB_PID=${USB_PID_TESTING}. #endif +#endif /* !(defined(CONFIG_USB_VID) && defined(CONFIG_USB_PID)) */ /** * @brief USB peripheral device vendor ID From 7f8bce4a08e89eb19957bb73024907dd50bafb76 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Thu, 6 Apr 2023 09:19:09 +0200 Subject: [PATCH 09/11] sys/sydio: Kconfig fallback to usb stdio --- sys/Kconfig.stdio | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/Kconfig.stdio b/sys/Kconfig.stdio index 75d01ae825..d460041cb6 100644 --- a/sys/Kconfig.stdio +++ b/sys/Kconfig.stdio @@ -20,6 +20,8 @@ config FORCE_USB_STDIO choice STDIO_IMPLEMENTATION bool "STDIO implementation" default MODULE_STDIO_NATIVE if CPU_ARCH_NATIVE + default MODULE_STDIO_CDC_ACM if MODULE_USBUS && REQUIRES_USB_STDIO + default MODULE_STDIO_TINYUSB_CDC_ACM if MODULE_TINYUSB_DEVICE && REQUIRES_USB_STDIO default MODULE_STDIO_UART config MODULE_STDIO_RTT From 92794c0eca375c92516d2198e352efb091a8f440 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Thu, 6 Apr 2023 09:24:07 +0200 Subject: [PATCH 10/11] boards/*: Model usb and stdio in Kconfig --- boards/adafruit-clue/Kconfig | 5 +++++ boards/adafruit-clue/Makefile.features | 6 ------ boards/adafruit-itsybitsy-m4/Makefile.features | 6 ------ boards/adafruit-itsybitsy-nrf52/Kconfig | 5 +++++ boards/adafruit-itsybitsy-nrf52/Makefile.features | 6 ------ boards/adafruit-pybadge/Makefile.features | 6 ------ boards/arduino-nano-33-ble/Kconfig | 5 +++++ boards/arduino-nano-33-ble/Makefile.features | 6 ------ boards/arduino-nano-33-iot/Makefile.features | 6 ------ boards/bastwan/Kconfig | 3 +++ boards/bastwan/bastwan.config | 3 --- boards/blackpill-stm32f103cb/Kconfig | 3 +++ .../blackpill-stm32f103cb.config | 3 --- boards/bluepill-stm32f103cb/Kconfig | 3 +++ .../bluepill-stm32f103cb/bluepill-stm32f103cb.config | 3 --- boards/common/arduino-mkr/Makefile.features | 6 ------ boards/common/nrf52/nrf52_bootloader.config | 4 ---- boards/common/particle-mesh/Kconfig | 4 ++++ boards/common/particle-mesh/Makefile.features | 6 ------ boards/common/samdx1-arduino-bootloader/Kconfig | 3 +++ .../samdx1-arduino-bootloader.config | 3 --- boards/common/sodaq/Makefile.features | 6 ------ boards/common/weact-f4x1cx/Kconfig | 3 +++ boards/common/weact-f4x1cx/weact-f4x1cx.config | 3 --- boards/esp32s2-lilygo-ttgo-t8/Kconfig | 9 +++------ boards/esp32s2-wemos-mini/Kconfig | 10 +++++----- boards/esp32s3-pros3/Kconfig | 6 +++--- boards/feather-m0/Makefile.features | 6 ------ boards/feather-nrf52840/Kconfig | 4 ++++ boards/feather-nrf52840/Makefile.features | 6 ------ boards/nrf52840-mdk-dongle/Kconfig | 4 ++++ boards/nrf52840-mdk-dongle/Makefile.features | 6 ------ boards/nrf52840dongle/Kconfig | 5 +++++ boards/nrf52840dongle/Makefile.features | 6 ------ boards/seeedstudio-gd32/Kconfig | 12 +++++------- boards/seeeduino_xiao/Makefile.features | 6 ------ boards/sensebox_samd21/Makefile.features | 6 ------ boards/serpente/Makefile.features | 6 ------ boards/sipeed-longan-nano/Kconfig | 12 ++++-------- boards/stm32f429i-disco/Kconfig | 3 +++ boards/stm32f429i-disco/stm32f429i-disco.config | 3 --- boards/stm32f4discovery/Kconfig | 9 ++------- boards/wemos-zero/Makefile.features | 6 ------ boards/yarm/Kconfig | 3 +++ boards/yarm/yarm.config | 3 --- cpu/esp32/Makefile.dep | 2 -- cpu/esp32/Makefile.include | 4 ++++ 47 files changed, 79 insertions(+), 165 deletions(-) delete mode 100644 boards/bastwan/bastwan.config delete mode 100644 boards/blackpill-stm32f103cb/blackpill-stm32f103cb.config delete mode 100644 boards/bluepill-stm32f103cb/bluepill-stm32f103cb.config delete mode 100644 boards/common/nrf52/nrf52_bootloader.config delete mode 100644 boards/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config delete mode 100644 boards/stm32f429i-disco/stm32f429i-disco.config delete mode 100644 boards/yarm/yarm.config diff --git a/boards/adafruit-clue/Kconfig b/boards/adafruit-clue/Kconfig index 5ea737ffc8..2cb2a8c111 100644 --- a/boards/adafruit-clue/Kconfig +++ b/boards/adafruit-clue/Kconfig @@ -25,4 +25,9 @@ config BOARD_ADAFRUIT_CLUE select HAVE_SAUL_GPIO select HAVE_SHT3X + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/adafruit-clue/Makefile.features b/boards/adafruit-clue/Makefile.features index eb54e9cce9..1f4969f6d9 100644 --- a/boards/adafruit-clue/Makefile.features +++ b/boards/adafruit-clue/Makefile.features @@ -9,10 +9,4 @@ FEATURES_PROVIDED += periph_usbdev # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/adafruit-itsybitsy-m4/Makefile.features b/boards/adafruit-itsybitsy-m4/Makefile.features index ee75dabcbb..9f48a1e4c3 100644 --- a/boards/adafruit-itsybitsy-m4/Makefile.features +++ b/boards/adafruit-itsybitsy-m4/Makefile.features @@ -13,9 +13,3 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/adafruit-itsybitsy-nrf52/Kconfig b/boards/adafruit-itsybitsy-nrf52/Kconfig index 15fbaf6a0e..09c1ca52e1 100644 --- a/boards/adafruit-itsybitsy-nrf52/Kconfig +++ b/boards/adafruit-itsybitsy-nrf52/Kconfig @@ -20,4 +20,9 @@ config BOARD_ADAFRUIT_ITSYBITSY_NRF52 select HAVE_SAUL_GPIO + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/adafruit-itsybitsy-nrf52/Makefile.features b/boards/adafruit-itsybitsy-nrf52/Makefile.features index eb54e9cce9..1f4969f6d9 100644 --- a/boards/adafruit-itsybitsy-nrf52/Makefile.features +++ b/boards/adafruit-itsybitsy-nrf52/Makefile.features @@ -9,10 +9,4 @@ FEATURES_PROVIDED += periph_usbdev # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/adafruit-pybadge/Makefile.features b/boards/adafruit-pybadge/Makefile.features index 158745995b..f48a0a24da 100644 --- a/boards/adafruit-pybadge/Makefile.features +++ b/boards/adafruit-pybadge/Makefile.features @@ -13,9 +13,3 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/arduino-nano-33-ble/Kconfig b/boards/arduino-nano-33-ble/Kconfig index 745540b6c3..18aeab7478 100644 --- a/boards/arduino-nano-33-ble/Kconfig +++ b/boards/arduino-nano-33-ble/Kconfig @@ -20,4 +20,9 @@ config BOARD_ARDUINO_NANO_33_BLE select HAVE_SAUL_GPIO + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/arduino-nano-33-ble/Makefile.features b/boards/arduino-nano-33-ble/Makefile.features index eb54e9cce9..1f4969f6d9 100644 --- a/boards/arduino-nano-33-ble/Makefile.features +++ b/boards/arduino-nano-33-ble/Makefile.features @@ -9,10 +9,4 @@ FEATURES_PROVIDED += periph_usbdev # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/arduino-nano-33-iot/Makefile.features b/boards/arduino-nano-33-iot/Makefile.features index 514af71c57..c43f111ff1 100644 --- a/boards/arduino-nano-33-iot/Makefile.features +++ b/boards/arduino-nano-33-iot/Makefile.features @@ -14,9 +14,3 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += highlevel_stdio - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/bastwan/Kconfig b/boards/bastwan/Kconfig index 487049367d..2d19213890 100644 --- a/boards/bastwan/Kconfig +++ b/boards/bastwan/Kconfig @@ -24,3 +24,6 @@ config BOARD_BASTWAN select HAVE_SAUL_GPIO select HAVE_SX1276 + +config FORCE_USB_STDIO + default y diff --git a/boards/bastwan/bastwan.config b/boards/bastwan/bastwan.config deleted file mode 100644 index 7699f35a5c..0000000000 --- a/boards/bastwan/bastwan.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y diff --git a/boards/blackpill-stm32f103cb/Kconfig b/boards/blackpill-stm32f103cb/Kconfig index 28198b7ee4..bafca351a2 100644 --- a/boards/blackpill-stm32f103cb/Kconfig +++ b/boards/blackpill-stm32f103cb/Kconfig @@ -17,6 +17,9 @@ config BOARD_BLACKPILL_STM32F103CB select HAS_HIGHLEVEL_STDIO +config FORCE_USB_STDIO + default y + # HACK: This is added due to the make resolution # make will select timer backend, probably due to the USBUS # and kconfig cannot select if something is already selected like make diff --git a/boards/blackpill-stm32f103cb/blackpill-stm32f103cb.config b/boards/blackpill-stm32f103cb/blackpill-stm32f103cb.config deleted file mode 100644 index 7699f35a5c..0000000000 --- a/boards/blackpill-stm32f103cb/blackpill-stm32f103cb.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y diff --git a/boards/bluepill-stm32f103cb/Kconfig b/boards/bluepill-stm32f103cb/Kconfig index 6e331ef200..482c27e2ba 100644 --- a/boards/bluepill-stm32f103cb/Kconfig +++ b/boards/bluepill-stm32f103cb/Kconfig @@ -17,6 +17,9 @@ config BOARD_BLUEPILL_STM32F103CB select HAS_HIGHLEVEL_STDIO +config FORCE_USB_STDIO + default y + # HACK: This is added due to the make resolution # make will select timer backend, probably due to the USBUS # and kconfig cannot select if something is already selected like make diff --git a/boards/bluepill-stm32f103cb/bluepill-stm32f103cb.config b/boards/bluepill-stm32f103cb/bluepill-stm32f103cb.config deleted file mode 100644 index 7699f35a5c..0000000000 --- a/boards/bluepill-stm32f103cb/bluepill-stm32f103cb.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y diff --git a/boards/common/arduino-mkr/Makefile.features b/boards/common/arduino-mkr/Makefile.features index d5fcd38821..9888bd0a69 100644 --- a/boards/common/arduino-mkr/Makefile.features +++ b/boards/common/arduino-mkr/Makefile.features @@ -17,9 +17,3 @@ FEATURES_PROVIDED += periph_usbdev FEATURES_PROVIDED += arduino FEATURES_PROVIDED += arduino_pwm FEATURES_PROVIDED += highlevel_stdio - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/common/nrf52/nrf52_bootloader.config b/boards/common/nrf52/nrf52_bootloader.config deleted file mode 100644 index a3ee03b3ef..0000000000 --- a/boards/common/nrf52/nrf52_bootloader.config +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y -CONFIG_MODULE_USB_BOARD_RESET=y diff --git a/boards/common/particle-mesh/Kconfig b/boards/common/particle-mesh/Kconfig index 55cda8499a..551f9f9312 100644 --- a/boards/common/particle-mesh/Kconfig +++ b/boards/common/particle-mesh/Kconfig @@ -21,6 +21,7 @@ config BOARD_COMMON_PARTICLE_MESH select HAVE_SAUL_PWM select MODULE_BOARDS_COMMON_PARTICLE_MESH if TEST_KCONFIG + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG config MODULE_BOARDS_COMMON_PARTICLE_MESH bool @@ -28,4 +29,7 @@ config MODULE_BOARDS_COMMON_PARTICLE_MESH help Common code for particle-mesh boards +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/common/particle-mesh/Makefile.features b/boards/common/particle-mesh/Makefile.features index 98a4aaa362..f8ac8aa3c3 100644 --- a/boards/common/particle-mesh/Makefile.features +++ b/boards/common/particle-mesh/Makefile.features @@ -12,10 +12,4 @@ FEATURES_PROVIDED += vdd_lc_filter_reg1 # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/common/samdx1-arduino-bootloader/Kconfig b/boards/common/samdx1-arduino-bootloader/Kconfig index 9d36689275..da62743e36 100644 --- a/boards/common/samdx1-arduino-bootloader/Kconfig +++ b/boards/common/samdx1-arduino-bootloader/Kconfig @@ -11,3 +11,6 @@ config MODULE_BOARDS_COMMON_SAMDX1-ARDUINO-BOOTLOADER depends on TEST_KCONFIG help Common code of samdx1 boards with an arduino bootloader + +config FORCE_USB_STDIO + default y diff --git a/boards/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config b/boards/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config deleted file mode 100644 index 7699f35a5c..0000000000 --- a/boards/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y diff --git a/boards/common/sodaq/Makefile.features b/boards/common/sodaq/Makefile.features index b4d487327d..4f6613e8d7 100644 --- a/boards/common/sodaq/Makefile.features +++ b/boards/common/sodaq/Makefile.features @@ -13,9 +13,3 @@ FEATURES_PROVIDED += periph_usbdev # Various other features (if any) FEATURES_PROVIDED += arduino FEATURES_PROVIDED += highlevel_stdio - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/common/weact-f4x1cx/Kconfig b/boards/common/weact-f4x1cx/Kconfig index 3b5e04e42e..46fc01fcd7 100644 --- a/boards/common/weact-f4x1cx/Kconfig +++ b/boards/common/weact-f4x1cx/Kconfig @@ -34,4 +34,7 @@ config MODULE_BOARDS_COMMON_WEACT-F4X1CX help Common code of weact based boards +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/common/weact-f4x1cx/weact-f4x1cx.config b/boards/common/weact-f4x1cx/weact-f4x1cx.config index 2d76798de1..d7a295b937 100644 --- a/boards/common/weact-f4x1cx/weact-f4x1cx.config +++ b/boards/common/weact-f4x1cx/weact-f4x1cx.config @@ -1,5 +1,2 @@ CONFIG_MODULE_BOOTLOADER_STM32=y -CONFIG_MODULE_STDIO_CDC_ACM=y -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y CONFIG_MODULE_USB_BOARD_RESET=y diff --git a/boards/esp32s2-lilygo-ttgo-t8/Kconfig b/boards/esp32s2-lilygo-ttgo-t8/Kconfig index 10b9ba3be9..e4c820fa49 100644 --- a/boards/esp32s2-lilygo-ttgo-t8/Kconfig +++ b/boards/esp32s2-lilygo-ttgo-t8/Kconfig @@ -28,7 +28,9 @@ config BOARD_ESP32S2_LILYGO_TTGO_T8 select HAVE_MTD_SDCARD_DEFAULT select HAVE_ST7735 select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT - select MODULE_USBUS_CDC_ACM if MODULE_USBUS && ESP32S2_LILYGO_TTGO_T8_USB + +config FORCE_USB_STDIO + default y if ESP32S2_LILYGO_TTGO_T8_USB menu "LILYGO TTGO T8 ESP32-S2 Board configurations" depends on BOARD_ESP32S2_LILYGO_TTGO_T8 @@ -53,9 +55,4 @@ menu "LILYGO TTGO T8 ESP32-S2 Board configurations" endmenu -choice STDIO_IMPLEMENTATION - default MODULE_STDIO_CDC_ACM if MODULE_USBUS && ESP32S2_LILYGO_TTGO_T8_USB - default MODULE_STDIO_TINYUSB_CDC_ACM if MODULE_TINYUSB_DEVICE && ESP32S2_LILYGO_TTGO_T8_USB -endchoice - source "$(RIOTBOARD)/common/esp32s2/Kconfig" diff --git a/boards/esp32s2-wemos-mini/Kconfig b/boards/esp32s2-wemos-mini/Kconfig index d15b72edd7..e26e13471f 100644 --- a/boards/esp32s2-wemos-mini/Kconfig +++ b/boards/esp32s2-wemos-mini/Kconfig @@ -20,12 +20,12 @@ config BOARD_ESP32S2_WEMOS_MINI select HAS_PERIPH_USBDEV select HAS_TINYUSB_DEVICE select HAS_HIGHLEVEL_STDIO - select MODULE_USBUS_CDC_ACM if TEST_KCONFIG && MODULE_USBUS - select PACKAGE_TINYUSB if TEST_KCONFIG && !MODULE_USBUS -choice STDIO_IMPLEMENTATION - default MODULE_STDIO_CDC_ACM if MODULE_USBUS - default MODULE_STDIO_TINYUSB_CDC_ACM if PACKAGE_TINYUSB +config FORCE_USB_STDIO + default y + +choice USB_IMPLEMENTATION + default PACKAGE_TINYUSB endchoice source "$(RIOTBOARD)/common/esp32s2/Kconfig" diff --git a/boards/esp32s3-pros3/Kconfig b/boards/esp32s3-pros3/Kconfig index 72f596ee83..71bddcca56 100644 --- a/boards/esp32s3-pros3/Kconfig +++ b/boards/esp32s3-pros3/Kconfig @@ -23,13 +23,13 @@ config BOARD_ESP32S3_PROS3 select HAS_PERIPH_SPI select HAS_PERIPH_USBDEV select HAS_TINYUSB_DEVICE - select MODULE_USB_BOARD_RESET if TEST_KCONFIG && MODULE_STDIO_USB_SERIAL_JTAG - select MODULE_USBUS_CDC_ACM if MODULE_USBUS + # Only this board has a requirement to use USB_BOARD_RESET with STDIO_USB_SERIAL_JTAG + select MODULE_USB_BOARD_RESET if MODULE_STDIO_USB_SERIAL_JTAG choice STDIO_IMPLEMENTATION default MODULE_STDIO_CDC_ACM if MODULE_USBUS default MODULE_STDIO_TINYUSB_CDC_ACM if MODULE_TINYUSB_DEVICE - default MODULE_STDIO_USB_SERIAL_JTAG if !MODULE_USBUS && !MODULE_TINYUSB_DEVICE + default MODULE_STDIO_USB_SERIAL_JTAG endchoice source "$(RIOTBOARD)/common/esp32s3/Kconfig" diff --git a/boards/feather-m0/Makefile.features b/boards/feather-m0/Makefile.features index ec234d8296..dcfbbf7224 100644 --- a/boards/feather-m0/Makefile.features +++ b/boards/feather-m0/Makefile.features @@ -15,9 +15,3 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += arduino FEATURES_PROVIDED += highlevel_stdio - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/feather-nrf52840/Kconfig b/boards/feather-nrf52840/Kconfig index e2f22a10a0..ed1fe05678 100644 --- a/boards/feather-nrf52840/Kconfig +++ b/boards/feather-nrf52840/Kconfig @@ -19,5 +19,9 @@ config BOARD_FEATHER_NRF52840 select HAS_HIGHLEVEL_STDIO select HAVE_SAUL_GPIO + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/feather-nrf52840/Makefile.features b/boards/feather-nrf52840/Makefile.features index eb54e9cce9..1f4969f6d9 100644 --- a/boards/feather-nrf52840/Makefile.features +++ b/boards/feather-nrf52840/Makefile.features @@ -9,10 +9,4 @@ FEATURES_PROVIDED += periph_usbdev # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/nrf52840-mdk-dongle/Kconfig b/boards/nrf52840-mdk-dongle/Kconfig index e8eef0a2a5..711095b762 100644 --- a/boards/nrf52840-mdk-dongle/Kconfig +++ b/boards/nrf52840-mdk-dongle/Kconfig @@ -19,5 +19,9 @@ config BOARD_NRF52840_MDK_DONGLE select HAVE_SAUL_GPIO select HAVE_SAUL_PWM + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/nrf52840-mdk-dongle/Makefile.features b/boards/nrf52840-mdk-dongle/Makefile.features index d84ce78dc5..bd678939fe 100644 --- a/boards/nrf52840-mdk-dongle/Makefile.features +++ b/boards/nrf52840-mdk-dongle/Makefile.features @@ -8,10 +8,4 @@ FEATURES_PROVIDED += periph_usbdev # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/nrf52840dongle/Kconfig b/boards/nrf52840dongle/Kconfig index 69263b58f4..5539172c9d 100644 --- a/boards/nrf52840dongle/Kconfig +++ b/boards/nrf52840dongle/Kconfig @@ -25,4 +25,9 @@ config BOARD_NRF52840DONGLE select HAVE_SAUL_PWM select HAVE_SAUL_NRF_VDDH + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/nrf52840dongle/Makefile.features b/boards/nrf52840dongle/Makefile.features index 4e5af160fb..c50288397a 100644 --- a/boards/nrf52840dongle/Makefile.features +++ b/boards/nrf52840dongle/Makefile.features @@ -12,10 +12,4 @@ FEATURES_PROVIDED += vdd_lc_filter_reg1 # Various other features (if any) FEATURES_PROVIDED += highlevel_stdio -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/seeedstudio-gd32/Kconfig b/boards/seeedstudio-gd32/Kconfig index 735921f1fd..dd1da6338d 100644 --- a/boards/seeedstudio-gd32/Kconfig +++ b/boards/seeedstudio-gd32/Kconfig @@ -28,13 +28,11 @@ config BOARD_SEEEDSTUDIO_GD32 select HAVE_MTD_SDCARD_DEFAULT select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT - select MODULE_USBUS if TEST_KCONFIG && !PACKAGE_TINYUSB - select MODULE_USBUS_CDC_ACM if MODULE_USBUS - select MODULE_USB_BOARD_RESET if MODULE_USBUS_CDC_ACM || MODULE_TINYUSB_CLASS_CDC -choice STDIO_IMPLEMENTATION - default MODULE_STDIO_CDC_ACM if MODULE_USBUS - default MODULE_STDIO_TINYUSB_CDC_ACM if PACKAGE_TINYUSB -endchoice + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + + +config FORCE_USB_STDIO + default y source "$(RIOTBOARD)/common/gd32v/Kconfig" diff --git a/boards/seeeduino_xiao/Makefile.features b/boards/seeeduino_xiao/Makefile.features index bc86e9670f..0cc841b65b 100644 --- a/boards/seeeduino_xiao/Makefile.features +++ b/boards/seeeduino_xiao/Makefile.features @@ -11,9 +11,3 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/sensebox_samd21/Makefile.features b/boards/sensebox_samd21/Makefile.features index 1d7ed3da30..7135d3186d 100644 --- a/boards/sensebox_samd21/Makefile.features +++ b/boards/sensebox_samd21/Makefile.features @@ -14,9 +14,3 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += highlevel_stdio FEATURES_PROVIDED += sdcard_spi - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/serpente/Makefile.features b/boards/serpente/Makefile.features index 11c23db01a..ec13b2408e 100644 --- a/boards/serpente/Makefile.features +++ b/boards/serpente/Makefile.features @@ -12,9 +12,3 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/sipeed-longan-nano/Kconfig b/boards/sipeed-longan-nano/Kconfig index 37dafc3d47..5a648cc417 100644 --- a/boards/sipeed-longan-nano/Kconfig +++ b/boards/sipeed-longan-nano/Kconfig @@ -29,9 +29,10 @@ config BOARD_SIPEED_LONGAN_NANO select HAVE_MTD_SDCARD_DEFAULT select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT - select MODULE_USBUS if TEST_KCONFIG && !PACKAGE_TINYUSB - select MODULE_USBUS_CDC_ACM if MODULE_USBUS - select MODULE_USB_BOARD_RESET if MODULE_USBUS_CDC_ACM || MODULE_TINYUSB_CLASS_CDC + select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG + +config FORCE_USB_STDIO + default y menu "Sipeed Longan Nano Board Configuration" @@ -42,9 +43,4 @@ menu "Sipeed Longan Nano Board Configuration" endmenu -choice STDIO_IMPLEMENTATION - default MODULE_STDIO_CDC_ACM if MODULE_USBUS - default MODULE_STDIO_TINYUSB_CDC_ACM if PACKAGE_TINYUSB -endchoice - source "$(RIOTBOARD)/common/gd32v/Kconfig" diff --git a/boards/stm32f429i-disco/Kconfig b/boards/stm32f429i-disco/Kconfig index 48766e5242..a782370a8a 100644 --- a/boards/stm32f429i-disco/Kconfig +++ b/boards/stm32f429i-disco/Kconfig @@ -16,5 +16,8 @@ config BOARD_STM32F429I_DISCO # Put other features for this board (in alphabetical order) select HAS_HIGHLEVEL_STDIO +config FORCE_USB_STDIO + default y + source "$(RIOTBOARD)/common/stm32/Kconfig" source "$(RIOTBOARD)/stm32f429i-disc1/Kconfig" diff --git a/boards/stm32f429i-disco/stm32f429i-disco.config b/boards/stm32f429i-disco/stm32f429i-disco.config deleted file mode 100644 index 7699f35a5c..0000000000 --- a/boards/stm32f429i-disco/stm32f429i-disco.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y diff --git a/boards/stm32f4discovery/Kconfig b/boards/stm32f4discovery/Kconfig index e405c8b46f..ad6d78d76d 100644 --- a/boards/stm32f4discovery/Kconfig +++ b/boards/stm32f4discovery/Kconfig @@ -35,13 +35,8 @@ config BOARD_STM32F4DISCOVERY select HAVE_SAUL_GPIO - select MODULE_USBUS if TEST_KCONFIG && !PACKAGE_TINYUSB - select MODULE_USBUS_CDC_ACM if TEST_KCONFIG && !PACKAGE_TINYUSB - -choice STDIO_IMPLEMENTATION - default MODULE_STDIO_CDC_ACM if MODULE_USBUS - default MODULE_STDIO_TINYUSB_CDC_ACM if PACKAGE_TINYUSB -endchoice +config FORCE_USB_STDIO + default y source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/wemos-zero/Makefile.features b/boards/wemos-zero/Makefile.features index d3731ea2e9..2dbb57c787 100644 --- a/boards/wemos-zero/Makefile.features +++ b/boards/wemos-zero/Makefile.features @@ -1,9 +1,3 @@ include $(RIOTBOARD)/common/arduino-zero/Makefile.features FEATURES_PROVIDED += highlevel_stdio - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config -endif diff --git a/boards/yarm/Kconfig b/boards/yarm/Kconfig index 511347586d..050a6f57ec 100644 --- a/boards/yarm/Kconfig +++ b/boards/yarm/Kconfig @@ -21,3 +21,6 @@ config BOARD_YARM select HAS_PERIPH_UART select HAS_PERIPH_USBDEV select HAS_RIOTBOOT + +config FORCE_USB_STDIO + default y diff --git a/boards/yarm/yarm.config b/boards/yarm/yarm.config deleted file mode 100644 index 7699f35a5c..0000000000 --- a/boards/yarm/yarm.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_MODULE_USBUS=y -CONFIG_MODULE_USBUS_CDC_ACM=y -CONFIG_MODULE_STDIO_CDC_ACM=y diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 18bc4421ad..09521bd845 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -188,6 +188,4 @@ endif # enable bootloader reset over USB, requires CDC ACM to be used ifneq (,$(filter usbus_cdc_acm tinyusb_class_cdc,$(USEMODULE))) USEMODULE += usb_board_reset - - include $(RIOTMAKE)/tools/usb_board_reset.mk endif diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index be081ccd77..91d57a0d4f 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -3,6 +3,10 @@ FLASH_CHIP = $(CPU_FAM) export ESP32_SDK_DIR ?= $(PKGDIRBASE)/esp32_sdk +ifneq (,$(filter usb_board_reset,$(USEMODULE))) + include $(RIOTMAKE)/tools/usb_board_reset.mk +endif + # Serial flasher config as used by the ESP-IDF, be careful when overriding them. # They have to be exported to use same values in subsequent makefiles. ifeq (esp32,$(CPU_FAM)) From 23b6d0b0ad4abd94a8835ffdce274b26e6d39f19 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Thu, 6 Apr 2023 09:24:45 +0200 Subject: [PATCH 11/11] tests/*usb*: Fix USB kconfig model --- tests/pkg/tinyusb_cdc_acm_stdio/app.config.test | 4 ++++ tests/pkg/tinyusb_cdc_msc/app.config.test | 3 +++ tests/sys/fido2_ctap/app.config.test | 3 +++ tests/sys/usbus_board_reset/app.config.test | 3 +++ tests/sys/usbus_msc/app.config.test | 4 ++++ 5 files changed, 17 insertions(+) diff --git a/tests/pkg/tinyusb_cdc_acm_stdio/app.config.test b/tests/pkg/tinyusb_cdc_acm_stdio/app.config.test index a606785cb9..5808de9f5e 100644 --- a/tests/pkg/tinyusb_cdc_acm_stdio/app.config.test +++ b/tests/pkg/tinyusb_cdc_acm_stdio/app.config.test @@ -1,5 +1,9 @@ CONFIG_PACKAGE_TINYUSB=y +CONFIG_KCONFIG_USB=y +CONFIG_MODULE_TINYUSB_CLASS_CDC=y CONFIG_MODULE_STDIO_TINYUSB_CDC_ACM=y CONFIG_MODULE_SHELL=y CONFIG_MODULE_SHELL_CMDS_DEFAULT=y CONFIG_MODULE_PS=y + +CONFIG_CUSTOM_USB_VID_PID=y diff --git a/tests/pkg/tinyusb_cdc_msc/app.config.test b/tests/pkg/tinyusb_cdc_msc/app.config.test index e005a5990d..061852be13 100644 --- a/tests/pkg/tinyusb_cdc_msc/app.config.test +++ b/tests/pkg/tinyusb_cdc_msc/app.config.test @@ -1,3 +1,6 @@ +CONFIG_KCONFIG_USB=y CONFIG_PACKAGE_TINYUSB=y CONFIG_MODULE_TINYUSB_CLASS_CDC=y CONFIG_MODULE_TINYUSB_CLASS_MSC=y + +CONFIG_CUSTOM_USB_VID_PID=y diff --git a/tests/sys/fido2_ctap/app.config.test b/tests/sys/fido2_ctap/app.config.test index df5e7e4f8d..8667a0d282 100644 --- a/tests/sys/fido2_ctap/app.config.test +++ b/tests/sys/fido2_ctap/app.config.test @@ -1,4 +1,5 @@ CONFIG_MODULE_AUTO_INIT_USBUS=n +CONFIG_KCONFIG_USB=y CONFIG_MODULE_USBUS=y CONFIG_MODULE_FIDO2=y CONFIG_MODULE_FIDO2_CTAP=y @@ -6,3 +7,5 @@ CONFIG_MODULE_FIDO2_CTAP_TRANSPORT=y CONFIG_MODULE_FIDO2_CTAP_TRANSPORT_HID=y CONFIG_PACKAGE_FIDO2_TESTS=y + +CONFIG_CUSTOM_USB_VID_PID=y diff --git a/tests/sys/usbus_board_reset/app.config.test b/tests/sys/usbus_board_reset/app.config.test index 6c05ac6202..ffe94ad435 100644 --- a/tests/sys/usbus_board_reset/app.config.test +++ b/tests/sys/usbus_board_reset/app.config.test @@ -3,7 +3,10 @@ CONFIG_MODULE_PS=y CONFIG_MODULE_SHELL=y CONFIG_MODULE_SHELL_CMDS_DEFAULT=y CONFIG_MODULE_USB_BOARD_RESET=y +CONFIG_KCONFIG_USB=y CONFIG_MODULE_USBUS=y CONFIG_MODULE_USBUS_CDC_ACM=y CONFIG_MODULE_AUTO_INIT_USBUS=n + +CONFIG_CUSTOM_USB_VID_PID=y diff --git a/tests/sys/usbus_msc/app.config.test b/tests/sys/usbus_msc/app.config.test index 10fd414cc8..42d1dfb4c5 100644 --- a/tests/sys/usbus_msc/app.config.test +++ b/tests/sys/usbus_msc/app.config.test @@ -1,5 +1,9 @@ CONFIG_MODULE_PS=y CONFIG_MODULE_SHELL=y +CONFIG_KCONFIG_USB=y CONFIG_MODULE_USBUS=y CONFIG_MODULE_USBUS_MSC=y +CONFIG_MODULE_ZTIMER=y CONFIG_MODULE_ZTIMER_MSEC=y + +CONFIG_CUSTOM_USB_VID_PID=y