Forum Discussion

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

ucos+Nichestack TCP/IP stack problem in DE2

I'm using Quartus II 8.0 with DE2 board

NIOS IDE console displays: "

InterNiche Portable TCP/IP, v3.1

Copyright 1996-2007 by InterNiche Technologies. All rights reserved.

prepped 0 interfaces, initializing...

inet startup error: unable to find any working interfaces

dtrap - needs breakpoint

panic: IP "

there is a error in the software component which shows:"there is no compatible Ethernet MAC in your design" and MAC interface is founded nothing

it seems there is no drive for dm9000a, so i added source file dm9000a.c and dm9000a.h(which is the drive core for DE2_WEB, still founded errors in the dm9000a.c source file

any suggestions to solve this issue? thanks

8 Replies

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

    --- Quote Start ---

    Is the header file "dm9000a.h" imported by the "alt_sys_init.c"?

    --- Quote End ---

    Thanks, there is no "dm9000a.h" within the file "alt_sys_init.c", I've put the file "dm9000a.h" in the route of \sopc_builder\components\DM9000A\HAL\inc. The NIOS IDE tool "gtfgenerate" should have generated itself and include the .h file, initial the _INSTANCE and _INT module. How to solve?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I had the same issue with another MAC which was implemented in SOPC Builder under Linux. The MAC was in the "system.h" but the header file of the driver not included in "alt_sys_init.c". So I included it on my own and added the INIT and INSTANCE methods defined in the header file. This works but stays only in this file as long as you do not change the system library.

    By the way under Windows there were no problems.

    EDIT: I looked over your pictures again an saw that you included the "dm9000.h" instead of "dm9000a.h". Perhaps this solves some of your problems.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I had the same issue with another MAC which was implemented in SOPC Builder under Linux. The MAC was in the "system.h" but the header file of the driver not included in "alt_sys_init.c". So I included it on my own and added the INIT and INSTANCE methods defined in the header file. This works but stays only in this file as long as you do not change the system library.

    By the way under Windows there were no problems.

    EDIT: I looked over your pictures again an saw that you included the "dm9000.h" instead of "dm9000a.h". Perhaps this solves some of your problems.

    --- Quote End ---

    The source file is "dm9000.h" and "dm9000.c", still it's not included in the "alt_sys_init.c" file. I have edited the "...sw_tcl.tcl" file as a proper way, but it's not work. I tried to edit the file "alt_sys_init.c", including the dm9000.h, INSTANCE and INIT, it comes out with an error that "ALTERA_AVALON_DM9K_INIT" undeclared, Have you changed anything in the header file on INIT and INSTANCE?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    No, I haven't changed anything in the header file.

    Is there a failure when you include the line
    #include "dm9000.h"
    in "alt_sys_init.c"?

    If the answer is yes Nios can't find the file. So you have to import it into your syslib folder or adding the include paths in Nios.

    If the answer to the above question is no, you have the false driver for the Nichestack. I searched the web and probably found that driver you mentioned.

    The INIT and INSTANCE methods are only include if LWIP (the LWIP Stack) is defined. But you use the Nichestack.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    No, I haven't changed anything in the header file.

    Is there a failure when you include the line
    #include "dm9000.h"
    in "alt_sys_init.c"?

    If the answer is yes Nios can't find the file. So you have to import it into your syslib folder or adding the include paths in Nios.

    If the answer to the above question is no, you have the false driver for the Nichestack. I searched the web and probably found that driver you mentioned.

    The INIT and INSTANCE methods are only include if LWIP (the LWIP Stack) is defined. But you use the Nichestack.

    --- Quote End ---

    The drive i have is for lwip, which is the stack i'm using now(not Nichestack, which needs another driver). so I'm wondering what the INIT and INSTANCE methods you've mentioned is.

    I have checked the arguments of ALTERA_AVALON_DM9K_INIT, it seems the error has been solved, but the "alt_sys_init.c" file can't detect the dm9000 itself.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    whatever, the dm9000a device has not drived successfully, thanks, i will test it tomorrow.

    [tcpip_init_done] Fatal: Can't add ethernet interface!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The Vendor ID has not read successfully as it's supposed in the DM9000A data sheet which has indicated as below:

    write 0x28 to the index port, then read from data port, we should have got 0x46

    but I always get 0xC07 whether reading from the index port or data port after writting the value 0x28 to the index port. would it be the timing issue? I have added the dm9000 _INSTANCE and _INIT to the file "alt_sys_init.c" manually.