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

Netxduo is "blocked" after an error occured #188

Closed
ZerAtaii opened this issue Aug 8, 2023 · 9 comments
Closed

Netxduo is "blocked" after an error occured #188

ZerAtaii opened this issue Aug 8, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ZerAtaii
Copy link

ZerAtaii commented Aug 8, 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.
In my application, there are different communication buses, wifi / BLE / cellular network / IOT (through cellular or WIFI). When there is an error in one of the nx functions, for example in the "nx_tcp_server_socket_relisten" function, I get an error 0x23 which is NX_PORT_UNAVAILABLE. After that, it was impossible to continue exchanging through netcat on WSL, whatever the port. After a timeout of about 10 minutes, everything worked normally again.

nxerror

nc

In fact, the various communication buses are totally multi-threaded but they all seem to refer to the same instance of Netxduo since all the ports are blocked simultaneously and then unblocked at the same time.

Do you have any idea which parameter I can change to avoid this problem?

Best regards,
Antoine

@ZerAtaii ZerAtaii added the bug Something isn't working label Aug 8, 2023
@TiejunMS TiejunMS self-assigned this Aug 9, 2023
@TiejunMS
Copy link
Contributor

TiejunMS commented Aug 9, 2023

0x23 should not be returned from nx_tcp_server_socket_relisten. Is the return status 0x35 instead? If so, it could be that the TCP server is not cleaned up before relisten. Try to call following APIs before it.

nx_tcp_socket_disconnect()
nx_tcp_server_socket_unaccept()

@ZerAtaii
Copy link
Author

ZerAtaii commented Aug 9, 2023

Yes excatly you're right, with these functions, the nx_tcp_server_socket_relisten function works normaly.
But i still get this strange delay before i can reopen a port... :/

@TiejunMS
Copy link
Contributor

Do you mean 10 minutes delay by calling relisten? If not, could you describe the question again, thanks!

@ZerAtaii
Copy link
Author

ZerAtaii commented Aug 18, 2023

In fact, sometimes i'm blocked for 29/30mins (i have measured it last week) and i don't know why, but one solution to this issue is to "deactivate/reactivate" my usb driver. The functions called are ux_slave_class_cdc_ecm_instance_activate and ux_slave_class_cdc_ecm_instance_deactivate, do you know how theses functions are triggered (HW or SF) ? Is there a way to reduce this strange 30mins delay to like 30secs / 1min? Or maybe a way to trigger these functions automatically ?
Thank you !
usb_IF

@TiejunMS
Copy link
Contributor

I'm a little bit confused about the 'delay'. Where does it occur? In nx_tcp_server_socket_relisten, nx_tcp_server_socket_accept or somewhere else?

@ZerAtaii
Copy link
Author

ZerAtaii commented Aug 24, 2023

After getting "Host disconnect" from TCP socket, i tried to nx_tcp_socket_disconnect()/nx_tcp_server_socket_unaccept()/nx_tcp_server_socket_relisten() as you said and that's working (no more error). But i don't have any interrupts from clients even if i try many times before 29 mins.

@ZerAtaii
Copy link
Author

And secondly, how can i trigger ux_slave_class_cdc_ecm_instance_activate and ux_slave_class_cdc_ecm_instance_deactivate from a software point of view?

@TiejunMS
Copy link
Contributor

@xiaocq2001 , can you help with USBX questions?

@TiejunMS
Copy link
Contributor

Closing as duplicate with eclipse-threadx/usbx#114

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