Board logo

标题: DM9000 怎么测试和调试? [打印本页]

作者: my_zjf_    时间: 2007-4-4 16:36     标题: DM9000 怎么测试和调试?

DE2上有DM9000网卡,它的程序里就写了发送和接收两个函数,我该怎么测试它是正常的呢〉?


作者: caopengly    时间: 2007-4-5 10:48

试试这些吧网络功能吧!

To enable network support, in uClinux-dist kernel config,
Networking -->

  • Networking support
    Networking options --->
    <*> Packet socket
    <*> Unix domain sockets
  • TCP/IP networking

    Device Drivers -->Network device support ─>

  • Network device support
  • Ethernet (10 or 100Mbit)


  • SMC 91C9x/91C1xxx support            # only if you use Altera Nios dev board with SMC91111,
    [ ] Opencores (Igor) Emac support                
    [ ] MoreThanIP 10_100_1000 Emac support
    [ ] DM9000 support 
  • DM9000A with checksum offloading   # only if you use DE2 with DM9000A

    If you use Altera's Nios dev board, select "SMC 91C9x/91C1xxx support"  . linux-2.6.x/drivers/net/smc91x.c .
    If you use DE2 board, you should enable "DM9000A with checksum offloading" . linux-2.6.x/drivers/net/dm9ks.c .


    If you use Altera Stratix dev board, you must change the irq number of the ether chip to a non-zero value in SOPC builder and rebuild.

    Then rebuild the kernel, and boot nios2 uclinux. It should detect the SMC 91111 or DM9000 device as eth0.


    Every board should have a unique ethernet hardware address. In file linux-2.6.x/arch/nios2nommu/kernel/setup.c, kernel get the hw addr from the flash on Altera dev board. You may use 'ifconfig' to find out. If you use custom boards, you need to change setup.c or use ifconfig to set hw address.
    ifconfig eth0 hw ether 00:07:ed:0a:03:29      #  hardware MAC address 00:07:ed:0a:03:<random 00-ff>


    Then config the ip address and router.
    ifconfig eth0 192.168.1.10      # static ip
    route add default gw 192.168.1.254     # gateway
    Or, use dhcp client
    ifconfig eth0 up
    dhcpcd &


    To set name server (DNS) , create the file /etc/resolv.conf , with a line of your name server, eg
    nameserver 192.168.1.254
    Or if you use DHCP, the dhcpcd will create this file.
    Refer to the end of NFSFileSytem wiki page for a sample dhcpd.conf.

    You may use "ntpdate" to get date & time from internet. Set TZ  env to your timezone, eg "TZ=CST-8" for east China. Or edit the file vendors/Altera/nios2nommu/TZ , which will be /etc/TZ as the cache of TZ env.
    /> TZ=CST-8
    /> ntpdate pool.ntp.org
    Looking for host pool.ntp.org and service ntp
    host found : 71.237.179.90
    13 Dec 11:05:33 ntpdate[20]: step time server 71.237.179.90 offset 222059037.166530 sec
    /> date
    Wed Dec 13 11:05:39 2006

    The telnetd and ftpd should be invoked by inetd with the default config. The BOA is standalone.
    /> inetd &   # start inetd to invoke telnetd and ftpd services
    [15]
    /> boa &   # start httpd with cgi-demo
    [16]
    /> netstat -a
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State
    tcp        0      0 *:http                  *:*                     LISTEN
    tcp        0      0 *:ftp                   *:*                     LISTEN
    tcp        0      0 *:telnet                *:*                     LISTEN
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags       Type       State         I-Node Path

    You may add these setup for ethernet to the file vendors/Altera/nios2nommu/rc (which will become /etc/rc ) in uClinux-dist dir, follow the setup for "lo" . So that the ethernet will be configed by init.

    With dm9ks driver in DE2 the ftpd transfer rate is around 1.5-1.7 MByte/s.

    Jumbo Frames support is enabled by changing the MTU to a value larger than the default of 1500.  Use the ifconfig command to increase the MTU size.
    eg,   ifconfig eth<x> mtu 6000 up


    作者: my_zjf_    时间: 2007-4-6 16:20

    我在工程中增加了DM9000,编译出现下列问题,是那里出现了问题了?不是uclinux都做好了吗?

    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:305: error: `na_dm9000_irq' undeclared here (not in a function)
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c: In function `dmfe_probe':
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:362: error: `na_dm9000' undeclared (first use in this function)
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:362: error: (Each undeclared identifier is reported only once
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:362: error: for each function it appears in.)
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c: At top level:
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:291: warning: 'dmfe_debug' defined but not used
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:295: warning: 'debug' defined but not used
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:296: warning: 'mode' defined but not used
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:785: warning: 'dmfe_reset_dm9000' defined but not used
    make[3]: *** [drivers/net/dm9000x.o] Error 1
    make[2]: *** [drivers/net] Error 2
    make[1]: *** [drivers] Error 2
    make: *** [_all] Error 2


    作者: my_zjf_    时间: 2007-4-6 16:21

    编译linux出现错误:

    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:305: error: `na_dm9000_irq' undeclared here (not in a function)
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c: In function `dmfe_probe':
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:362: error: `na_dm9000' undeclared (first use in this function)
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:362: error: (Each undeclared identifier is reported only once
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:362: error: for each function it appears in.)
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c: At top level:
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:291: warning: 'dmfe_debug' defined but not used
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:295: warning: 'debug' defined but not used
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:296: warning: 'mode' defined but not used
    /cygdrive/c/altera/kits/nios2_60/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/drivers/net/dm9000x.c:785: warning: 'dmfe_reset_dm9000' defined but not used
    make[3]: *** [drivers/net/dm9000x.o] Error 1
    make[2]: *** [drivers/net] Error 2
    make[1]: *** [drivers] Error 2
    make: *** [_all] Error 2


    作者: my_zjf_    时间: 2007-4-6 16:38

    用的哪个版本啊 ,我的没有

  • DM9000A with checksum offloading   # only if you use DE2 with DM9000A

    这个选项啊

    只有

    [] DM9000x这个选项

    选上就出现上面的问题


    作者: caopengly    时间: 2007-4-8 11:56

    你在ide中的uclinux可能没有,我贴的是在linux中通过交叉编译的dist2.6。x的核,

    在我的博克中有详细说明。

    [此贴子已经被作者于2007-4-8 12:00:59编辑过]






    欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0