This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: LWIP UDP sent data is corrupted

Part Number: TMS570LS3137
Other Parts Discussed in Thread: DP83640

Hello, I'm trying to send this struct via lwIP udp multicast. But as you see I see the output on wireshark like this.

 

void setHeader()
{
    Sync.header.header[0]=0     ;
    Sync.header.header[1]=0x2   ;
    Sync.header.header[2]=0     ;
    Sync.header.header[3]=0x2C  ;
    Sync.header.header[4]=0     ;
    Sync.header.header[5]=0     ;
    Sync.header.header[6]=0     ;
    Sync.header.header[7]=0     ;
    Sync.header.header[8]=0     ;
    Sync.header.header[9]=0     ;
    Sync.header.header[10]=0    ;
    Sync.header.header[11]=0    ;
    Sync.header.header[12]=0    ;
    Sync.header.header[13]=0    ;
    Sync.header.header[14]=0    ;
    Sync.header.header[15]=0    ;
    Sync.header.header[16]=0    ;
    Sync.header.header[17]=0    ;
    Sync.header.header[18]=0    ;
    Sync.header.header[19]=0    ;
    Sync.header.header[20]=0    ;
    Sync.header.header[21]=0    ;
    Sync.header.header[22]=0    ;
    Sync.header.header[23]=0    ;
    Sync.header.header[24]=0    ;
    Sync.header.header[25]=0    ;
    Sync.header.header[26]=0    ;
    Sync.header.header[27]=0    ;
    Sync.header.header[28]=0    ;
    Sync.header.header[29]=1    ;
    Sync.header.header[30]=0    ;
    Sync.header.header[31]=1    ;
    Sync.header.header[32]=0    ;
    Sync.header.header[33]=0X7f ;
}

Send function is simple as this;

void udp_send()
{
  
  struct pbuf* p_buffer;
  
  p_buffer = pbuf_alloc(PBUF_TRANSPORT, tampon_boyut_u16, PBUF_RAM);
  memcpy(p_buffer->payload, p_tampon_u8, tampon_boyut_u16);
  err_t err = udp_sendto(Gl.pcb, p_buffer, &dest_ip, dest_port);

  pbuf_free(p_buffer);
}

Payload length is correct. So only the data is getting corrupted. My main goal is send PTP-sync message with UDP.

And also another question of mine is I have TMS570LS31HDK.It has onboard DP83640 (1588 PHY) and as I said before I'm trying to send and get PTP messages between 2 HDK. So far i can get the internal clock's values via MDIO and attach them approciately to UDP payload. Should I send the data like this or do I have to use another method?

So any help will be appreciated.

Thanks in advance.