Skip to content

Commit 91bbd4b

Browse files
committed
samples: wpan_serial: use new USB device stack
Use new USB device stack. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
1 parent 7147f08 commit 91bbd4b

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

boards/nxp/usb_kw24d512/usb_kw24d512.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ toolchain:
1010
supported:
1111
- flash
1212
- usb_device
13+
- usbd
1314
- watchdog
1415
vendor: nxp

samples/net/wpan_serial/prj.conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
CONFIG_GPIO=y
2-
CONFIG_USB_DEVICE_STACK=y
32
CONFIG_SERIAL=y
4-
CONFIG_UART_INTERRUPT_DRIVEN=y
53
CONFIG_UART_LINE_CTRL=y
6-
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
4+
5+
CONFIG_USB_DEVICE_STACK_NEXT=y
6+
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=y
7+
CONFIG_USBD_CDC_ACM_LOG_LEVEL_OFF=y
8+
CONFIG_LOG_DEFAULT_LEVEL=1
79

810
CONFIG_NETWORKING=y
911

samples/net/wpan_serial/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sample:
22
description: Test wpan_serial sample
33
name: wpan_serial
44
common:
5-
depends_on: usb_device
5+
depends_on: usbd
66
harness: net
77
tags:
88
- usb

samples/net/wpan_serial/src/main.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
*/
1414

1515
#include <zephyr/logging/log.h>
16-
LOG_MODULE_REGISTER(wpan_serial, CONFIG_USB_DEVICE_LOG_LEVEL);
16+
LOG_MODULE_REGISTER(wpan_serial, LOG_LEVEL_DBG);
1717

1818
#include <zephyr/drivers/uart.h>
1919
#include <zephyr/kernel.h>
20-
#include <zephyr/usb/usb_device.h>
2120
#include <zephyr/random/random.h>
2221

2322
#include <zephyr/net_buf.h>
@@ -544,12 +543,6 @@ int main(void)
544543
return 0;
545544
}
546545

547-
ret = usb_enable(NULL);
548-
if (ret != 0) {
549-
LOG_ERR("Failed to enable USB");
550-
return 0;
551-
}
552-
553546
LOG_DBG("Wait for DTR");
554547

555548
while (1) {

0 commit comments

Comments
 (0)