-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add USB CDC-ECM Host support #18815
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
Open
dlizewski
wants to merge
2
commits into
apache:master
Choose a base branch
from
dlizewski:feature/dl.usbecm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add USB CDC-ECM Host support #18815
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
boards/arm/stm32h5/nucleo-h563zi/configs/nshusbnet/defconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # | ||
| # This file is autogenerated: PLEASE DO NOT EDIT IT. | ||
| # | ||
| # You can use "make menuconfig" to make any modifications to the installed .config file. | ||
| # You can then do "make savedefconfig" to generate a new defconfig file that includes your | ||
| # modifications. | ||
| # | ||
| # CONFIG_NSH_ARGCAT is not set | ||
| # CONFIG_STANDARD_SERIAL is not set | ||
| CONFIG_ARCH="arm" | ||
| CONFIG_ARCH_BOARD="nucleo-h563zi" | ||
| CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y | ||
| CONFIG_ARCH_BUTTONS=y | ||
| CONFIG_ARCH_CHIP="stm32h5" | ||
| CONFIG_ARCH_CHIP_STM32H563ZI=y | ||
| CONFIG_ARCH_CHIP_STM32H5=y | ||
| CONFIG_ARCH_INTERRUPTSTACK=2048 | ||
| CONFIG_ARCH_STACKDUMP=y | ||
| CONFIG_ARMV8M_STACKCHECK_NONE=y | ||
| CONFIG_BOARD_LOOPSPERMSEC=9251 | ||
| CONFIG_BUILTIN=y | ||
| CONFIG_DEBUG_ASSERTIONS=y | ||
| CONFIG_DEBUG_FEATURES=y | ||
| CONFIG_DEBUG_SYMBOLS=y | ||
| CONFIG_DEBUG_USB=y | ||
| CONFIG_DEBUG_USB_ERROR=y | ||
| CONFIG_DEBUG_USB_WARN=y | ||
| CONFIG_FS_PROCFS=y | ||
| CONFIG_FS_PROCFS_REGISTER=y | ||
| CONFIG_HAVE_CXX=y | ||
| CONFIG_HAVE_CXXINITIALIZE=y | ||
| CONFIG_IDLETHREAD_STACKSIZE=2048 | ||
| CONFIG_INIT_ENTRYPOINT="nsh_main" | ||
| CONFIG_LINE_MAX=64 | ||
| CONFIG_NET=y | ||
| CONFIG_NETDB_DNSCLIENT=y | ||
| CONFIG_NETDEV_LATEINIT=y | ||
| CONFIG_NETINIT_DHCPC=y | ||
| CONFIG_NETUTILS_DHCPC=y | ||
| CONFIG_NETUTILS_TELNETD=y | ||
| CONFIG_NET_ETH_PKTSIZE=1514 | ||
| CONFIG_NET_ICMP_SOCKET=y | ||
| CONFIG_NET_PKT=y | ||
| CONFIG_NET_ROUTE=y | ||
| CONFIG_NET_TCP=y | ||
| CONFIG_NET_UDP=y | ||
| CONFIG_NSH_ARCHINIT=y | ||
| CONFIG_NSH_BUILTIN_APPS=y | ||
| CONFIG_NSH_FILEIOSIZE=512 | ||
| CONFIG_NSH_READLINE=y | ||
| CONFIG_PREALLOC_TIMERS=4 | ||
| CONFIG_RAM_SIZE=655360 | ||
| CONFIG_RAM_START=0x20000000 | ||
| CONFIG_RAW_BINARY=y | ||
| CONFIG_READLINE_CMD_HISTORY=y | ||
| CONFIG_READLINE_TABCOMPLETION=y | ||
| CONFIG_RR_INTERVAL=200 | ||
| CONFIG_SCHED_LPWORK=y | ||
| CONFIG_SCHED_WAITPID=y | ||
| CONFIG_STACK_COLORATION=y | ||
| CONFIG_STM32H5_USART3=y | ||
| CONFIG_STM32H5_USBFS_HOST=y | ||
| CONFIG_STM32H5_USE_HSE=y | ||
| CONFIG_SYSTEM_NSH=y | ||
| CONFIG_SYSTEM_PING=y | ||
| CONFIG_TASK_NAME_SIZE=0 | ||
| CONFIG_USART3_SERIAL_CONSOLE=y | ||
| CONFIG_USBHOST_CDCECM=y | ||
| CONFIG_USBHOST_COMPOSITE=y | ||
| CONFIG_USBHOST_CONFIGURATION_SELECTION=y | ||
| CONFIG_USBHOST_HUB=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a callback to usbhost_registry_s or usbhost_class_s to select
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the configuration needs to be selected before the host drivers are called.
Right now the code is:
The other approach I tried is to cycle the configs until we find a host driver that matches.
Something like:
But I ran into some problems with certain host class drivers failing the 2nd time it was iniitalized for a given device. Likely a bug that could be solved if we think that is a better approach.
The other thing to note is that I dont really need this configuration selection. I added CDC-ECM since certain modems I need support ECM. On the modems they are configuration 0.
I added this configuration selection because the CDC-ECM USB-Ethernet adapters that I have present ECM as the 2nd interface and I wanted to provide testing logs using a standard off the shelf product.
But if we can accept logs from a custom board with modems (or a build where I temporarily hard-code it to 1 instead of 0) then I could revert the configuration selection portion until it is actually needed.