I'm using nucleo f429zi with LWIP v 2.1.2. Documentation states that for TX buffer PBUF_RAM should be used. In my case whole LWIP stack freeze after 28 send messages. When I change pbuf type to PBUF_POOL, everything works like a charm. Although in the docs it written that this type should be used for RX buffer.
Here is my implementation of udp callback function
void
udp_descserver_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) {
uint8_t triesNumber = 0;
err_t error;
udp_connect(upcb, addr, port);
pbuf_free(p);
p = NULL;
p = pbuf_alloc(PBUF_TRANSPORT, sizeof(PING_INFO), PBUF_POOL);
if(p != NULL) {
pbuf_take(p, &pingInfo, sizeof(PING_INFO));
do {
error = udp_send(upcb, p);
triesNumber++;
} while (error && triesNumber < RESEND_TRIES);
}
pbuf_free(p);
udp_disconnect(upcb);
}
My question is, why the method which is contrary to docs works.
question from:
https://stackoverflow.com/questions/65889467/stm32f4-lwip-freezes-after-fixed-send-number 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…