Skip to content

Commit 6b556ae

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 81597ed commit 6b556ae

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
@@ -13,7 +13,7 @@ tests:
1313
extra_configs:
1414
- arch:posix:CONFIG_UART_NATIVE_PTY_0_ON_STDINOUT=y
1515
sample.shell.shell_module.usb:
16-
depends_on: usb_device
16+
depends_on: usbd
1717
tags:
1818
- shell
1919
- usb
@@ -23,7 +23,7 @@ tests:
2323
- EXTRA_CONF_FILE="overlay-usb.conf"
2424
- DTC_OVERLAY_FILE="usb.overlay"
2525
integration_platforms:
26-
- native_sim
26+
- frdm_k64f
2727
sample.shell.shell_module.minimal:
2828
filter: CONFIG_SERIAL and dt_chosen_enabled("zephyr,shell-uart")
2929
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)