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

Automatically activate/deactivate CDC ECM #114

Open
ZerAtaii opened this issue Sep 4, 2023 · 2 comments
Open

Automatically activate/deactivate CDC ECM #114

ZerAtaii opened this issue Sep 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ZerAtaii
Copy link

ZerAtaii commented Sep 4, 2023

  • What target device are you using?
    LPC55S69
  • Which version of Azure RTOS?
    6.1
  • What toolchain and environment?
    arm-none-eabi-* + WSL

Hi,
I use Azure RTOS with the netxduo layer to manage TCP/IP sockets. The application exchanges a set of commands through netcat via "Windows sub Linux" on different ports (32071 to 32076) with an ethernet over USB protocol (CDC ECM). In my application, there are different communication buses, wifi / BLE / cellular network / IOT (through cellular or WIFI). When there is an error in one, the whole system is "blocked" (no more inputs from USB but the system is still running). After a delay of 29mins, 2 functions are triggered (ux_slave_class_cdc_ecm_instance_activate and ux_slave_class_cdc_ecm_instance_deactivate) and everything works fine after this. Do you know how to automatically trigger these functions after a few minutes without communication?

usb_IF

Best regards,
Antoine

@ZerAtaii ZerAtaii added the bug Something isn't working label Sep 4, 2023
@xiaocq2001
Copy link
Contributor

I guess ux_slave_class_cdc_ecm_instance_activate and ux_slave_class_cdc_ecm_instance_deactivate is triggered by a USB bus reset from host side, maybe you can consider adjust some timeout setting on your host side?

On device side, there is usually some way in device controller hardware that can "detach" from host, there is no API for detaching, but you can try to operate the hardware to "detach" and "attach" again to let host re-enumerate your device.

@ZerAtaii
Copy link
Author

ZerAtaii commented Sep 7, 2023

For this project, the USB host is a Windows PC running WSL. I send a curl command and after a while the download speed drops to 0. From then on, I'm no longer able to communicate via the USB connection. The 2 CDC functions allow me to reinstantiate the whole chain and solve the problem.
I don't think we can blame the USB host when it's just a simple PC?
I could manually trigger the functions, but how do i know when i'm actually dealing with the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants