cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet TCP Multi server/client memory dependacy

sarun
Associate III

My work

I have been experimenting with ethernet with tcp server, and i got some good referance to start the basic level of communication from the follwoing pages.

  1. https://controllerstech.com/stm32-ethernet-4-tcp-server/
  2. https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308

What i have done

  • Based on this iam experimenting on server, on the controller iam able to do the communication with 9 server @100ms with 100bytes of data. 
  • For the server side when client sends some data server return 100 bytes of data
  • For client side iam using winscok on visual studio, here iam initilizing same number of clients as in the server and transmitting data at 100ms (100 bytes)
  • Observed packets through waveshark and there is no packet corruption
  • From the above referances some of the modification i have done is initilizing multiple instacnes at a time and pbuf and payload memory allocation at the time of connection accept, berfore it was done  when data is being transmitted.

What i want to do

Planning to push it to maximum number of server that i can do communication simultaneously (upto 50).

Issue i faced

When increasing the number of instance intitilized, during communication controller will either run into hardfault or on the client side transmission will fail, from this i have learnt it is because of wrong memory configuration.

Currently my configuration is able to run on a maximum number of 9 clients at a time.

Assist i need

Still it is unclear to me what are the paramter that will have an impact on number of instances, especially on the memory configuration side

Update

Iam able to run the 50 server simultaneously, for optimizing memmory i want to understand the exact memory configuration required.

My Findings and configurations

Correct me if iam wrong, each instance requires there own tx and rx descriptors for simultaneous communication minimum 96 bytes for each.

Pbuf is for handling all the incoming and outgoing data which highly depends on the number of bytes incoming

Rx pool i dont have a clear differenciation on this with Pbuf,

 

The configurations are based on the referance from the above link, and i have modified some parameters which thought necessary for increasing the number of instancs.

sarun_0-1721100848481.pngsarun_1-1721100892615.png

 

sarun_2-1721100953784.pngsarun_3-1721100972143.png

sarun_4-1721101018129.png

MPU configuration

sarun_5-1721101082484.png

Linker configuration

RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K

.lwip_sec (NOLOAD) :

{
. = ABSOLUTE(0x30000000);

*(.RxDecripSection)

. = ABSOLUTE(0x30001400);

*(.TxDecripSection)

. = ABSOLUTE(0x30002800);

*(.Rx_PoolSection)

} >RAM_D2

I want to have have a clear understanding of the memory configuration parameters, if you have any answer/referarances I would appreciate your assistance.

0 REPLIES 0