Hello,
I am quite new in lwip. I setup a TCP server within lwip 141 and got an error while sending data through tcp_write function :
tcp_write : could not allocate memory for pbuf copy size 1092
I checked all the parameters which seems relevant for me (see below) but now I've got no idea why lwip could not allocate 1092 bytes on a pbuf.
Here is how I send my data without using zero copy mechanism :
if (tcp_sndbuf(tpcb) > byte_size) {
err = tcp_write(tpcb, pt_send_buf, byte_size, TCP_WRITE_FLAG_COPY);
}
Some informations on my configuration :
- #define PBUF_POOL_SIZE 256
- #define PBUF_POOL_BUFSIZE 1700
- #define TCP_MSS 1460
- #define TCP_SND_BUF 8192
- #define MEMP_NUM_PBUF 32
- The following line indicates me that the pbuf will be placed in RAM
tcp_pbuf_prealloc(layer, length, mx, os, pcb, api, fst) pbuf_alloc((layer), (length), PBUF_RAM)
Thanks for your help.
--
Dimitri