|
From: | Julio Cesar Aguilar Zerpa |
Subject: | [lwip-users] ERR_MEM after write [LwIP 1.4] |
Date: | Fri, 2 Jun 2017 12:33:27 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
Hi there, [using LwIP 1.4 - RAW API] I'm sending data every 50ms with the following function. As you
can see: I check the value of tcp_sndbuf(tpcb) and it is always
greater than buffer_size -> even after a while when the server
cannot send data anymore and I get the error ERR_MEM. static void tcpServer_sendRawScanBuffer(struct tcp_pcb *tpcb) Below is the memory allocation of my board regarding the lwip
parameters. I don't know how to interprete these values, so I also
added the definitions of the memory parameters from the
lwipopts.h. Maybe you guys know how to read these numbers :-) BTW,
I am sending 2226 bytes every 50 ms. ram_heap = 51.220 (bytes) TCP_PCB_base = 612 TCP_PCB_LISTEN_base = 228 TCP_SEG_base = 644 SYS_TIMEOUT_base = 204 PBUF_base = 260 PBUF_POOL_base = 147k (!!!!) // lwipopts.h #define MEM_SIZE (50 * 1024) /* 50K
-> MAX RAM is 512k */ #define TCP_MSS 2226 I have reduced and increased the different MEMP_NUM_* values as well as MEM_SIZE and PBUF_POOL_SIZE without success. I've attached a screenshot from wireshark, where I also don't
know what happends. The board (with LwIP) has IP ending with 46
and the client (Laptop Ubuntu) has IP ending with 43. The 2226 bytes are sent in 2 packages: 1514 + 820 including the
headers for both packages. Just before the problem occurs, the
board sends the first 1514 bytes and immediately afterwards it
tries to restransmitt the same message whithout waiting for any
kind of response from the client. Then the client sends an ACK,
which I think it's for the first package because the board tries
to send the first pacakge again (3rd time) after no ACK for the
second package came, and then the second part (820) is sent. But
after this point nothing else is being transmitted. Maybe you guys
can find an explanation here. I don't know what to check, how to fix or how to avoid the
problem. Does anyone have any ideas? Thanks and Best Regards, Julio |
wireshark.png
Description: PNG image
[Prev in Thread] | Current Thread | [Next in Thread] |