boards: use board common CDC ACM UART configuration

Remove all USB and CDC ACM configuration in favor of common
configuraiton.

Do not adapt board-specific configurations such as unknown PID/VID or
string descriptors. There is no justification for using them on specific
boards, and we do not have formal approval to use them in the project
tree. Also, we need more uniform configuration, since the main reason
for enabling CDC ACM here is to allow users to run examples like
hello_world right out of the box. Of course, anyone is free to customize
these settings in their fork or downstream project.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2024-11-07 23:36:32 +01:00 committed by Benjamin Cabé
commit 272290bfee
59 changed files with 62 additions and 747 deletions

View file

@ -6,4 +6,10 @@
if BOARD_ADAFRUIT_FEATHER_NRF52840
if BOARD_ADAFRUIT_FEATHER_NRF52840_NRF52840_UF2 || BOARD_ADAFRUIT_FEATHER_NRF52840_NRF52840_SENSE_UF2
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif
endif # BOARD_ADAFRUIT_FEATHER_NRF52840

View file

@ -8,19 +8,12 @@
/dts-v1/;
#include "adafruit_feather_nrf52840_common.dtsi"
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
#include <../boards/common/usb/cdc_acm_serial.dtsi>
/ {
model = "Adafruit Feather nRF52840 Sense";
compatible = "adafruit,feather-nrf52840-sense-uf2";
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,uart-mcumgr = &cdc_acm_uart0;
zephyr,bt-mon-uart = &cdc_acm_uart0;
zephyr,bt-c2h-uart = &cdc_acm_uart0;
};
leds {
led0: led_0 {
gpios = <&gpio1 9 0>;
@ -34,9 +27,3 @@
reg = <0x44>;
};
};
zephyr_udc0: &usbd {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};

View file

@ -17,11 +17,5 @@ CONFIG_UART_CONSOLE=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
# Logger cannot use itself to log
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader
CONFIG_BUILD_OUTPUT_UF2=y

View file

@ -7,28 +7,15 @@
/dts-v1/;
#include "adafruit_feather_nrf52840_common.dtsi"
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
#include <../boards/common/usb/cdc_acm_serial.dtsi>
/ {
model = "Adafruit Feather nRF52840 Express";
compatible = "adafruit,feather-nrf52840-uf2";
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,uart-mcumgr = &cdc_acm_uart0;
zephyr,bt-mon-uart = &cdc_acm_uart0;
zephyr,bt-c2h-uart = &cdc_acm_uart0;
};
leds {
led0: led_0 {
gpios = <&gpio1 15 0>;
};
};
};
zephyr_udc0: &usbd {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};

View file

@ -13,11 +13,5 @@ CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Logger cannot use itself to log
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader
CONFIG_BUILD_OUTPUT_UF2=y

View file

@ -1,9 +0,0 @@
# Adafruit ItsyBitsy nRF52840 Express board configuration
# Copyright (c) 2022 Embla Flatlandsmo <embla.flatlandsmo@gmail.com>
# SPDX-License-Identifier: Apache-2.0
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "USB CDC"
default y
depends on BOARD_ADAFRUIT_ITSYBITSY

View file

@ -5,46 +5,6 @@
if BOARD_ADAFRUIT_ITSYBITSY
if BOARD_SERIAL_BACKEND_CDC_ACM
config USB_DEVICE_STACK
default y
config USB_CDC_ACM
default SERIAL
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if CONSOLE
config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL
config UART_LINE_CTRL
default SHELL
config USB_DEVICE_REMOTE_WAKEUP
default n
if LOG
# Logger cannot use itself to log
config USB_CDC_ACM_LOG_LEVEL
default 0
# Set USB log level to error only
config USB_DEVICE_LOG_LEVEL
default 1
# Wait 1500ms at startup for logging
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
default 1500
endif # LOG
endif # BOARD_SERIAL_BACKEND_CDC_ACM
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_ADAFRUIT_ITSYBITSY

View file

