0

i want to send large array (array[1600]) with stm32f767 and lan8720a with udp. when my array biger than 1319 byte the mcu can not send(i don't receive anything with my terminal software(UdpClientServer.exe) ) my array is full of 'A' character

'''

void MY_UdpSendData(void) {

uint16_t i=0;
uint16_t BufferSize=0;

struct pbuf *p;

while(array[i]=='A')
{
    i++;
    BufferSize++;
}

p = pbuf_alloc(PBUF_TRANSPORT, BufferSize, PBUF_RAM); 
 pbuf_take(p, array, sizeof(array[0])*BufferSize);

udp_send(udp_send_pcb, p);

pbuf_free(p);

}

//////////while(1)

while (1) {

    MX_LWIP_Process();
    
    cntr++;
    if(cntr > 200000)
    {
        cntr=0;
        MY_UdpSendData();
        
    }

}

'''

2
  • 2
    No. The generally accepted payload limit for UDP is 534 bytes. WIthin a LAN you may be able to achive 1260 or whatever will fit into an IP MTU, but you can't rely on it, and any UDP datagram that gets segmented may get lost altogether (as indeed they all may). Commented Apr 26, 2022 at 8:11
  • what should i do? I need to be able to send data over 1600 bytes with udp.... Commented Apr 27, 2022 at 4:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.