Skip to content

samples: zperf: Add initialization for the new device support to the sample main() #71589

@rgrr

Description

@rgrr

Notes
Trying to create an NCM driver for the new USB stack, using zperf with ECM as a starting point, see #71451

Describe the bug
Using the zperf example and selecting the configuration with CONFIG_USB_DEVICE_STACK_NEXT=y. west command line:

west build --build-dir _build . --pristine --board nrf52840dk_nrf52840 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=. -DCACHED_CONF_FILE=prj.conf -DEXTRA_CONF_FILE=overlay-usbd_next_ecm.conf -DDTC_OVERLAY_FILE=usbd_next_ecm.overlay

After flashing the target gives the following log output:

[07:31:33.906677 4.616036] [00:00:00.375,213] <inf> cdc_ecm: USB configuration is not enabled
[07:31:33.908408 0.001732] *** Booting nRF Connect SDK v3.5.99-ncs1 ***
[07:31:33.909375 0.000968] [00:00:00.375,762] <inf> net_config: Initializing network
[07:31:33.910767 0.001392] [00:00:00.375,762] <inf> net_config: Waiting interface 1 (0x20000fc4) to be up...
[07:32:04.217535 30.306766] [00:00:30.376,464] <inf> net_config: IPv4 address: 192.0.2.1
[07:32:04.219149 0.001616] [00:00:30.376,617] <err> net_if: Cannot join all nodes address ff02::1 (-115)
[07:32:04.220967 0.001819] [00:00:30.376,708] <err> net_if: Cannot join solicit node address ff02::1:ff00:1 (-115)
[07:32:04.222995 0.002028] [00:00:30.376,770] <err> net_config: Timeout while waiting network interface
[07:32:04.224818 0.001821] [00:00:30.376,800] <err> net_config: Network initialization failed (-115)

It seems that the interface is not coming up automatically. BTW: to me the start sequence is not clear at all ;-)

USB is not starting at all, meaning that the host computer does not see a (new) USB device. (before you ask: with the old USB stack everything is working fine).

To Reproduce
see above

Expected behavior
I'ld expect that USB starts up, the interface is becoming available and the target device provides some IP functionality.

Impact
annoying...

Logs and console output
see above, log output with more debug looks like this:

[07:58:39.485060 233.332755] [00:00:00.375,976] <inf> udc_nrf: Preinit
[07:58:39.486638 0.001581] [00:00:00.376,220] <dbg> cdc_ecm: usbd_cdc_ecm_preinit: CDC ECM device initialized
[07:58:39.489086 0.002447] [00:00:00.376,373] <dbg> usbd_core: usbd_pre_init: Available USB class nodes:
[07:58:39.491341 0.002256] [00:00:00.376,403] <dbg> usbd_core: usbd_pre_init:   0x200010f4, name cdc_ecm_0
[07:58:39.493618 0.002277] [00:00:00.376,892] <dbg> cdc_ecm: cdc_ecm_iface_init: CDC ECM interface initialized
[07:58:39.496037 0.002418] [00:00:00.377,258] <dbg> cdc_ecm: cdc_ecm_iface_start: Start interface 0x20000fc4
[07:58:39.498418 0.002382] [00:00:00.377,258] <inf> cdc_ecm: USB configuration is not enabled
[07:58:39.500394 0.001975] *** Booting nRF Connect SDK v3.5.99-ncs1 ***
[07:58:39.501460 0.001067] [00:00:00.377,746] <inf> net_config: Initializing network
[07:58:39.503279 0.001818] [00:00:00.377,746] <inf> net_config: Waiting interface 1 (0x20000fc4) to be up...
[07:59:10.477751 30.974470] [00:00:30.378,448] <inf> net_config: IPv4 address: 192.0.2.1
[07:59:10.479521 0.001774] [00:00:30.378,601] <err> net_if: Cannot join all nodes address ff02::1 (-115)
[07:59:10.481432 0.001910] [00:00:30.378,692] <err> net_if: Cannot join solicit node address ff02::1:ff00:1 (-115)
[07:59:10.483506 0.002074] [00:00:30.378,753] <err> net_config: Timeout while waiting network interface
[07:59:10.485389 0.001884] [00:00:30.378,784] <err> net_config: Network initialization failed (-115)

Environment (please complete the following information):

  • Linux, Debian testing
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /mnt/d/u/src/ncs/zperf_checko
    -- CMake version: 3.21.0
    -- Found Python3: /home/hardy/ncs/toolchains/2be090971e/usr/local/bin/python3.9 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: /home/hardy/.cache/zephyr
    -- Zephyr version: 3.5.99 (/home/hardy/ncs/v2.6.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52840
    -- Found host-tools: zephyr 0.16.5 (/home/hardy/ncs/toolchains/2be090971e/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (/home/hardy/ncs/toolchains/2be090971e/opt/zephyr-sdk)

Additional context
set CONFIG_NET_SOCKETS_POLL_MAX=10 to make network startup. Otherwise log shows

[07:49:46.671932 0.001648] *** Booting nRF Connect SDK v3.5.99-ncs1 ***
[07:49:46.672882 0.000950] [00:00:00.374,908] <inf> net_config: Initializing network
[07:49:46.674242 0.001360] [00:00:00.374,908] <inf> net_config: Waiting interface 1 (0x20000fc4) to be up...
[07:49:46.921153 0.246910] [00:00:00.376,190] <err> net_sock_svc: You have 9 services to monitor but 5 poll entries configured.
[07:49:46.923561 0.002410] [00:00:00.376,251] <err> net_sock_svc: Please increase value of CONFIG_NET_SOCKETS_POLL_MAX to at least 9

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresExperimentalExperimental features not enabled by defaultarea: USBUniversal Serial Bus

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions