hi, I am newbie lwip.
I want to send data of size 0xA000, so I modify lwip echo server example(echo.c ).
as follows
/********************************************************************************************/
err_t recv_callback(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)
{
/* do not read the packet if we are not in ESTABLISHED state */
if (!p) {
tcp_close(tpcb);
tcp_recv(tpcb, NULL);
return ERR_OK;
}
/* indicate that the packet has been received */
tcp_recved(tpcb, p->len);
/* echo back the payload */
/* in this case, we assume that the payload is < TCP_SND_BUF */
if (tcp_sndbuf(tpcb) > p->len) {
//err = tcp_write(tpcb, p->payload, p->len, 1);
err = tcp_write(tpcb, mem_ptr, 0xA000, 1);
} else
xil_printf("no space in tcp_sndbuf\n\r");
/* free the received pbuf */
pbuf_free(p);
return ERR_OK;
}
/********************************************************************************************/
under 0x500 size, it is well done.
but over the size, called interrupt handler(synchronous abort). lwip don't send anytings.
when I using tcp_debug option, I can see that it stopped in p_buf allocation message.
I think the size of P_buf memory is a problem, how can I fix it?
I was trying to change lwip parameter(tcp_wnd, tcp_snd_buf, tcp_mss, etc), But it was not working.
thank you.