snippets: add USB/IP on native simulator snippet
Snippet that helps to build USB device samples with virtual device and host controllers and USBIP support. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
parent
d22c0d2ec3
commit
481dcf7136
4 changed files with 61 additions and 0 deletions
17
snippets/usbip-native-sim/README.rst
Normal file
17
snippets/usbip-native-sim/README.rst
Normal file
|
@ -0,0 +1,17 @@
|
|||
.. _snippet-usbip-native-sim:
|
||||
|
||||
USB/IP on Native Simulator Snippet (usbip-native-sim)
|
||||
#####################################################
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
west build -S usbip-native-sim [...]
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
This snippet allows to configure USB device samples with USB/IP support on a
|
||||
native simulator. When building samples with this snippet, you need to provide
|
||||
samples DTC overlays using the EXTRA_DTC_OVERLAY_FILE argument.
|
||||
|
||||
This snippet is experimental, the behavior may change without notice.
|
4
snippets/usbip-native-sim/snippet.yml
Normal file
4
snippets/usbip-native-sim/snippet.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
name: usbip-native-sim
|
||||
append:
|
||||
EXTRA_CONF_FILE: usbip-native-sim.conf
|
||||
EXTRA_DTC_OVERLAY_FILE: usbip-native-sim.overlay
|
21
snippets/usbip-native-sim/usbip-native-sim.conf
Normal file
21
snippets/usbip-native-sim/usbip-native-sim.conf
Normal file
|
@ -0,0 +1,21 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_IPV4=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_NET_SOCKETS=y
|
||||
|
||||
# Network address config
|
||||
CONFIG_NET_CONFIG_SETTINGS=y
|
||||
CONFIG_NET_CONFIG_NEED_IPV4=y
|
||||
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1"
|
||||
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2"
|
||||
|
||||
CONFIG_NET_LOG=y
|
||||
|
||||
CONFIG_USB_HOST_STACK=y
|
||||
CONFIG_USBH_LOG_LEVEL_WRN=y
|
||||
CONFIG_UHC_DRIVER_LOG_LEVEL_WRN=y
|
||||
CONFIG_USBIP=y
|
||||
CONFIG_USBIP_LOG_LEVEL_WRN=y
|
||||
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000000
|
||||
CONFIG_UHC_BUF_COUNT=32
|
||||
CONFIG_UHC_XFER_COUNT=32
|
19
snippets/usbip-native-sim/usbip-native-sim.overlay
Normal file
19
snippets/usbip-native-sim/usbip-native-sim.overlay
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/delete-node/ &zephyr_udc0;
|
||||
|
||||
/ {
|
||||
zephyr_uhc0: uhc_vrt0 {
|
||||
compatible = "zephyr,uhc-virtual";
|
||||
|
||||
zephyr_udc0: udc_vrt0 {
|
||||
compatible = "zephyr,udc-virtual";
|
||||
num-bidir-endpoints = <8>;
|
||||
maximum-speed = "high-speed";
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue