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

fix(usb) compile tinyusb_net.c when RNDIS is enabled (IEC-96) #313

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

voedipus
Copy link

@voedipus voedipus commented Mar 12, 2024

Checklist

  • Component contains License
  • Component contains README.md
  • Component contains idf_component.yml file with url field defined
  • Component was added to upload job
  • Component was added to build job
  • Optional: Component contains unit tests
  • CI passing

Change description

RNDIS and ECM were not working when selected in menuconfig

@CLAassistant
Copy link

CLAassistant commented Mar 12, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title fix(usb) compile tinyusb_net.c when RNDIS is enabled fix(usb) compile tinyusb_net.c when RNDIS is enabled (IEC-96) Mar 12, 2024
@tore-espressif
Copy link
Collaborator

tore-espressif commented Mar 25, 2024

@voedipus Thank you for the PR!
Does the RNDIS configuration work with your device?

we did not test RNDIS, only NCM. That is why why enabled NCM only

@voedipus
Copy link
Author

voedipus commented Mar 25, 2024

@tore-espressif Actually, it is not working with this MR, but I was able to get RNDIS working with couple of other fixes. I will add changes soon

@voedipus
Copy link
Author

@tore-espressif It works now, checked on Linux with esp idf 5.1.3 and Windows 10 (RNDIS)

@roma-jam roma-jam self-requested a review March 26, 2024 20:29
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this PR!

I'm still not sure whether we want to claim support form ECM/RNDIS when we already support NCM. I'll check internally and let you know

Comment on lines +265 to +270
config TINYUSB_NET_MODE_RNDIS
bool "RNDIS"

config TINYUSB_NET_MODE_ECM
bool "ECM"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep it tha way it was? ECM+RNDIS together? There are 2 reasons for this:

  1. The TinyUSB driver has ECM+RNDIS protocol together
  2. We usually don't want to enable ECM and disalble RNDIS (or vice versa). RNDIS works with windows, while ECM workds with linux and macOS. Only with both we can support all operating systems

@wuyuanyi135
Copy link

@voedipus Thank you for the PR! Does the RNDIS configuration work with your device?

we did not test RNDIS, only NCM. That is why why enabled NCM only

Please do include RNDIS support. The upstream is rewriting the NCM driver and some unstablility will be expected. Also, the current NCM driver is buggy and slower than the RNDIS. If we would like to enable the USB network feature at this moment I think RNDIS is still the way to go

@lijunru-hub
Copy link

The current RNDIS driver in TinyUSB does not support FIFO buffering and lacks an effective API to notify the application layer when the previous transmission is complete. Using the more efficient tinyusb_net_send_async function often results in cases where the previous RNDIS transmission hasn't finished. On the other hand, the new NCM driver supports software buffering. I believe the RNDIS driver should also support this feature.

Furthermore, supporting RNDIS is necessary because, in network card applications, Windows 10 does not support the NCM driver.

@tore-espressif
Copy link
Collaborator

tore-espressif commented Sep 6, 2024

Furthermore, supporting RNDIS is necessary because, in network card applications, Windows 10 does not support the NCM driver.

Here's a step-by-step manual how to install NCM driver on Windows 10 , if anyone is interested

win10-native-ncm.pdf

UPDATE: We will update TinyUSB in esp-idf to v0.17 soon. This release brings refactored NCM class and DMA support. If the NCM performs well, we plan to support NCM only, due to our limited resources to maintain 2 USB networking solutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants