Skip to content

Commit 272290b

Browse files
jfischer-nokartben
authored andcommitted
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 <[email protected]>
1 parent 0cae816 commit 272290b

File tree

59 files changed

+62
-747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+62
-747
lines changed

boards/adafruit/feather_nrf52840/Kconfig.defconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@
66

77
if BOARD_ADAFRUIT_FEATHER_NRF52840
88

9+
if BOARD_ADAFRUIT_FEATHER_NRF52840_NRF52840_UF2 || BOARD_ADAFRUIT_FEATHER_NRF52840_NRF52840_SENSE_UF2
10+
11+
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
12+
13+
endif
14+
915
endif # BOARD_ADAFRUIT_FEATHER_NRF52840

boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.dts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@
88
/dts-v1/;
99
#include "adafruit_feather_nrf52840_common.dtsi"
1010
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
11+
#include <../boards/common/usb/cdc_acm_serial.dtsi>
1112

1213
/ {
1314
model = "Adafruit Feather nRF52840 Sense";
1415
compatible = "adafruit,feather-nrf52840-sense-uf2";
1516

16-
chosen {
17-
zephyr,console = &cdc_acm_uart0;
18-
zephyr,shell-uart = &cdc_acm_uart0;
19-
zephyr,uart-mcumgr = &cdc_acm_uart0;
20-
zephyr,bt-mon-uart = &cdc_acm_uart0;
21-
zephyr,bt-c2h-uart = &cdc_acm_uart0;
22-
};
23-
2417
leds {
2518
led0: led_0 {
2619
gpios = <&gpio1 9 0>;
@@ -34,9 +27,3 @@
3427
reg = <0x44>;
3528
};
3629
};
37-
38-
zephyr_udc0: &usbd {
39-
cdc_acm_uart0: cdc_acm_uart0 {
40-
compatible = "zephyr,cdc-acm-uart";
41-
};
42-
};

boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2_defconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,5 @@ CONFIG_UART_CONSOLE=y
1717
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
1818
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
1919

20-
# Logger cannot use itself to log
21-
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
22-
23-
# Enable USB
24-
CONFIG_USB_DEVICE_STACK=y
25-
2620
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader
2721
CONFIG_BUILD_OUTPUT_UF2=y

boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2.dts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,15 @@
77
/dts-v1/;
88
#include "adafruit_feather_nrf52840_common.dtsi"
99
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
10+
#include <../boards/common/usb/cdc_acm_serial.dtsi>
1011

1112
/ {
1213
model = "Adafruit Feather nRF52840 Express";
1314
compatible = "adafruit,feather-nrf52840-uf2";
1415

15-
chosen {
16-
zephyr,console = &cdc_acm_uart0;
17-
zephyr,shell-uart = &cdc_acm_uart0;
18-
zephyr,uart-mcumgr = &cdc_acm_uart0;
19-
zephyr,bt-mon-uart = &cdc_acm_uart0;
20-
zephyr,bt-c2h-uart = &cdc_acm_uart0;
21-
};
22-
2316
leds {
2417
led0: led_0 {
2518
gpios = <&gpio1 15 0>;
2619
};
2720
};
2821
};
29-
30-
zephyr_udc0: &usbd {
31-
cdc_acm_uart0: cdc_acm_uart0 {
32-
compatible = "zephyr,cdc-acm-uart";
33-
};
34-
};

boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2_defconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,5 @@ CONFIG_SERIAL=y
1313
CONFIG_CONSOLE=y
1414
CONFIG_UART_CONSOLE=y
1515

16-
# Logger cannot use itself to log
17-
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
18-
19-
# Enable USB
20-
CONFIG_USB_DEVICE_STACK=y
21-
2216
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader
2317
CONFIG_BUILD_OUTPUT_UF2=y

boards/adafruit/itsybitsy/Kconfig

Lines changed: 0 additions & 9 deletions
This file was deleted.

boards/adafruit/itsybitsy/Kconfig.defconfig

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,6 @@
55

66
if BOARD_ADAFRUIT_ITSYBITSY
77

8-
if BOARD_SERIAL_BACKEND_CDC_ACM
9-
10-
config USB_DEVICE_STACK
11-
default y
12-
13-
config USB_CDC_ACM
14-
default SERIAL
15-
16-
config UART_CONSOLE
17-
default CONSOLE
18-
19-
config USB_DEVICE_INITIALIZE_AT_BOOT
20-
default y if CONSOLE
21-
22-
config SHELL_BACKEND_SERIAL_CHECK_DTR
23-
default SHELL
24-
depends on UART_LINE_CTRL
25-
26-
config UART_LINE_CTRL
27-
default SHELL
28-
29-
config USB_DEVICE_REMOTE_WAKEUP
30-
default n
31-
32-
if LOG
33-
34-
# Logger cannot use itself to log
35-
config USB_CDC_ACM_LOG_LEVEL
36-
default 0
37-
38-
# Set USB log level to error only
39-
config USB_DEVICE_LOG_LEVEL
40-
default 1
41-
42-
# Wait 1500ms at startup for logging
43-
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
44-
default 1500
45-
46-
endif # LOG
47-
48-
endif # BOARD_SERIAL_BACKEND_CDC_ACM
8+
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
499

5010
endif # BOARD_ADAFRUIT_ITSYBITSY

boards/adafruit/itsybitsy/adafruit_itsybitsy_nrf52840.dts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
compatible = "adafruit,itsybitsy-nrf52840";
1717

1818
chosen {
19-
zephyr,console = &cdc_acm_uart0;
20-
zephyr,shell-uart = &cdc_acm_uart0;
21-
zephyr,uart-mcumgr = &cdc_acm_uart0;
22-
zephyr,bt-mon-uart = &cdc_acm_uart0;
23-
zephyr,bt-c2h-uart = &cdc_acm_uart0;
2419
zephyr,ieee802154 = &ieee802154;
2520
};
2621

@@ -155,8 +150,6 @@
155150
zephyr_udc0: &usbd {
156151
compatible = "nordic,nrf-usbd";
157152
status = "okay";
158-
159-
cdc_acm_uart0: cdc_acm_uart0 {
160-
compatible = "zephyr,cdc-acm-uart";
161-
};
162153
};
154+
155+
#include <../boards/common/usb/cdc_acm_serial.dtsi>

boards/arduino/opta/Kconfig.defconfig

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,10 @@ config NET_L2_ETHERNET
1111

1212
endif # NETWORKING
1313

14-
if USB_DEVICE_STACK
14+
if BOARD_ARDUINO_OPTA_STM32H747XX_M7
1515

16-
config USB_DEVICE_PRODUCT
17-
default "Arduino Opta"
16+
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
1817

19-
config USB_DEVICE_PID
20-
default 0x0164
21-
22-
config USB_DEVICE_VID
23-
default 0x35d1
24-
25-
config USB_DEVICE_INITIALIZE_AT_BOOT
26-
default y
27-
28-
if LOG
29-
30-
# Logger cannot use itself to log
31-
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
32-
default USB_CDC_ACM_LOG_LEVEL_OFF
33-
endchoice
34-
35-
# Set USB log level to error only
36-
choice USB_DEVICE_LOG_LEVEL_CHOICE
37-
default USB_DEVICE_LOG_LEVEL_ERR
38-
endchoice
39-
40-
endif # LOG
41-
42-
endif # USB_DEVICE_STACK
18+
endif # BOARD_ARDUINO_OPTA_STM32H747XX_M7
4319

4420
endif # BOARD_ARDUINO_OPTA

boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
compatible = "arduino,opta-m7";
1717

1818
chosen {
19-
zephyr,console = &cdc_acm_uart0;
20-
zephyr,shell-uart = &cdc_acm_uart0;
21-
zephyr,cdc-acm-uart0 = &cdc_acm_uart0;
2219
zephyr,sram = &sram0;
2320
zephyr,flash = &flash0;
2421
zephyr,code-partition = &slot0_partition;
@@ -29,12 +26,10 @@ zephyr_udc0: &usbotg_fs {
2926
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
3027
pinctrl-names = "default";
3128
status = "okay";
32-
33-
cdc_acm_uart0: cdc_acm_uart0 {
34-
compatible = "zephyr,cdc-acm-uart";
35-
};
3629
};
3730

31+
#include <../boards/common/usb/cdc_acm_serial.dtsi>
32+
3833
&clk_hse {
3934
clock-frequency = <DT_FREQ_M(25)>;
4035
hse-bypass;
@@ -126,8 +121,3 @@ zephyr_udc0: &usbotg_fs {
126121
status = "okay";
127122
};
128123
};
129-
130-
/* Assign USB serial (ACM) to M7 to have a working console out of the box */
131-
&cdc_acm_uart0 {
132-
status = "okay";
133-
};

0 commit comments

Comments
 (0)