Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Ethernet Interface

Hi,

I have a system (a probe) that is currently sending/receiving data from the PC terminal using a UART(RS232) connection. This was easy to configure/program, and the hardware was also easy to make up. However, I wish to upgrade to an Ethernet Interface to improve the speed of the data transfer. I wish to transmit/receive 16-bits of data in one go, I have already done the Web Server and Simple Socket tutorials, but they are way to complex for my needs....is there no equivalent for printf() / getchar() when uning the Ethernet...

Thanks in advance...

Kushan.

16 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Okay... it seems you've downloaded the patch from the wiki correct? He's included a document that indicates which files he's modified. So what we actually did was run the patch on a 7.1 installation. Then we compared the modified files between the patched 7.1 version and the 7.2 version to see what changes we needed to make to get the superloop mode working. They were minimal and if I remembered off hand what they were I'd just give them to you. Bare in mind that there was other code that changed between 7.1 and 7.2 so you only want the necessary superloop changes.

    However, didn't you look at this thread in the NIOS forum?

    http://forum.niosforum.com/forum/index.php?showtopic=8747

    He's got a 7.2 version ready for download. I haven't used it but you could give it a shot.

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The whole superloop concept isn't giving me any positive vibes...I installed Quartus 7.1, and Megacore IP library 7.1 and Nios 2 EDS 7.1, just to get the superloop socket server example to work. I followed the instructions in the attached word document to the letter. However, when I came to the stage of building the superloop socket server example...I got errors in the network_utilities.c file that it could not find the headers "ipport.h" and "tcpport.h"

    not sure whats going on!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Okay. Well let me assure you the superloop concept is well proven. The InterNiche stack is designed to work in superloop mode. My company now has two products that employ the InterNiche stack in superloop mode.

    However, it is certainly fair to consider that going through this process may be beyond your experience level. If you feel that is the case, then you can certainly decide to use the uC/OSII implementation or an alternative TCP/IP stack.

    As far as your current problem goes. I don't know that you needed to install all three products (Quartus, Megacore, NIOS). I think the NIOS EDS would have been sufficient. Anyway, did you follow all the instructions in the document. You have to copy the "simple_socket_server_no_rtos" folder to your nios software examples directory. You cannot use the regular simple socket server that's bundled with the NIOS EDS. The reason for this is that your "system.stf" file for your system library has to be hand-edited to include support for the InterNiche stack.

    Altera has decided not to support the superloop version and that is why you have to jump through all these hoops. Altera's own documentation indicates that the stack can be run in superloop mode and that higher networking performance can be acheived in superloop mode but for some reason (probably some agreement with uC) they've decided only to support the uC/OSII version.

    Obviously I have a patched copy of the stack. However, I'm typically in the habit of teaching a man to fish rather than giving him the fish. On top of that, I've made some custom modifications to the stack and wouldn't want those to cause you any grief.

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Oh just take it. You have to unzip this to c:\altera\72\nios2eds\components .Remember, in order for this to work, you'll have to hand edit the system.stf file for your project. Here is an example:

    <sw_component id="INICHE_SL" name="NicheStack TCP/IP Stack" sopc_component_dir="altera_iniche_sl">
    <sys_defines>
    <define name="include_tcp" quote="no" value="1"/>
    <define name="ip_fragments" quote="no" value="1"/>
    <define name="dhcp_client" quote="no" value="1"/>
    <define name="INICHE_TIMERS" quote="no" value="1"/>
    <define name="MEM_WRAPPERS" quote="no" value="1"/>
    <define name="TCP_ZEROCOPY" quote="no" value="1"/>
    <define name="ALT_INICHE_SUPERLOOP" quote="no" value="1"/>
    <define name="TELNET_SVR" quote="no" value="1"/>
    <define name="IN_MENUS" quote="no" value="1"/>
    <!---
    <define name="ALT_NUMBIGBUFS" quote="no" value="100"/>
    -->
    <!---
    <define name="PING_APP" quote="no" value="1"/>
    <define name="INCLUDE_NVPARMS" quote="no" value="1"/>
    <define name="NET_STATS" quote="no" value="1"/>
    <define name="DNS_CLIENT" quote="no" value="1"/>
    <define name="IP_ROUTING" quote="no" value="1"/>
    <define name="USE_PROFILER" quote="no" value="1"/>
    <define name="FTP_SERVER" quote="no" value="1"/>
    <define name="TFTP_SERVER" quote="no" value="1"/>
    <define name="FTP_CLIENT" quote="no" value="1"/>
    <define name="TFTP_CLIENT" quote="no" value="1"/>
    <define name="SERVER_PUSH" quote="no" value="1"/>
    <define name="VFS_FILES" quote="no" value="1"/>
    <define name="WEBPORT" quote="no" value="1"/>
    <define name="HTML_COMPRESSION" quote="no" value="1"/>
    <define name="FOREIGN_LANG_SUPPORT" quote="no" value="1"/>
    -->
    </sys_defines>
    </sw_component>

    Jake