Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

TCP/IP Stack error: undefined reference to 'alt_iniche_init()'

Altera_Forum
Honored Contributor II
1,265 Views

I am using Nios II IDE 9.0SPE build 235 to implement web server on nios processor with ucOS. 

I added the software component 'NicheStack TCP/IP Stack' through Properties. 

 

I get the below error: 

 

 

undefined reference to `alt_iniche_init()'  

undefined reference to `dhc_set_callback(int, int (*)(int, int))'  

undefined reference to `dhc_set_state(int, int)'  

undefined reference to `netmain()'  

 

In the syslib folder > Debug > obj > iniche and rest of the TCP/IP folders are present 

 

How do I debug this issue? What else should be done so that the system know about `alt_iniche_init()' ,etc? 

 

 

 

 

Code (partial): 

 

# include <stdio.h> 

# include <math.h> 

# include <unistd.h> // <bae> Allows usleep() to be called 

# include <alt_iniche_dev.h> 

/* Nichestack definitions */ 

# include "includes.h" 

# include "ipport.h" 

# include "libport.h" 

# include "osport.h" 

# include "tcpport.h" 

# include "net.h" 

# include "dhcpclnt.h" 

# include "icmp.h" 

/* Low-level network */ 

# include "triple_speed_ethernet_regs.h" 

# include "iniche/triple_speed_ethernet_iniche.h" 

# include "iniche/ins_tse_mac.h" 

/* Nichestack definitions */ 

# include "includes.h" 

# include "ipport.h" 

# include "libport.h" 

# include "osport.h" 

# include "tcpport.h" 

# include "net.h" 

# include "dhcpclnt.h" 

# include "icmp.h" 

... 

..... 

 

void SSSInitialTask(void *task_data) 

wait_on_phy(); 

dhc_set_callback( 0, ws_ipset ); 

alt_iniche_init(); 

netmain(); 

while (!iniche_net_ready) 

TK_SLEEP(1); 

OSTimeDlyHMSM(0, 0, 3, 0); 

printf("\nNios II Simple Socket Server starting up.\n"); 

while (1); /* Correct Program Flow should never get here */ 

}
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
506 Views

Also... In system.stf 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

 

...... 

<sw_component id="INICHE" name="NicheStack TCP/IP Stack" sopc_component_dir="altera_iniche"> 

<sys_defines> 

<define name="dhcp_client" quote="no" value="1"/> 

<define name="ip_fragments" quote="no" value="1"/> 

<define name="include_tcp" quote="no" value="1"/> 

<define name="iniche_default_if" quote="yes" value="triple_speed_ethernet_mac"/> 

.... 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
0 Kudos
Altera_Forum
Honored Contributor II
506 Views

 

--- Quote Start ---  

Also... In system.stf 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

 

...... 

<sw_component id="INICHE" name="NicheStack TCP/IP Stack" sopc_component_dir="altera_iniche"> 

<sys_defines> 

<define name="dhcp_client" quote="no" value="1"/> 

<define name="ip_fragments" quote="no" value="1"/> 

<define name="include_tcp" quote="no" value="1"/> 

<define name="iniche_default_if" quote="yes" value="triple_speed_ethernet_mac"/> 

.... 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

--- Quote End ---  

 

 

@ ash 

what's the modification on this file?
0 Kudos
Altera_Forum
Honored Contributor II
506 Views

There is no modification on this file, .stf is generated by the system. 

I think, I need to change the ipport.h, is it right? 

Also, in nios II 9sp2, after adding the software component of TCP/IP stack, should I link the src (source code) to the project separately?
0 Kudos
Reply