天嵌 ARM开发社区

 找回密码
 注册
查看: 2590|回复: 0

天嵌i.MX6UL工控板网卡模块检测教程

[复制链接]
非也 发表于 2019-3-1 10:07:22 | 显示全部楼层 |阅读模式
  关于天嵌科技的iMX6UL开发板平台的硬件参数相信大家都很了解,但是具体到每个接口的使用方法,不知道大家清楚不?iMX6UL开发板平台其中一个特点是支持双网卡:一机双网,可以使用内网外网于同一个板,直接上传数据。这里分享i.MX6UL工控板网卡模块的检测方法,烧写使用tq-imx6ul_net0_net1.dtb就是双网卡,这里只以eth0为例子讲解。eth1方法也一样。靠近耳机接口那一端子的是eth0,测试网卡模块时,接上网线,如果当前网卡是状态是down,网卡灯是不会亮的。在命令行输入操作如下:

  1. # udhcpc -i eth0
  2. udhcpc: started, v1.25.1
  3. fec 2188000.ethernet eth0: Freescale FEC PHY driver [Micrel KSZ8081 or KSZ8091]
  4. (mii_bus:phy_addr=2188000.ethernet:02, irq=-1)
  5. IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
  6. udhcpc: sending discover
  7. fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
  8. IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
  9. udhcpc: sending discover
  10. udhcpc: sending select for 192.168.1.236 #成功分配到ip
  11. udhcpc: lease of 192.168.1.236 obtained, lease time 7200
  12. deleting routers
  13. adding dns 202.96.128.166 #自动设置dns
  14. adding dns 202.96.134.133
  15. # ping www.embedsky.com
  16. PING www.embedsky.com (14.17.32.211) 56(84) bytes of data.
  17. 64 bytes from 14.17.32.211 (14.17.32.211): icmp_seq=1 ttl=55 time=5.34 ms
  18. 64 bytes from 14.17.32.211 (14.17.32.211): icmp_seq=2 ttl=55 time=5.12 ms
  19. 64 bytes from 14.17.32.211 (14.17.32.211): icmp_seq=3 ttl=55 time=7.80 ms
  20. 64 bytes from 14.17.32.211 (14.17.32.211): icmp_seq=4 ttl=55 time=5.41 ms
  21. ^C
  22. --- www.embedsky.com ping statistics ---
  23. 4 packets transmitted, 4 received, 0% packet loss, time 3004ms
  24. rtt min/avg/max/mdev = 5.122/5.923/7.804/1.091 ms
复制代码

  如果一直循环打印一下信息说明网卡模块正常,测试完成后,在命令行按ctrl+c 键中断ping。以上是测试外网的。如果不能连接外网。可以设置ip 后直接与pc 互ping。

  1. # ifconfig eth0 192.168.1.40 up #设置板子ip 要与电脑ip 为同网段
  2. fec 2188000.ethernet eth0: Freescale FEC PHY driver [Micrel KSZ8081 or KSZ8091]
  3. (mii_bus:phy_addr=2188000.ethernet:02, irq=-1)
  4. # ifconfig eth0 downfec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
  5. # ping -I eth0 192.168.1.49 #指定使用eth0 ping pc 的ip(192.168.1.49)
  6. PING 192.168.1.49 (192.168.1.49) from 192.168.1.40 eth0: 56(84) bytes of data.
  7. 64 bytes from 192.168.1.49: icmp_seq=1 ttl=64 time=0.625 ms
  8. 64 bytes from 192.168.1.49: icmp_seq=2 ttl=64 time=0.393 ms
  9. 64 bytes from 192.168.1.49: icmp_seq=3 ttl=64 time=0.378 ms
  10. 64 bytes from 192.168.1.49: icmp_seq=4 ttl=64 time=0.351 ms
  11. 64 bytes from 192.168.1.49: icmp_seq=5 ttl=64 time=0.374 ms
  12. ^C
  13. --- 192.168.1.49 ping statistics ---
  14. 5 packets transmitted, 5 received, 0% packet loss, time 3998ms
  15. rtt min/avg/max/mdev = 0.351/0.424/0.625/0.102 ms
  16. #
复制代码

  如果打印以下信息说明网络不通:ping: bad address 'www.embedsky.com'。可能是ip 或者dns 没有设置对。另外如果同时两个网口都接上网线时,两个网卡的ip 要设置成不同的网段。

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-4-27 00:41 , Processed in 1.062500 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表