Skip to content

Commit 1e515ac

Browse files
committed
samples: shell_module: use new USB device stack
Use new USB device stack. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
1 parent 58afdce commit 1e515ac

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

samples/subsys/shell/shell_module/overlay-usb.conf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
CONFIG_USB_DEVICE_STACK=y
2-
CONFIG_USB_DEVICE_PRODUCT="Zephyr USB shell sample"
1+
CONFIG_USB_DEVICE_STACK_NEXT=y
2+
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=y
3+
CONFIG_CDC_ACM_SERIAL_PRODUCT_STRING="Zephyr USB shell sample"
34
CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR=y
4-
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y
5+
CONFIG_USBD_CDC_ACM_LOG_LEVEL_OFF=y
56
CONFIG_UART_LINE_CTRL=y
6-
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
7+
CONFIG_LOG_DEFAULT_LEVEL=1
78

89
# POSIX_TIMERS requires an embedded C library while the native USB driver is incompatible with it.
910
# So let's disable it. Once USB_NATIVE_POSIX supports embedded C libraries this can be removed.

samples/subsys/shell/shell_module/sample.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tests:
1414
extra_configs:
1515
- arch:posix:CONFIG_UART_NATIVE_PTY_0_ON_STDINOUT=y
1616
sample.shell.shell_module.usb:
17-
depends_on: usb_device
17+
depends_on: usbd
1818
tags:
1919
- shell
2020
- usb
@@ -24,7 +24,7 @@ tests:
2424
- EXTRA_CONF_FILE="overlay-usb.conf"
2525
- DTC_OVERLAY_FILE="usb.overlay"
2626
integration_platforms:
27-
- native_sim
27+
- frdm_k64f
2828
sample.shell.shell_module.minimal:
2929
filter: CONFIG_SERIAL and dt_chosen_enabled("zephyr,shell-uart")
3030
tags: shell

samples/subsys/shell/shell_module/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <zephyr/logging/log.h>
1111
#include <stdlib.h>
1212
#include <zephyr/drivers/uart.h>
13-
#include <zephyr/usb/usb_device.h>
1413
#include <ctype.h>
1514

1615
#ifdef CONFIG_ARCH_POSIX
@@ -378,7 +377,7 @@ int main(void)
378377
uint32_t dtr = 0;
379378

380379
dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart));
381-
if (!device_is_ready(dev) || usb_enable(NULL)) {
380+
if (!device_is_ready(dev)) {
382381
return 0;
383382
}
384383

0 commit comments

Comments
 (0)