diff --git a/boards/arm/arduino_nano_33_ble/Kconfig.board b/boards/arm/arduino_nano_33_ble/Kconfig.board index ebf4b156c4554..ba2beb5a70d7a 100644 --- a/boards/arm/arduino_nano_33_ble/Kconfig.board +++ b/boards/arm/arduino_nano_33_ble/Kconfig.board @@ -13,7 +13,6 @@ config BOARD_ARDUINO_NANO_33_BLE_EN_USB_CONSOLE select CONSOLE select PRINTK select UART_INTERRUPT_DRIVEN - select USB_UART_CONSOLE config BOARD_ARDUINO_NANO_33_BLE_INIT_SENSORS bool "Initializes the internal I2C sensors on the board" diff --git a/boards/arm/bl654_usb/Kconfig.defconfig b/boards/arm/bl654_usb/Kconfig.defconfig index 56125667cbb3e..3ce20bab1f721 100644 --- a/boards/arm/bl654_usb/Kconfig.defconfig +++ b/boards/arm/bl654_usb/Kconfig.defconfig @@ -25,9 +25,6 @@ config FLASH_LOAD_OFFSET if USB_DEVICE_STACK -config USB_UART_CONSOLE - default y - config UART_LINE_CTRL default y diff --git a/boards/arm/degu_evk/Kconfig.defconfig b/boards/arm/degu_evk/Kconfig.defconfig index 8728d10f84430..ebd494384d9f7 100644 --- a/boards/arm/degu_evk/Kconfig.defconfig +++ b/boards/arm/degu_evk/Kconfig.defconfig @@ -13,9 +13,6 @@ if USB_DEVICE_STACK config USB_DEVICE_PRODUCT default "Degu Evaluation Kit" -config USB_UART_CONSOLE - default y - config UART_INTERRUPT_DRIVEN default y diff --git a/doc/reference/usb/uds_cdc_acm.rst b/doc/reference/usb/uds_cdc_acm.rst index 94851ea3c2cd9..2e083575d1456 100644 --- a/doc/reference/usb/uds_cdc_acm.rst +++ b/doc/reference/usb/uds_cdc_acm.rst @@ -51,9 +51,6 @@ Console over CDC ACM UART With the CDC ACM UART node from above and ``zephyr,console`` property of the chosen node, we can describe that CDC ACM UART is to be used with the console. A similar overlay file is used by :ref:`cdc-acm-console`. -If USB device support is enabled in the application, as in the console sample, -:kconfig:`CONFIG_USB_UART_CONSOLE` must be enabled, -which does nothing but change the initialization time of the console driver. .. code-block:: devicetree diff --git a/doc/releases/release-notes-3.0.rst b/doc/releases/release-notes-3.0.rst index 907aee73c3423..bb765ecb83e85 100644 --- a/doc/releases/release-notes-3.0.rst +++ b/doc/releases/release-notes-3.0.rst @@ -69,6 +69,12 @@ Removed APIs in this release: devicetree binding's ``fem`` property for information on what to do instead on the Nordic open source controller. +* Removed Kconfig option ``CONFIG_USB_UART_CONSOLE``. + Option ``CONFIG_USB_UART_CONSOLE`` was only relevant for console driver + when CDC ACM UART is used as backend. Since the behavior of the CDC ACM UART + is changed so that it more closely mimics the real UART controller, + option is no longer necessary. + Stable API changes in this release ================================== diff --git a/drivers/console/Kconfig b/drivers/console/Kconfig index 53e9fedb28c35..66bdf069ed072 100644 --- a/drivers/console/Kconfig +++ b/drivers/console/Kconfig @@ -34,7 +34,7 @@ config CONSOLE_HANDLER config CONSOLE_INIT_PRIORITY int "Console init priority" - default 95 if USB_UART_CONSOLE || UART_MUX + default 95 if UART_MUX default 60 if UART_CONSOLE || XTENSA_SIM_CONSOLE default KERNEL_INIT_PRIORITY_DEFAULT help @@ -87,15 +87,6 @@ config UART_CONSOLE_INPUT_EXPIRED_TIMEOUT Fixed amount of time which unit is milliseconds to keep the UART console in use flag true. -config USB_UART_CONSOLE - bool "Use USB port for console outputs" - select UART_CONSOLE - select USB_CDC_ACM - help - Enable this option to use the USB CDC ACM class for console. - As for the console driver, this option only changes the initialization - level. - config RAM_CONSOLE bool "Use RAM console" select CONSOLE_HAS_DRIVER diff --git a/drivers/console/uart_console.c b/drivers/console/uart_console.c index 2ad259a8422c7..0572610238fad 100644 --- a/drivers/console/uart_console.c +++ b/drivers/console/uart_console.c @@ -606,9 +606,7 @@ static int uart_console_init(const struct device *arg) /* UART console initializes after the UART device itself */ SYS_INIT(uart_console_init, -#if defined(CONFIG_USB_UART_CONSOLE) - APPLICATION, -#elif defined(CONFIG_EARLY_CONSOLE) +#if defined(CONFIG_EARLY_CONSOLE) PRE_KERNEL_1, #else POST_KERNEL, diff --git a/samples/boards/sensortile_box/prj.conf b/samples/boards/sensortile_box/prj.conf index 0ea341d2ac8aa..a5fa96419cbb1 100644 --- a/samples/boards/sensortile_box/prj.conf +++ b/samples/boards/sensortile_box/prj.conf @@ -29,7 +29,6 @@ CONFIG_USB_DEVICE_PID=0x1234 CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC SensorTile.box" -CONFIG_USB_UART_CONSOLE=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_CBPRINTF_FP_SUPPORT=y diff --git a/samples/subsys/shell/shell_module/overlay-usb.conf b/samples/subsys/shell/shell_module/overlay-usb.conf index 595379fe995b4..e107d8b026836 100644 --- a/samples/subsys/shell/shell_module/overlay-usb.conf +++ b/samples/subsys/shell/shell_module/overlay-usb.conf @@ -1,5 +1,5 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr USB shell sample" -CONFIG_USB_UART_CONSOLE=y +CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR=y CONFIG_UART_LINE_CTRL=y CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51 diff --git a/samples/subsys/shell/shell_module/src/main.c b/samples/subsys/shell/shell_module/src/main.c index f54a0fa93a890..9306e45c8ea15 100644 --- a/samples/subsys/shell/shell_module/src/main.c +++ b/samples/subsys/shell/shell_module/src/main.c @@ -345,7 +345,7 @@ void main(void) login_init(); } -#if defined(CONFIG_USB_UART_CONSOLE) +#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart) const struct device *dev; uint32_t dtr = 0; diff --git a/samples/subsys/usb/console/prj.conf b/samples/subsys/usb/console/prj.conf index 0dd080781f1f6..d47cffdd48936 100644 --- a/samples/subsys/usb/console/prj.conf +++ b/samples/subsys/usb/console/prj.conf @@ -2,5 +2,6 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr USB console sample" CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y CONFIG_UART_LINE_CTRL=y -CONFIG_USB_UART_CONSOLE=y diff --git a/subsys/shell/backends/Kconfig.backends b/subsys/shell/backends/Kconfig.backends index 1a054f6e27055..6e902f62408c9 100644 --- a/subsys/shell/backends/Kconfig.backends +++ b/subsys/shell/backends/Kconfig.backends @@ -73,7 +73,6 @@ config SHELL_BACKEND_SERIAL_RX_POLL_PERIOD config SHELL_BACKEND_SERIAL_CHECK_DTR bool "Check DTR signal before TX" - default y if USB_UART_CONSOLE depends on UART_LINE_CTRL help Check DTR signal before TX. diff --git a/subsys/usb/class/cdc_acm.c b/subsys/usb/class/cdc_acm.c index f91905a05cb73..1601bd2248074 100644 --- a/subsys/usb/class/cdc_acm.c +++ b/subsys/usb/class/cdc_acm.c @@ -1104,7 +1104,7 @@ static const struct uart_driver_api cdc_acm_driver_api = { \ DEVICE_DT_INST_DEFINE(idx, cdc_acm_init, NULL, \ &cdc_acm_dev_data_##idx, &cdc_acm_config_##idx, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &cdc_acm_driver_api); DT_INST_FOREACH_STATUS_OKAY(CDC_ACM_DT_DEVICE_DEFINE); diff --git a/tests/bluetooth/shell/cdc_acm.conf b/tests/bluetooth/shell/cdc_acm.conf index 4d47213402ef1..bd9204fa006b1 100644 --- a/tests/bluetooth/shell/cdc_acm.conf +++ b/tests/bluetooth/shell/cdc_acm.conf @@ -1,6 +1,6 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr BT Shell" -CONFIG_USB_UART_CONSOLE=y CONFIG_UART_LINE_CTRL=y +CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR=y CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51 diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index 7aaca402e9610..1cae7fbc13e84 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -122,10 +123,20 @@ static void hrs_notify(void) void main(void) { - if (IS_ENABLED(CONFIG_USB_UART_CONSOLE)) { - usb_enable(NULL); - k_sleep(K_SECONDS(2)); +#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart) + const struct device *dev; + uint32_t dtr = 0; + + dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart)); + if (!device_is_ready(dev) || usb_enable(NULL)) { + return; + } + + while (!dtr) { + uart_line_ctrl_get(dev, UART_LINE_CTRL_DTR, &dtr); + k_sleep(K_MSEC(100)); } +#endif printk("Type \"help\" for supported commands."); printk("Before any Bluetooth commands you must `bt init` to initialize" diff --git a/tests/drivers/console/prj_semihost.conf b/tests/drivers/console/prj_semihost.conf index 1864c4e75079a..7adbc210d7b48 100644 --- a/tests/drivers/console/prj_semihost.conf +++ b/tests/drivers/console/prj_semihost.conf @@ -2,5 +2,4 @@ CONFIG_TEST=y CONFIG_CONSOLE=y CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n -CONFIG_USB_UART_CONSOLE=n CONFIG_SEMIHOST_CONSOLE=y diff --git a/tests/drivers/uart/uart_basic_api/overlay-usb.conf b/tests/drivers/uart/uart_basic_api/overlay-usb.conf index 1f237687b14f1..3af32b0ea5317 100644 --- a/tests/drivers/uart/uart_basic_api/overlay-usb.conf +++ b/tests/drivers/uart/uart_basic_api/overlay-usb.conf @@ -1,5 +1,4 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM UART" -CONFIG_USB_UART_CONSOLE=y CONFIG_UART_LINE_CTRL=y CONFIG_TEST_LOGGING_DEFAULTS=n diff --git a/tests/drivers/uart/uart_basic_api/src/main.c b/tests/drivers/uart/uart_basic_api/src/main.c index 753365f9bc055..5f73d91922d2c 100644 --- a/tests/drivers/uart/uart_basic_api/src/main.c +++ b/tests/drivers/uart/uart_basic_api/src/main.c @@ -58,7 +58,7 @@ void test_uart_pending(void) void test_main(void) { -#if defined(CONFIG_USB_UART_CONSOLE) +#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart) const struct device *dev; uint32_t dtr = 0;