Altera_Forum
Honored Contributor
19 years agohelp on development board udp conection setup
hi, all i try to use nios2 development to realize the board and pc udp cimmunication
i modify the demo provided by altera simple socket server, and after iniitialize the network, udp implementation as follows struct udp_pcb *pcb; struct pbuf* pbuflfsr; struct ip_addr udpDestIpAddr,udpLocalIpAddr; pbuf_layer layer=PBUF_TRANSPORT; pbuf_flag flag=PBUF_RAM; u16_t size=1500; IP4_ADDR(&udpDestIpAddr, 10, 0, 0, 52); IP4_ADDR(&udpLocalIpAddr, 10, 0, 0, 51); printf("udp_init\n"); udp_packets = 0; pcb = udp_new(); udp_bind(pcb, &udpLocalIpAddr, 30); udp_connect(pcb, &udpDestIpAddr,30); pbuflfsr = pbuf_alloc(layer,size,flag); for(i=0;i<=size-1;i++) { ((u8_t *)(pbuflfsr->payload)) = 0x11; } while(1) { udp_sendto(pcb, pbuflfsr, &udpDestIpAddr, 30); } after run in the development, i can see the ethernet port begin to flash, it seems that udp packets have been set however, in the pc side 10.0.0.52, there is no correct udp packets receieved please suggest the reason