2024-07-28 02:31 AM
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
2024-07-28 07:37 AM - edited 2024-07-28 07:38 AM
> 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.
2024-07-28 07:47 AM
Sorry Pavel I don't understand what do you mean
2024-07-28 08:02 AM
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.
2024-07-28 10:17 AM
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.
2024-07-28 11:33 AM - edited 2024-07-28 11:45 AM
> 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.