Skip to content

Commit 3d9c25c

Browse files
committed
adopt zperf example
1 parent ecfec34 commit 3d9c25c

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

doc/connectivity/usb/device_next/usb_device.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,7 @@ Zephyr network support.
5353

5454
See :zephyr:code-sample:`zperf` for reference.
5555
To build the sample for the new device support, set the configuration overlay file
56-
``-DDEXTRA_CONF_FILE=overlay-usbd_next_ecm.conf`` and devicetree overlay file
57-
``-DDTC_OVERLAY_FILE="usbd_next_ecm.overlay`` either directly or via ``west``.
56+
``-DDEXTRA_CONF_FILE=overlay-usbd_next.conf`` and devicetree overlay file
57+
``-DDTC_OVERLAY_FILE="usbd_next_ecm.overlay`` for ECM either directly or via ``west``.
58+
To build with NCM, set the configuration overlay file as above and the devicetree overlay
59+
file to ``-DDTC_OVERLAY_FILE="usbd_next_ncm.overlay``.
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/prj.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ CONFIG_NET_UDP=y
88
CONFIG_NET_TCP=y
99
CONFIG_NET_STATISTICS=y
1010

11-
CONFIG_NET_PKT_RX_COUNT=14
12-
CONFIG_NET_PKT_TX_COUNT=14
13-
CONFIG_NET_BUF_RX_COUNT=28
14-
CONFIG_NET_BUF_TX_COUNT=28
15-
CONFIG_NET_BUF_DATA_SIZE=1500
1611
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4
1712
CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5
1813
CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1

samples/net/zperf/sample.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ 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
5656
sample.net.zperf.device_next_ncm:
5757
harness: net
58-
extra_args: OVERLAY_CONFIG="overlay-usbd_next_ecm.conf"
58+
extra_args: OVERLAY_CONFIG="overlay-usbd_next.conf"
5959
DTC_OVERLAY_FILE="usbd_next_ncm.overlay"
6060
platform_allow: nrf52840dk/nrf52840 frdm_k64f
6161
tags: usb net zperf

0 commit comments

Comments
 (0)