How to receive a 4k UDP packet when my MTU is 1500, using fragmented IP packets?
Hey,
I Have STM32H743Zi
I'm new at this, so please forgive me if I'm unclear.
I'm trying to receive 4k UDP packets but I'm getting only 1k each time.
I did a Google search and understand that if I want to receive a UDP packet of 4k I need to use fragmentation due to the MTU being 1500.
I tried to enable the below parameters:
IP_REASSEMBLY - enabled
MEMP_NUM_REASSDATA - 5
IP_REASS_MAX_PBUFS - 10
MEMP_NUM_FRAG_PBUF - 4
inside my callback function, I'm trying to read all the 4k data, I'm getting 1k in the first node but the next node in the pbuf is always NULL.
I also see on Wirshak messages with 1k
while I'm sending using Hrecules 4k for sure.
this is the callback function code:
void UDP_TX_RECEIVE_CALLBACK(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
{
char TxUdpPacket[SPI_PACKET_SIZE] = {0, };
// Process each received fragment
while (p != NULL)
{
// Copy fragment data to appropriate position in udpPacket array
memcpy(&TxUdpPacket[p->tot_len - p->len], p->payload, p->len);
// Move to the next fragment
struct pbuf *next = p->next;
pbuf_free(p);
p = next;
}
}
pls, help!!
thank you :)
