Forum Discussion
Altera_Forum
Honored Contributor
11 years agovery very unfortunately,billa and every one,my problem also exists.
so I describe my question again: my fpga is ep3c120f484 and epcs64,have not supply extern sdram by using quartus 9.0+nios 9.0 i do the project as the "readme txt",and the sopc builder system and nios libirary properties will upload in the picture. my ip and mac set: # define STATIC_IP IP4_ADDR(&lwipStaticIp,219,245,66,185) # define STATIC_NM IP4_ADDR(&lwipnetmask,255,255,255,0) # define STATIC_GW IP4_ADDR(&lwipgw,219,245,66,254) # define STATIC_DA IP4_ADDR(&destAddr,219,245,66,112) alteraTseNetif.hwaddr[0] = 0x00; alteraTseNetif.hwaddr[1] = 0x1C; alteraTseNetif.hwaddr[2] = 0x23; alteraTseNetif.hwaddr[3] = 0x17; alteraTseNetif.hwaddr[4] = 0x4A; alteraTseNetif.hwaddr[5] = 0xCB; and the udpsend: char udpdata[] = "UDP has Initialed successfully, begin to transfer!\r\n"; struct pbuf *psend; struct udp_pcb *UdpPcbS; psend = pbuf_alloc(PBUF_RAW, sizeof(udpdata), PBUF_RAM); psend->payload = (void *)udpdata; if (!psend) { printf("Can't allocate buffer.\n"); } UdpPcbS = udp_new(); if (!UdpPcbS) { printf("udp_new() failed.\n"); } udp_bind(UdpPcbS, &lwipStaticIp, 67); if (udp_bind(UdpPcbS, &lwipStaticIp, 67) != ERR_OK) { printf("udp_bind() failed.\n"); } udp_connect(UdpPcbS, &destAddr, 67); if (udp_connect(UdpPcbS, &destAddr, 67) != ERR_OK) { printf("udp_connect() failed.\n"); } while(1) { udp_send(UdpPcbS,psend); mSdelay(1000); mSdelay(1000); mSdelay(1000); } when I debug step by step,the error will be appear in the code in "ip.c" IPH_TTL_SET(iphdr, ttl); if (ip_addr_isany(src)) { ip_addr_copy(iphdr->src, netif->ip_addr); } else { (iphdr->src).addr = (*src).addr; } and return error. and it is not caused by compiler optimization. I can not receive and send any packets. Regards, zhangjie