Skip to content

Commit 6d39c05

Browse files
committed
usb: device_next: Simple NCM driver for usb-next
Sample changes. Signed-off-by: Hardy Griech <[email protected]>
1 parent a802fe2 commit 6d39c05

File tree

6 files changed

+37
-6
lines changed

6 files changed

+37
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# USB Device Settings
22
CONFIG_USB_DEVICE_STACK=y
33

4+
CONFIG_NET_PKT_RX_COUNT=14
5+
CONFIG_NET_PKT_TX_COUNT=14
6+
CONFIG_NET_BUF_RX_COUNT=28
7+
CONFIG_NET_BUF_TX_COUNT=28
8+
CONFIG_NET_BUF_DATA_SIZE=1500
9+
410
# Select USB Configurations
511
CONFIG_USB_DEVICE_NETWORK_ECM=y
612
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CONFIG_USB_DEVICE_STACK_NEXT=y
2+
3+
# next-ncm does not work well with the static-size buffers
4+
CONFIG_NET_PKT_BUF_RX_DATA_POOL_SIZE=10000
5+
CONFIG_NET_PKT_BUF_TX_DATA_POOL_SIZE=10000
6+
CONFIG_NET_BUF_VARIABLE_DATA_SIZE=y
7+
8+
CONFIG_LOG=y
9+
CONFIG_USBD_LOG_LEVEL_WRN=y
10+
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y

samples/net/zperf/overlay-usbd_next_ecm.conf

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

samples/net/zperf/sample.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,18 @@ tests:
4848
- native_posix/native/64
4949
sample.net.zperf.device_next_ecm:
5050
harness: net
51-
extra_args: OVERLAY_CONFIG="overlay-usbd_next_ecm.conf"
51+
extra_args: OVERLAY_CONFIG="overlay-usbd_next.conf"
5252
DTC_OVERLAY_FILE="usbd_next_ecm.overlay"
5353
platform_allow: nrf52840dk/nrf52840 frdm_k64f
5454
tags: usb net zperf
5555
depends_on: usb_device
56+
sample.net.zperf.device_next_ncm:
57+
harness: net
58+
extra_args: OVERLAY_CONFIG="overlay-usbd_next.conf"
59+
DTC_OVERLAY_FILE="usbd_next_ncm.overlay"
60+
platform_allow: nrf52840dk/nrf52840 frdm_k64f
61+
tags: usb net zperf
62+
depends_on: usb_device
5663
sample.net.zperf.netusb_eem:
5764
harness: net
5865
extra_args: OVERLAY_CONFIG="overlay-netusb.conf"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2024 Hardy Griech
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
cdc_ncm_eth0: cdc_ncm_eth0 {
9+
compatible = "zephyr,cdc-ncm-ethernet";
10+
remote-mac-address = "00005E005301";
11+
};
12+
};

samples/subsys/usb/common/sample_usbd_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static void sample_fix_code_triple(struct usbd_context *uds_ctx,
7272
/* Always use class code information from Interface Descriptors */
7373
if (IS_ENABLED(CONFIG_USBD_CDC_ACM_CLASS) ||
7474
IS_ENABLED(CONFIG_USBD_CDC_ECM_CLASS) ||
75+
IS_ENABLED(CONFIG_USBD_CDC_NCM_CLASS) ||
7576
IS_ENABLED(CONFIG_USBD_AUDIO2_CLASS)) {
7677
/*
7778
* Class with multiple interfaces have an Interface

0 commit comments

Comments
 (0)