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.

CCS/TMS570LS3137: UDP program issue

Part Number: TMS570LS3137

Tool/software: Code Composer Studio

Hi,

  I'm currently working on TMS570LS3137 hercules board, in this creating a communication to send and receive data through ethernet. For this i'm using the UDP protocol. Below is the program i'm using now(took refernce from ti). Before debugging i discommunicated my ethernet cable from the server and i assigned the static IP address and subnet mask and disabled DHCP. After debugging, in i'm viewing the data using the wireshark, in that data not getting and it shows someother data.

Program-

 

extern void EMAC_LwIP_Main (uint8_t * emacAddress);
/* USER CODE END */

extern err_t hdkif_output(struct netif *netif, struct pbuf *p);
extern err_t etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr);
extern err_t hdkif_init(struct netif *netif);

/* USER CODE END */

uint8 emacAddress[6U] = {0x00U, 0x08U, 0xEEU, 0x03U, 0xA6U, 0x6CU};
uint32 emacPhyAddress = 1U;

void main(void)
{
/* USER CODE BEGIN (3) */
sciInit();
EMAC_LwIP_Main(emacAddress);

//lwIPInit(0, emacAddress, 0x0AA91010, 0xFFFFFF00, 0, IPADDR_USE_STATIC);
struct udp_pcb *pcb;
err_t error;
struct pbuf *p;
struct netif hdkNetIF;
uint8 data[60],i=0;
for(i=0;i<60;i++)
data[i]=0xAA;

p = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);

p->next=0;
p->len=60;
p->tot_len=60;
p->payload = (void *)data;

struct ip_addr ip_des;
struct ip_addr ip_src;
struct ip_addr net_mask;
struct ip_addr gw_addr;


ip_src.addr = 0xC0A80C7D; //board ip
ip_des.addr = 0xC0A80C7F; //pc ip 
net_mask.addr=0xFFFFFF00;
gw_addr.addr=0;

unsigned int InstNum=0;
pcb = udp_new();
//(void)netif_add(&hdkNetIF, ip_src, net_mask, gw_addr, &InstNum ,hdkif_init, ip_input);
while(1){
error = udp_bind(pcb,&ip_src,0);
error = udp_connect(pcb,&ip_des,1900);
error = udp_send(pcb,p);
error = udp_send(pcb,p);
}


}