cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h563 Azure Netx Multihome Support

Eakyo.1
Associate III

Hello,

I have created and executed a TCP server project with Azure NetX library using Ethernet. Additionally, I need multihome support in this project. I want multiple clients to connect to a device with a static IP. Can you assist me with this?

Best regards,

Eren Akyol

4 REPLIES 4
Eakyo.1
Associate III

status = _nx_ip_interface_attach(&ip_0, "port_2", IP_ADDRESS(0, 0, 0,0), 0xFFFFFF00UL, my_netx_driver);

Function is not working. You can look at the Chapter 2 - Installation and use of Azure RTOS NetX DHCP Client | Microsoft Learn .  

 

STea
ST Employee

Hello @Eakyo.1 ,

try to implement it with the following API call to accept an incoming client connection:

 

NX_TCP_SOCKET client_socket;
nx_tcp_server_socket_accept(&server_socket, &client_socket, NX_WAIT_FOREVER);

 

then you should create a new thread to handle the client connection with :

 

tx_thread_create(.....);

 

 

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

First of all, thank you for your feedback.

The extension I shared is the tcp server echo example. The structure you mentioned is already used in this example, but this example does not work with multiple clients connected to a single ip address. It works only depending on one client. I need to connect multiple clients. 

 

https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/main/Projects/NUCLEO-H723ZG/Applications/NetXDuo/Nx_TCP_Echo_Server/NetXDuo/App/app_netxduo.c

Hello @Eakyo.1 ,

from my understanding you need to implement a server with the capability of accepting connection from multiple client on the same STATIC IP_ADDRESS is that your use case because if it is the case i think that  the NetxDuo API support the implementation of such usecase this can be done by accepting a client then upon accepting create a thread to deal with that client .

 this is the quote from the NETX documentation listing the steps :

NetX Duo supports systems connected to multiple physical devices using a single IP instance. Each physical interface is assigned to an interface control block in the IP instance. Applications wishing to use a multihome system must define the value for NX_MAX_PHSYCIAL_INTERFACES to the number of physical devices attached to the system, and rebuild NetX Duo library. By default NX_MAX_PHYSICAL_INTERFACES is set to one, creating one interface control block in the IP instance.

The NetX Duo application creates a single IP instance for the primary device using the nx_ip_create service. For each additional network devices, the application attaches the device to the IP instance using the nx_ip_interface_attach service.

Each network interface structure contains a subset of network information about the network interface that is contained in the IP control block, including interface IPv4 address, subnet mask, IP MTU size, and MAC-layer address information.

for further detail refer to the official documentation in this link .

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.