Ethernet Products
Determine ramifications of Intel® Ethernet products and technologies
4864 Discussions

Converting example from using TCP/IP to UDP

Altera_Forum
Honored Contributor II
3,171 Views

I adapted the example "Nios II Ethernet Simple Socket Server 

on MAX 10 FPGA Development Kit" to send data from a MAX 10 board 

to a PC with Matlab. The datarate I get is about 5 Mbyte/s 

with TCP/IP.  

 

Is is simple to change the code to use the faster UDP in stead 

of TCP/IP? This was suggested by reading that TCP/IP uses 

the send command, while UDP uses sendto. I hope for a 

simple command substitution :). 

 

Jos 

 

0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
1,134 Views

hi you used the example on matlab !!!? can you tell me how you did that or provide suggestions on how to start with it am using the example but on nios 2.  

my board is Stratix IV
0 Kudos
Altera_Forum
Honored Contributor II
1,134 Views

 

--- Quote Start ---  

hi you used the example on matlab !!!? can you tell me how you did that or provide suggestions on how to start with it am using the example but on nios 2.  

my board is Stratix IV 

--- Quote End ---  

 

 

In Matlab I open the connection with: 

 

TCPIP_Handle= tcpip(RadarIPAddress, Port, 'NetworkRole', 'client') 

fopen(TCPIP_Handle) 

 

Use the appropriate address and port. 

 

On the MAX 10 side I adapted the file simple_socket_server.c, not using DHCP 

(BSP setting) and using a fixed IP adress (simple_socket_server.h). 

 

Probably I forgot some things. My experience is that you have to  

experiment yourself quite a bit before things work. Most important 

is that you know now that it can be done.
0 Kudos
Altera_Forum
Honored Contributor II
1,134 Views

 

--- Quote Start ---  

In Matlab I open the connection with: 

 

TCPIP_Handle= tcpip(RadarIPAddress, Port, 'NetworkRole', 'client') 

fopen(TCPIP_Handle) 

 

Use the appropriate address and port. 

 

On the MAX 10 side I adapted the file simple_socket_server.c, not using DHCP 

(BSP setting) and using a fixed IP adress (simple_socket_server.h). 

 

Probably I forgot some things. My experience is that you have to  

experiment yourself quite a bit before things work. Most important 

is that you know now that it can be done. 

--- Quote End ---  

 

 

so your simple socket worked fine on your board ? as when I did the simple socket I encountered problems but the webserver works fine but I cant start a telnet session I don't really know why , 

do you still have the codes if it is possible to share it with me ?
0 Kudos
Altera_Forum
Honored Contributor II
1,134 Views

 

--- Quote Start ---  

so your simple socket worked fine on your board ? as when I did the simple socket I encountered problems but the webserver works fine but I cant start a telnet session I don't really know why , 

do you still have the codes if it is possible to share it with me ? 

--- Quote End ---  

 

 

Yes, it works fine. Unfortunately, I cannot share the code with you, because 

I developed it for a commercial project. 

 

Jos
0 Kudos
Altera_Forum
Honored Contributor II
1,134 Views

Alrtight can you help me figure out why it doesn't work,  

 

I tried all the possible ways !!! my webserver works !!! and ping can be established!!! but the telnet session doesn't work !!??? any idea !! 

 

please help !!  

 

though the webserver and ping works fine I have this error  

 

------------------------------- 

 

InterNiche Portable TCP/IP, v3.1  

 

Copyright 1996-2008 by InterNiche Technologies. All rights reserved.  

prepped 1 interface, initializing... 

mctest init called 

IP address of : 192.168.1.66 

dtrap - needs breakpoint 

dtrap - needs breakpoint 

Error sending DHCP packet on iface 0. 

ip_exit: calling func 0x1801b6f0 

ip_exit: calling func 0x18023298 

 

-------------------------------- 

 

Attached shows the web server and the ping working successfully
0 Kudos
Altera_Forum
Honored Contributor II
1,134 Views

You use DHCP. I use fixed IP addresses. Also do not forget 

to disable an eventual fire wall.
0 Kudos
Altera_Forum
Honored Contributor II
1,134 Views

 

--- Quote Start ---  

You use DHCP. I use fixed IP addresses. Also do not forget 

to disable an eventual fire wall. 

--- Quote End ---  

 

 

Also when i tried without DHCP, the telnet session did not work
0 Kudos
Reply