cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767 Ethernet at different rate

Al3
Associate II

Hi everyone. I'm using stm32f767zi board with lwip stack and I need to transmit at different rate through Ethernet: 50mbit/s, 80mbit/s and 100mbit/s. When I tried to send a buffer of 6554 byte every 1ms (in order to send 6553600 byte aka 50mbit every second) lwip give me memory error: I tried to change some of its parameters but the maximum rate I got was 27mbit/s. So anyone can help me and give me some tips to solve this problem

14 REPLIES 14
Pavel A.
Evangelist III

 I attached the point of tcp_write function in tcp_out.c file where I get the error

Unlikely error at that point is directly linked to available descriptors. But I'd try to let LwIP  map and queue all segments of a large TCP packet at once, so sending it can run in background.

 

Sorry Pavel I don't understand what do you mean

Pavel A.
Evangelist III

I mean that this error does not look directly related to TX descriptors. Find why tcp_pbuf_prealloc fails. The memory area for LwIP pool in ST examples is defined in weird and dangerous way, make sure it does not conflict with other memory.

I tried with 32 TX descriptors and 32 RX descriptors and with the lwip configuration that I attached to this message. The max rate I got was 42,5 Mbit/s (measured through Wireshark) (I send 10486 bytes every 1ms), I also tried with other configurations of lwip parameters up to MEM_SIZE: 100*1024 bytes, TCP_SND_BUF: 70*1460, TCP_SND_QUEUELEN: 1120, TCP_WND: 70*1460, MEMP_NUM_PBUF: 64, PBUF_POOL_SIZE: 80, PBUF_POOL_BUFSIZE but the rate is fixed at 42,5 Mbit/s. I don't know what to do.

Pavel A.
Evangelist III

> 42,5 Mbit/s (measured through Wireshark) 

Not bad at all, considering the TCP overhead! 100 Mbit/s is the physical limit for STM32F7. 

I don't know what to do.

If you can get it running at that rate stable for hours - great. Measure inter-packet gaps with wireshark, try to understand where the time is spent.