Forum Discussion
Altera_Forum
Honored Contributor
18 years agoTcp_ip, Sopc
hello, i have a bord STRATIX II EP2S60, i use quartus 2 v7.2. i would like to use nichestack tcp/ip for nios 2, I don't know if i must use the MicroC/OS for this or i can avoid it (i don't...
Altera_Forum
Honored Contributor
18 years agoHi Jakob,
I checked the the driver files(smsc91x.c, smsc_mem.c, smsc_phy.c), and they are not calling any UCOS-II functions. I copied the 'altera_avalon_lan91c111' directory from the superloop zip file(downloaded from nios wiki) to 72\quartus\sopc_builder\components\. And i think this it will create the HAL folder with lan91c111 driver files. I debugged to find why it is unable to locate any working interfaces, and I came to know that the error is occuring due to the function iniche_devices_init( ). As part of netmain_init, the iniche_devices_init( ) function will be called and in this function, it seems the 'alt_iniche_dev_list' is not having any 'alt_iniche_dev' nodes, that is why it is returning the 'if_count'(interfaces found) as 0. In the following function, when i printed p_dev, p_dev_list_end, both are printed as same values. So it is not entering into the while loop and if_count=0. int iniche_devices_init( int if_count) { alt_iniche_dev *p_dev; alt_iniche_dev *p_dev_list_end; /* Get the InterNiche device list. */ p_dev = (alt_iniche_dev *) (alt_iniche_dev_list.next); p_dev_list_end = (alt_iniche_dev *) (&(alt_iniche_dev_list.next)); printf("p_dev=0x%x\n",p_dev); printf("p_dev_list_end=0x%x\n",p_dev_list_end); /* Initialize each InterNiche device. */ while (p_dev != p_dev_list_end) { /* Initialize the InterNiche device data record. */ ........ ........ /* Perform device specific initialization. */ (*(p_dev->init_func))(p_dev); /* Get the interface IP address. */ .............. .............. /* Initialize next device. */ if_count++; p_dev = (alt_iniche_dev *) p_dev->llist.next; } return (if_count); } The 'alt_iniche_dev' node should be inserted into the 'alt_iniche_dev_list' as part of the alt_sys_init( ), which will be called before the application main( ) function. The alt_sys_init( ) calls the ALTERA_AVALON_LAN91C111_INIT( LAN91C111, lan91c111 ); macro to register the lan91c111 driver(by adding to the 'alt_iniche_dev_list'). So it seems the registering of lan91c111 is not happening properly. Thanks, -Veenu