@ -16,11 +16,6 @@
compatible = "adafruit,itsybitsy-nrf52840";
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,uart-mcumgr = &cdc_acm_uart0;
zephyr,bt-mon-uart = &cdc_acm_uart0;
zephyr,bt-c2h-uart = &cdc_acm_uart0;
zephyr,ieee802154 = &ieee802154;
};
@ -155,8 +150,6 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -11,34 +11,10 @@ config NET_L2_ETHERNET
endif # NETWORKING
if USB_DEVICE_STACK
if BOARD_ARDUINO_OPTA_STM32H747XX_M7
config USB_DEVICE_PRODUCT
default "Arduino Opta"
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
config USB_DEVICE_PID
default 0x0164
config USB_DEVICE_VID
default 0x35d1
config USB_DEVICE_INITIALIZE_AT_BOOT
default y
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
# Set USB log level to error only
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_ERR
endchoice
endif # LOG
endif # USB_DEVICE_STACK
endif # BOARD_ARDUINO_OPTA_STM32H747XX_M7
endif # BOARD_ARDUINO_OPTA

View file

@ -16,9 +16,6 @@
compatible = "arduino,opta-m7";
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,cdc-acm-uart0 = &cdc_acm_uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -29,11 +26,9 @@ zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>
&clk_hse {
clock-frequency = <DT_FREQ_M(25)>;
@ -126,8 +121,3 @@ zephyr_udc0: &usbotg_fs {
status = "okay";
};
};
/* Assign USB serial (ACM) to M7 to have a working console out of the box */
&cdc_acm_uart0 {
status = "okay";
};

View file

@ -27,6 +27,3 @@ CONFIG_STM32H7_BOOT_M4_AT_INIT=n
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable USB Stack (needed for the console to work)
CONFIG_USB_DEVICE_STACK=y

View file

@ -10,34 +10,10 @@ config NET_L2_ETHERNET
endif # NETWORKING
if USB_DEVICE_STACK
if BOARD_ARDUINO_PORTENTA_H7_STM32H747XX_M7
config USB_DEVICE_PRODUCT
default "Arduino SA Portenta H7"
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
config USB_DEVICE_PID
default 0x035b
config USB_DEVICE_VID
default 0x2341
config USB_DEVICE_INITIALIZE_AT_BOOT
default y
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
# Set USB log level to error only
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_ERR
endchoice
endif # LOG
endif # USB_DEVICE_STACK
endif # BOARD_ARDUINO_PORTENTA_H7_STM32H747XX_M7
endif # BOARD_ARDUINO_PORTENTA_H7

View file

@ -243,7 +243,4 @@ zephyr_udc0: &usbotg_hs {
<&rcc STM32_SRC_HSI48 USB_SEL(3)>;
num-bidir-endpoints = < 4 >;
status = "okay";
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};

View file

@ -8,6 +8,7 @@
#include <st/h7/stm32h747Xi_m7.dtsi>
#include <st/h7/stm32h747xihx-pinctrl.dtsi>
#include "arduino_portenta_h7-common.dtsi"
#include <../boards/common/usb/cdc_acm_serial.dtsi>
/ {
model = "Arduino Portenta H7 board";
@ -15,9 +16,6 @@
/* HW resources are split between CM7 and CM4 */
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,cdc-acm-uart0 = &cdc_acm_uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -98,10 +96,6 @@
status = "okay";
};
&cdc_acm_uart0 {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";

View file

@ -25,6 +25,3 @@ CONFIG_UART_LINE_CTRL=y
# Enable regulator
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED=y
# Enable USB Stack
CONFIG_USB_DEVICE_STACK=y

View file

@ -5,29 +5,6 @@
if BOARD_DEGU_EVK
if USB_DEVICE_STACK
config USB_DEVICE_PRODUCT
default "Degu Evaluation Kit"
config UART_INTERRUPT_DRIVEN
default y
config UART_LINE_CTRL
default y
endif # USB_DEVICE_STACK
if LOG
# Logger cannot use itself to log
config USB_CDC_ACM_LOG_LEVEL
default 0
# Set USB log level to error only
config USB_DEVICE_LOG_LEVEL
default 1
endif # LOG
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_DEGU_EVK

View file

@ -16,8 +16,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &degu_cdc_acm_uart;
zephyr,shell-uart = &degu_cdc_acm_uart;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;
};
@ -173,8 +171,6 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
degu_cdc_acm_uart: degu_cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -10,9 +10,6 @@ CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable USB (for CDC ACM console)
CONFIG_USB_DEVICE_STACK=y
# Additional board options
CONFIG_GPIO=y

