Error: Undefined reference to 'ethernet_server_full_two_port

If you have a simple question and just want an answer.
TGeiger
New User
Posts: 2
Joined: Tue Apr 28, 2015 3:03 pm

Error: Undefined reference to 'ethernet_server_full_two_port

Post by TGeiger »

Hi,
 
i get an error if i want to use the 'ethernet_server_full_two_port' function.
 
../src/main.xc: Error: Undefined reference to 'ethernet_server_full_two_port'
xmake[1]: *** [bin/Debug/app_BR_mii_tap_Debug.xe] Error 1
xmake: *** [bin/Debug/app_BR_mii_tap_Debug.xe] Error 2
 
Although i made all the paths (/module_ethernet/src/include), references and includes (#include "ethernet_server_full.h", #include "ethernet_server.h") for it.
And in the makefile all modules are listed too.
USED_MODULES = module_ethernet module_ethernet_smi module_ethernet_board_support module_otp_board_info
 
So could you please give me a hint why this error comes up?
 
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

In your posted source code, it appears the required routine is commented out:

Code: Select all

/*char mac_address[6];otp_board_info_get_mac(otp_ports1, 0, mac_address);void ethernet_server_full_two_port(mii1,                                   mii2,                                   smi1,                                   smi2,                                   char mac_address[],                                   chanend rx[],                                   int num_rx,                                   chanend tx[],                                   int num_tx){  streaming chan c[2];  mii_init_full(mii1);  mii_init_full(mii2);  init_mii_mem();  par {    mii_rx_pins(mii1.p_mii_rxdv, mii1.p_mii_rxd, 0, c[0]);    mii_tx_pins(mii1.p_mii_txd, 0);    mii_rx_pins(mii2.p_mii_rxdv, mii2.p_mii_rxd, 1, c[1]);    mii_tx_pins(mii2.p_mii_txd, 1);    ethernet_tx_server(mac_address, tx, 2, num_tx, smi1, null);    ethernet_rx_server(rx, num_rx);    ethernet_filter(mac_address, c);  }}*/
 

Remove the /* and also the */ to un-comment the code block -> save and test again.

 

User avatar
Thomas
Experienced Member
Posts: 66
Joined: Fri Feb 05, 2010 12:34 pm

Post by Thomas »

I suspect the error is because NUM_ETHERNET_MASTER_PORTS is not defined to be 2.

The  function ethernet_server_full_two_port is implemented in ethernet_server.xc   

but only #if (NUM_ETHERNET_MASTER_PORTS == 2)

Adding #define NUM_ETHERNET_MASTER_PORTS 2

to smi_conf.h 

should get rid of the compile error