Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12435 Discussions

Superloop Simple Socket Server with LAN91C111 ---> Success!!! <---

Altera_Forum
Honored Contributor II
906 Views

I'm working with the 2C35 Nios Dev Kit. It uses the LAN91C111 mac/phy. 

 

I downloaded the "Superloop Simple Socket Server Plus" project from Altera Wiki  

 

(http://www.alterawiki.com/wiki/superloop_simple_socket_server_plus?gsa_pos=1&wt.oss_r=1&wt.oss=super...), or go to www.altera.com (http://www.altera.com), search "superloop". 

 

On the hardware side, I use the niosII_cycloneII_2c35_standard project that comes with the dev kit. On the software side, the project has to be modified to use the LAN91C111 instead of the TSE mac. That's the tricky bit. 

 

In the create-this-lib script in sss_tse_lib (I renamed this dir to sss_smsc_lib), change ORIG_SOURCE_DIR 

 

ORIG_SOURCE_DIR="${SOPC_KIT_NIOS2}/../ip/altera/sopc_builder_ip/altera_avalon_lan91c111/" 

 

Change the file listings: 

# # Source file listings...#  

# HAL source files 

HAL_FILES=" 

inc/altera_avalon_lan91c111.h  

# UCOSII source files 

UCOSII_FILES=" 

src/iniche/smsc_mem.c  

src/iniche/smsc_phy.c  

src/iniche/smsc91x.c  

inc/iniche/altera_avalon_lan91c111_iniche.h  

inc/iniche/s91_port.h  

inc/iniche/smsc91x.h  

# BASE source files 

BASE_FILES=" 

inc/altera_avalon_lan91c111_regs.h  

 

In iniche_init.c, change # include "triple_speed_ethernet.h" 

to# include "altera_avalon_lan91c111_iniche.h" 

 

change 

TRIPLE_SPEED_ETHERNET_INSTANCE ( TSE_MAC, tse_mac); 

to 

ALTERA_AVALON_LAN91C111_INSTANCE ( LAN91C111, lan91c111); 

 

change 

TRIPLE_SPEED_ETHERNET_INIT ( TSE_MAC, tse_mac); 

to 

ALTERA_AVALON_LAN91C111_INIT ( LAN91C111, lan91c111); 

 

... and probably a few other things I'm forgetting. 

 

The critical thing I had to overcome was I was originally# include-ing altera_avalon_lan91c111.h instead of altera_avalon_lan91c111_iniche.h. This file also contains declarations that will allow the project to compile, but it results in the following message when I run: 

 

prepared 0 interfaces, initializing... 

inet startup error: unable to find any working interfaces 

dtrap - needs breakpoint 

panic: IP 

 

altera_avalon_lan91c111_iniche.h contains different _INSTANCE and _INIT that make all the difference. 

 

Now I can make LEDs blink from a distance without the need for MicroC/OS-II. My life is complete. 

 

I hope this helps someone!
0 Kudos
0 Replies
Reply