Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we have complete RNDIS stack available for STM32 controller in zephyr ? #44573

Closed
enthunilu opened this issue Apr 6, 2022 · 7 comments
Closed
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@enthunilu
Copy link

Describe the bug
Hi, this is not a bug. I could not find correct option to post this question. So, logging ticket under bug category.

I am looking for integration of RNDIS for my STM32 controller. And I saw RNDIS USB class function available under zephyr subsystem
https://github.com/zephyrproject-rtos/zephyr/tree/main/subsys/usb/device/class/netusb

I am new to this. So, not sure how to understand it and check complete support of RNDIS.
So, I wanted to know does zephyr supports complete stack for RNDIS ?
If yes, where can I get documentation for the same ?
Also, do we have any test environment available to ensure functionality on zephyr ?

My system:
Board: STM32 dev board
Machine: Windows 10

Thanks in advance!!

@enthunilu enthunilu added the bug The issue is a bug, or the PR is fixing a bug label Apr 6, 2022
@carlescufi
Copy link
Member

RNDIS is supported over USB in Zephyr: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/usb/device/class/netusb/function_rndis.c. This is vendor-independent code so as long as STM32 supports USB (it does) then this should work as well.

@enthunilu
Copy link
Author

Hello @carlescufi thanks for your support.
If possible can you please share example code or documentation for USB RNDIS?
I am new to this, so wanted to understand how I can use it.

Thanks!!

@carlescufi
Copy link
Member

Hello @carlescufi thanks for your support. If possible can you please share example code or documentation for USB RNDIS? I am new to this, so wanted to understand how I can use it.

Thanks!!

I am sorry, I do not really have any insight there. Perhaps @finikorg knows?

@finikorg
Copy link
Collaborator

finikorg commented Jun 30, 2022

Hello @carlescufi thanks for your support. If possible can you please share example code or documentation for USB RNDIS? I am new to this, so wanted to understand how I can use it.
Thanks!!

I am sorry, I do not really have any insight there. Perhaps @finikorg knows?

Basically @enthunilu, you can take some networking sample and setup netusb, it can be done with overlay file like: https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/net/sockets/dumb_http_server/overlay-netusb.conf

# USB Device settings
CONFIG_USB_DEVICE_STACK=y
# Select USB Configurations
CONFIG_USB_DEVICE_NETWORK_ECM=y
# Logging
CONFIG_USB_DRIVER_LOG_LEVEL_INF=y
CONFIG_USB_DEVICE_LOG_LEVEL_INF=y

There is also one configuration for RNDIS left for zperf here:

sample.net.zperf.netusb_rndis:
extra_args: OVERLAY_CONFIG="overlay-netusb.conf"
extra_configs:
- CONFIG_USB_DEVICE_NETWORK_ECM=n
- CONFIG_USB_DEVICE_NETWORK_RNDIS=y
tags: usb net zperf
depends_on: usb_device

@enthunilu
Copy link
Author

Thank you @carlescufi and @finikorg. This is a great help to start with.

:-)

@enthunilu
Copy link
Author

enthunilu commented Jul 22, 2022

Just wanted to share I am able to test usb-rndis functionality by using below example code and
https://github.com/zephyrproject-rtos/zephyr/tree/f9739ab41dde9c56e3bc038fe0bebf65b5ac1cfa/samples/net/sockets/dumb_http_server

with some minor changes in code.

Thanks again @finikorg for sharing inputs.

@roygedge
Copy link

roygedge commented Nov 8, 2023

Hey!
I'm experiencing the same difficulties with stm32f411e_disco , I'm trying to compile the echo_server sample with the netusb overlay, however it throws me linking errors such as:

/home/c456913/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd:zephyr/subsys/usb/device/class/netusb/libsubsys__usb__device__class__netusb.a(function_ecm.c.obj): in functionecm_read_cb':
/home/c456913/zephyrproject/zephyr/subsys/usb/device/class/netusb/function_ecm.c:295:undefined reference tonet_pkt_rx_alloc_with_buffer'
/home/c456913/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd:/home/c456913/zephyrproject/zephyr/subsys/usb/device/class/netusb/function_ecm.c:302: undefined reference tonet_pkt_write'
/home/c456913/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/c456913/zephyrproject/zephyr/subsys/usb/device/class/netusb/function_ecm.c:304: undefined reference to net_pkt_unref' /home/c456913/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/usb/device/class/netusb/libsubsys__usb__device__class__netusb.a(function_ecm.c.obj): in function ecm_send':
/home/c456913/zephyrproject/zephyr/subsys/usb/device/class/netusb/function_ecm.c:260: undefined reference to `net_pkt_read'

Does that mean this board doesn't support netusb and if so how can I fix that?

@zephyrproject-rtos zephyrproject-rtos locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

4 participants