Skip to content

Commit 4245f34

Browse files
committed
snippets: cdc-acm-console: add Kconfig file
Allow snippet to be used with any board that wants to use the CDC ACM UART as a logging or shell backend. Signed-off-by: Johann Fischer <[email protected]>
1 parent 1d211a5 commit 4245f34

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

snippets/cdc-acm-console/Kconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2023-2024 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config SHELL_BACKEND_SERIAL_CHECK_DTR
6+
default SHELL
7+
depends on UART_LINE_CTRL
8+
9+
config UART_LINE_CTRL
10+
default SHELL
11+
12+
config USB_DEVICE_INITIALIZE_AT_BOOT
13+
default y if !MCUBOOT
14+
15+
config USB_DEVICE_REMOTE_WAKEUP
16+
default n
17+
18+
if LOG
19+
20+
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
21+
default USB_CDC_ACM_LOG_LEVEL_OFF
22+
endchoice
23+
24+
choice USB_DEVICE_LOG_LEVEL_CHOICE
25+
default USB_DEVICE_LOG_LEVEL_OFF
26+
endchoice
27+
28+
# Wait 4000ms at startup for logging
29+
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
30+
default 4000
31+
32+
endif # LOG

snippets/cdc-acm-console/cdc-acm-console.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ CONFIG_USB_DEVICE_PID=0x0004
55
CONFIG_SERIAL=y
66
CONFIG_CONSOLE=y
77
CONFIG_UART_CONSOLE=y
8-
CONFIG_UART_LINE_CTRL=y

snippets/cdc-acm-console/cdc-acm-console.overlay

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
chosen {
99
zephyr,console = &snippet_cdc_acm_console_uart;
1010
zephyr,shell-uart = &snippet_cdc_acm_console_uart;
11+
zephyr,uart-mcumgr = &snippet_cdc_acm_console_uart;
1112
};
1213
};
1314

snippets/cdc-acm-console/snippet.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ name: cdc-acm-console
22
append:
33
EXTRA_CONF_FILE: cdc-acm-console.conf
44
EXTRA_DTC_OVERLAY_FILE: cdc-acm-console.overlay
5+
kconfig: Kconfig

0 commit comments

Comments
 (0)