View file

@ -3,13 +3,6 @@
if BOARD_CROXEL_CX1825
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
endif # LOG
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_CROXEL_CX1825

View file

@ -17,8 +17,6 @@
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,console = &cdc_acm_0;
zephyr,shell-uart = &cdc_acm_0;
};
leds {
@ -130,11 +128,9 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
cdc_acm_0: cdc_acm_0 {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>
&flash0 {

View file

@ -10,11 +10,6 @@ CONFIG_HW_STACK_PROTECTION=y
# enable GPIO
CONFIG_GPIO=y
# Assume we start console by default
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
# Console over USB CDC-ACM
CONFIG_USB_DEVICE_STACK=y
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

View file

@ -1,9 +0,0 @@
# CTHINGS.CO Connectivity Card board configuration
# Copyright (c) 2024 CTHINGS.CO
# SPDX-License-Identifier: Apache-2.0
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "USB CDC"
default y
depends on BOARD_CTCC_NRF52840

View file

@ -5,51 +5,6 @@
if BOARD_CTCC_NRF52840
if BOARD_SERIAL_BACKEND_CDC_ACM
config USB_DEVICE_STACK
default y
config USB_CDC_ACM
default SERIAL
config CONSOLE
default y
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if !MCUBOOT && CONSOLE
config USB_DEVICE_REMOTE_WAKEUP
default n
if LOG
# Turn off logging for USB CDC ACM
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
# Turn off logging for USB Device
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_OFF
endchoice
# Wait 5s at startup for logging
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
default 5000
endif # LOG
if USB_DEVICE_STACK
config SERIAL
default y
endif # USB_DEVICE_STACK
endif # BOARD_SERIAL_BACKEND_CDC_ACM
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_CTCC_NRF52840

View file

@ -12,11 +12,6 @@
compatible = "ct,ctcc-nrf52840";
chosen {
zephyr,console = &cdc_acm_uart;
zephyr,shell-uart = &cdc_acm_uart;
zephyr,uart-mcumgr = &cdc_acm_uart;
zephyr,bt-mon-uart = &cdc_acm_uart;
zephyr,bt-c2h-uart = &cdc_acm_uart;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -88,8 +83,6 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -1,10 +0,0 @@
# BL654 USB adapter board configuration
# Copyright (c) 2021 Laird Connectivity
# SPDX-License-Identifier: Apache-2.0
config BL654_USB_SERIAL_BACKEND_CDCACM
bool "Use CDC ACM UART as backend for BL654 USB adapter"
default y if !USB_DEVICE_BLUETOOTH
help
Use CDC ACM UART as backend for console or shell.

View file

@ -25,32 +25,6 @@ config FLASH_LOAD_SIZE
default 0xdf000
depends on !USE_DT_CODE_PARTITION
config USB_CDC_ACM
default n if USB_DEVICE_BLUETOOTH
if BL654_USB_SERIAL_BACKEND_CDCACM
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if !MCUBOOT
config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL
config UART_LINE_CTRL
default SHELL
# Logger cannot use itself to log
config USB_CDC_ACM_LOG_LEVEL
default 0
# Set USB log level to error only
config USB_DEVICE_LOG_LEVEL
default 1
endif #BL654_USB_SERIAL_BACKEND_CDCACM
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_BL654_USB

View file

@ -16,9 +16,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &bl654_cdc_acm_uart;
zephyr,shell-uart = &bl654_cdc_acm_uart;
zephyr,bt-c2h-uart = &bl654_cdc_acm_uart;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;
};
@ -118,8 +115,6 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
bl654_cdc_acm_uart: bl654_cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -13,9 +13,6 @@ CONFIG_CONSOLE=y
# Enable GPIO
CONFIG_GPIO=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y
# 32KHz clock source
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM=y

View file

@ -23,12 +23,6 @@ config FLASH_LOAD_OFFSET
default 0x1000
depends on BOARD_HAS_NRF5_BOOTLOADER && !USE_DT_CODE_PARTITION
if USB_DEVICE_STACK
# Enable UART driver, needed for CDC ACM
config SERIAL
default y
endif # USB_DEVICE_STACK
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_NRF52840_MDK_USB_DONGLE

View file

@ -16,11 +16,6 @@
compatible = "nrf52840_mdk_usb_dongle";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -128,3 +123,5 @@ zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -3,22 +3,6 @@
if BOARD_MIKROE_STM32_M4_CLICKER
if USB_DEVICE_STACK
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y
endif # USB_DEVICE_STACK
if LOG
# Logger cannot use itself to log
config USB_CDC_ACM_LOG_LEVEL
default 0
endif # LOG
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_MIKROE_STM32_M4_CLICKER

View file

@ -14,8 +14,6 @@
compatible = "st,stm32f415rg";
chosen {
zephyr,console = &usb_cdc_acm_uart;
zephyr,shell-uart = &usb_cdc_acm_uart;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
@ -126,11 +124,9 @@ zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};
usb_cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>
mikrobus_spi: &spi2 {};
mikrobus_serial: &usart3 {};

View file

@ -16,6 +16,3 @@ CONFIG_GPIO=y
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y

View file

@ -12,8 +12,4 @@ config BOARD_HAS_NRF5_BOOTLOADER
If selected, applications are linked so that they can be loaded by Nordic
nRF5 bootloader.
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "USB CDC"
default y
endif # BOARD_NRF52840DONGLE

View file

@ -22,59 +22,6 @@ config FLASH_LOAD_OFFSET
default 0x1000
depends on BOARD_HAS_NRF5_BOOTLOADER && (MCUBOOT || !USE_DT_CODE_PARTITION)
if BOARD_SERIAL_BACKEND_CDC_ACM
config USB_DEVICE_STACK
default y
config USB_CDC_ACM
default SERIAL
config CONSOLE
default y
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if !MCUBOOT && CONSOLE
config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL
config UART_LINE_CTRL
default SHELL
config USB_DEVICE_REMOTE_WAKEUP
default n
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
# Set USB log level to error only
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_ERR
endchoice
# Wait 4000ms at startup for logging
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
default 4000
endif # LOG
if USB_DEVICE_STACK
# Enable UART driver, needed for CDC ACM
config SERIAL
default y
endif # USB_DEVICE_STACK
endif # BOARD_SERIAL_BACKEND_CDC_ACM
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_NRF52840DONGLE

View file

@ -15,11 +15,6 @@
compatible = "nordic,nrf52840-dongle-nrf52840";
chosen {
zephyr,console = &cdc_acm_uart;
zephyr,shell-uart = &cdc_acm_uart;
zephyr,uart-mcumgr = &cdc_acm_uart;
zephyr,bt-mon-uart = &cdc_acm_uart;
zephyr,bt-c2h-uart = &cdc_acm_uart;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -188,8 +183,6 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -11,10 +11,6 @@ config THINGY53_INIT_PRIORITY
if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "USB CDC"
default y
config DOMAIN_CPUNET_BOARD
string
default "thingy53/nrf5340/cpunet"

View file

@ -79,58 +79,7 @@ config REGULATOR
endif # !TRUSTED_EXECUTION_SECURE
if BOARD_SERIAL_BACKEND_CDC_ACM
config USB_DEVICE_PRODUCT
default "Thingy:53 Application"
config USB_DEVICE_VID
default 0x1915
config USB_DEVICE_PID
default 0x530C
config USB_DEVICE_STACK
default y
config USB_CDC_ACM
default y
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if !MCUBOOT
config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL
config UART_LINE_CTRL
default SHELL
config USB_DEVICE_REMOTE_WAKEUP
default n
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
# Set USB log level to error only
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_ERR
endchoice
# Wait 4000ms at startup for logging
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
default 4000
endif # LOG
endif # BOARD_SERIAL_BACKEND_CDC_ACM
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS

View file

@ -9,11 +9,6 @@
/ {
chosen {
zephyr,console = &cdc_acm_uart;
zephyr,shell-uart = &cdc_acm_uart;
zephyr,uart-mcumgr = &cdc_acm_uart;
zephyr,bt-mon-uart = &cdc_acm_uart;
zephyr,bt-c2h-uart = &cdc_acm_uart;
zephyr,bt-hci-ipc = &ipc0;
zephyr,bt-hci = &bt_hci_ipc0;
nordic,802154-spinel-ipc = &ipc0;
@ -316,10 +311,6 @@ edge_connector_spi: &spi4 {
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
/* Include default memory partition configuration file */

View file

@ -7,6 +7,7 @@
/dts-v1/;
#include <nordic/nrf5340_cpuapp_qkaa.dtsi>
#include "thingy53_nrf5340_common.dtsi"
#include <../boards/common/usb/cdc_acm_serial.dtsi>
/ {
model = "Nordic Thingy53 NRF5340 Application";

View file

@ -7,6 +7,7 @@
/dts-v1/;
#include <nordic/nrf5340_cpuappns_qkaa.dtsi>
#include "thingy53_nrf5340_common.dtsi"
#include <../boards/common/usb/cdc_acm_serial.dtsi>
/ {
model = "Nordic Thingy53 NRF5340 Application";

View file

@ -5,3 +5,5 @@
configdefault LV_COLOR_16_SWAP
default y if LVGL
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"

View file

@ -18,8 +18,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &wio_terminal_console;
zephyr,shell-uart = &wio_terminal_console;
zephyr,code-partition = &code_partition;
zephyr,display = &ili9341;
};
@ -300,8 +298,6 @@ zephyr_udc0: &usb0 {
status = "okay";
pinctrl-0 = <&usb_dc_default>;
pinctrl-names = "default";
};
wio_terminal_console: wio_terminal_console {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -14,16 +14,3 @@ CONFIG_REGULATOR=y
CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2=y
CONFIG_BUILD_OUTPUT_UF2=y
# Console over USB CDC-ACM
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
CONFIG_USB_DEVICE_VID=0x2886
CONFIG_USB_DEVICE_PID=0x802D
CONFIG_USB_DEVICE_MANUFACTURER="Seeed Studio"
CONFIG_USB_DEVICE_PRODUCT="Wio Terminal"
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y

View file

@ -5,14 +5,6 @@
if BOARD_XIAO_BLE
if USB_DEVICE_STACK
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y
endif # USB_DEVICE_STACK
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_XIAO_BLE

View file

@ -12,11 +12,6 @@
/ {
chosen {
zephyr,console = &usb_cdc_acm_uart;
zephyr,shell-uart = &usb_cdc_acm_uart;
zephyr,uart-mcumgr = &usb_cdc_acm_uart;
zephyr,bt-mon-uart = &usb_cdc_acm_uart;
zephyr,bt-c2h-uart = &usb_cdc_acm_uart;
zephyr,ieee802154 = &ieee802154;
};
@ -146,8 +141,6 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
usb_cdc_acm_uart: cdc-acm-uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>

View file

@ -15,12 +15,6 @@ CONFIG_SERIAL=y
# Enable console
CONFIG_CONSOLE=y
# Logger cannot use itself to log
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_USE_DT_CODE_PARTITION=y

View file

@ -15,12 +15,6 @@ CONFIG_SERIAL=y
# Enable console
CONFIG_CONSOLE=y
# Logger cannot use itself to log
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_USE_DT_CODE_PARTITION=y

View file

@ -1,12 +0,0 @@
# SENSORTILE_BOX_PRO board configuration
# Copyright (c) 2024 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0
if BOARD_SENSORTILE_BOX_PRO
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "Use USB CDC as serial console backend"
default y
endif # BOARD_SENSORTILE_BOX_PRO

View file

@ -20,50 +20,6 @@ config SPI_STM32_INTERRUPT
default y
depends on SPI
if BOARD_SERIAL_BACKEND_CDC_ACM
config USB_DEVICE_STACK
default y
config USB_CDC_ACM
default SERIAL
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if CONSOLE
config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL
config UART_LINE_CTRL
default SHELL
config USB_DEVICE_REMOTE_WAKEUP
default n
config USB_DEVICE_VID
default 0x0483
config USB_DEVICE_PID
default 0x5740
config USB_DEVICE_PRODUCT
default "Zephyr CDC SensorTile.box PRO"
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
endif # LOG
endif # BOARD_SERIAL_BACKEND_CDC_ACM
DT_CHOSEN_ZEPHYR_CONSOLE := zephyr,console
config UART_CONSOLE
default y if $(dt_chosen_enabled,$(DT_CHOSEN_ZEPHYR_CONSOLE)) && CONSOLE
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_SENSORTILE_BOX_PRO

View file

@ -221,24 +221,7 @@ Console
There are two possible options for Zephyr console output:
- through USB as USB CDC/ACM class. This is the default case present in the board dts file
and is enabled by :kconfig:option:`CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM`.
.. code-block:: dts
:caption: boards/st/sensortile_box_pro/sensortile_box_pro.dts
/ {
chosen {
zephyr,console = &cdc_acm_uart0;
};
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
- through common CDC ACM UART backend configuration for all boards
- through UART4 which is available on SWD connector (JP2). In this case a JTAG adapter
can be used to connect SensorTile.box PRO and have both SWD and console lines available.

View file

@ -14,9 +14,6 @@
compatible = "st,sensortile-box-pro";
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,bt-c2h-uart = &cdc_acm_uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -269,11 +266,9 @@ zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>
&adc1 {
pinctrl-0 = <&adc1_in15_pb0>;

View file

@ -1,12 +0,0 @@
# STEVAL_STWINBX1 Development kit board configuration
# Copyright (c) 2024 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0
if BOARD_STEVAL_STWINBX1
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "Use USB CDC as serial console backend"
default y
endif # BOARD_STEVAL_STWINBX1

View file

@ -20,50 +20,6 @@ config SPI_STM32_INTERRUPT
default y
depends on SPI
if BOARD_SERIAL_BACKEND_CDC_ACM
config USB_DEVICE_STACK
default y
config USB_CDC_ACM
default SERIAL
config USB_DEVICE_INITIALIZE_AT_BOOT
default y if CONSOLE
config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL
config UART_LINE_CTRL
default SHELL
config USB_DEVICE_REMOTE_WAKEUP
default n
config USB_DEVICE_VID
default 0x0483
config USB_DEVICE_PID
default 0x5740
config USB_DEVICE_PRODUCT
default "Zephyr CDC STEval-STWinbx1"
if LOG
# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice
endif # LOG
endif # BOARD_SERIAL_BACKEND_CDC_ACM
DT_CHOSEN_ZEPHYR_CONSOLE := zephyr,console
config UART_CONSOLE
default y if $(dt_chosen_enabled,$(DT_CHOSEN_ZEPHYR_CONSOLE)) && CONSOLE
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_STEVAL_STWINBX1

View file

@ -230,23 +230,7 @@ Console
There are two possible options for Zephyr console output:
- through USB as USB CDC/ACM class. This is the default case present in the board dts file
and is enabled by :kconfig:option:`CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM`.
.. code-block:: dts
:caption: boards/st/steval_stwinbx1/steval_stwinbx1.dts
/ {
chosen {
zephyr,console = &cdc_acm_uart0;
};
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
- through common CDC ACM UART backend configuration for all boards
- through USART2 which is available on SWD connector (CN4). In this case a JTAG adapter
can be used to connect STEVAL-STWINBX1 and have both SWD and console lines available.

View file

@ -14,9 +14,6 @@
compatible = "st,steval_stwinbx1";
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
@ -250,11 +247,9 @@ zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>
&adc1 {
pinctrl-0 = <&adc1_in1_pc0>;

View file

@ -22,14 +22,6 @@ endif # LVGL
endif # DISPLAY
if USB_DEVICE_STACK
config UART_CONSOLE
default CONSOLE
config USB_DEVICE_INITIALIZE_AT_BOOT
default y
endif # USB_DEVICE_STACK
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
endif # BOARD_MINI_STM32H743

View file

@ -15,8 +15,6 @@
compatible = "weact,mini-stm32h743";
chosen {
zephyr,console = &usb_cdc_acm_uart;
zephyr,shell-uart = &usb_cdc_acm_uart;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,display = &st7735r_160x80;
@ -155,11 +153,9 @@ zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};
usb_cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
#include <../boards/common/usb/cdc_acm_serial.dtsi>
&quadspi {
pinctrl-names = "default";

View file

@ -15,9 +15,3 @@ CONFIG_CONSOLE=y
# Enable GPIO
CONFIG_GPIO=y
# Logger cannot use itself to log
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
# Enable USB
CONFIG_USB_DEVICE_STACK=y