FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5892 Discussions

Ethernet with NiosII on Cyclone III FPGA Board?

Altera_Forum
Honored Contributor II
3,250 Views

I would like to use the ethernet on the cyclone 3c120 fpga development board with NiosII and the Niche TCP/IP stack. Anybody has done this already or knows about a quick solution? The CD of this development kit containts only a basic nios2 reference design..  

 

Thanks for help, 

Christian
0 Kudos
24 Replies
Altera_Forum
Honored Contributor II
155 Views

In fact I was too pessimistic in my previous post. Since I wrote this, Altera made an update to their example design, that you can download from here (http://www.altera.com/products/devkits/altera/kit-cyc3.html). Version 9.0.2 now includes a standard design with Ethernet.

0 Kudos
Altera_Forum
Honored Contributor II
155 Views

i have been researching how to hookup the TSE core to a NIOS processor for a while now. through your link to the 9.0.2 version ( i had the 7.2 version) i finally found the solution! all along, i just needed to use a Scatter-Gather DMA Controller to connect the streaming sources to the NIOS. 

 

unfortunately, now i have to figure out how to send and recieve UDP messages... haha. Thanks for the Information Daixiwen.
0 Kudos
Altera_Forum
Honored Contributor II
155 Views

Hello Dai - 

 

I did get the linux build/hjardware you sent me a link to (the one without the LCD nios) up and running the SSS example - now I am trying to get UDP running on it. I replaced SSSSimpleSocketServer() with the following... The results is that I get nothing when sending a udp packet to the board. The code is stalled in the recvfrom and it is waiting... I am using UDP tester to send to port 1024 and verifying that it is on the wire with packetmon...  

 

Any help would be most appreciated... 

Thanks - Chris 

 

 

void ssssimplesocketservertask() 

 

struct sockaddr_in serverAddr; 

int udpsock, status=0, bytes_sent=0; 

alt_u8 buf[MAX_UDP_LENGTH], id_packet=0; 

 

int fromlen; 

 

//----------- Socket Configuration -------------- 

serverAddr.sin_family = AF_INET; 

serverAddr.sin_port = htons(UDP_PORT); 

serverAddr.sin_addr.s_addr = INADDR_ANY; 

 

fromlen = sizeof (serverAddr); 

if ((udpsock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { // protocol <IPPROTO_UDP> 

alt_NetworkErrorHandler(EXPANDED_DIAGNOSIS_CODE,"[sss_task] Socket creation failed"); 

 

//----------- system init goes here -------------- 

 

//---------------------------------------------- 

//------------- Main loop for task --------------- 

//---------------------------------------------- 

 

while(1){ 

 

printf("listening to UDP port...\n"); 

printf("serverAddr.sin_family = %08x\n", serverAddr.sin_family); 

printf("serverAddr.sin_port =%08x\n", serverAddr.sin_port); 

printf("serverAddr.sin_addr.s_addr =%08x\n", serverAddr.sin_addr.s_addr); 

printf("serverAddr =%08x\n", serverAddr); 

if((recvfrom(udpsock, buf, 10, 0,(struct sockaddr*)&serverAddr, &fromlen)) <0 ) 

alt_NetworkErrorHandler(EXPANDED_DIAGNOSIS_CODE,"[sss_task] rx UDP error"); 

 

else 

printf("we got here\n"); 

 

&#12288; 

printf("datagram : %s", buf); 

0 Kudos
Altera_Forum
Honored Contributor II
155 Views

OK - that was dumb - I wasn't binding the socket - so now I have UDP traffic. The next question I have I'll start a new thread for as it's relating to the TSE with the dual SGDMA modules...

0 Kudos
Reply