Hai xiangjun.rong.,
Since one week I stuck on this issue, i would expecting a response from your side.
The UDP_echo example is working perfectly. I removed the echo init function so that I can stop UDP echo functionalities.
Now I am trying to send some data from board
/*******************************************************************************************************/
u8_t temp[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
pcb = udp_new();
if (pcb == NULL) {
LWIP_DEBUGF(UDP_DEBUG, ("udp_new failed!\n"));
}
if (udp_bind(pcb, IP_ADDR_ANY, 0x0007) != ERR_OK) {
LWIP_DEBUGF(UDP_DEBUG, ("udp_bind failed!\n"));
}
p = pbuf_alloc (PBUF_TRANSPORT, 8, PBUF_RAM);
p->flags = 0; p->len = 20; p->next = NULL ; p->payload = temp; p->ref = 0x01; p->tot_len = 20; p->type = 0x03;
IP4_ADDR(&ipaddr, 192,168,16,100);
err = udp_sendto(pcb, p, &ipaddr, 0xd710);
pbuf_free(p);
/**********************************************************************************************************/
The UDP packet is sending . But after returning from "udp_sendto" function its going to Hard fault handler.
Can you please point out me where I did mistake.
Thank you .,
Best Regards.,
karthik.