您尚未登录。

楼主 #1 2021-05-08 09:58:43

unturned3
会员
注册时间: 2020-07-01
已发帖子: 271
积分: 300

荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

我用的是官方buildroot 2020.11.3,主线Linux 5.3.5,以太网设备树是从 荔枝派 zero-5.2.y 这里抄过来的。

这是开机时 kernel 打印的信息,看起来以太网驱动貌似没啥问题:

[    0.670942] libphy: Fixed MDIO Bus: probed
[    0.675134] CAN device driver interface
[    0.679641] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[    0.685514] dwmac-sun8i 1c30000.ethernet: No regulator found
[    0.691600] dwmac-sun8i 1c30000.ethernet: Current syscon value is not the default 38000 (expect 58000)
[    0.701003] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[    0.708253] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[    0.715489] dwmac-sun8i 1c30000.ethernet: COE Type 2
[    0.720454] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[    0.727250] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[    0.732909] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[    0.738591] dwmac-sun8i 1c30000.ethernet: device MAC address 52:57:dc:70:bf:b8
[    0.746056] libphy: stmmac: probed
[    0.750101] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[    0.756447] libphy: mdio_mux: probed
[    0.760062] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[    0.766461] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[    0.773048] libphy: mdio_mux: probed

登录后运行 ifconfig,然后尝试用 udhcpc 来获取 IP,会卡在 “sending discover” 上:

# ifconfig eth0 up
[  780.217368] dwmac-sun8i 1c30000.ethernet eth0: PHY [0.1:01] driver [Generic PHY]
[  780.226392] dwmac-sun8i 1c30000.ethernet eth0: No Safety Features support found
[  780.233807] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available
[  780.241472] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW
[  780.248026] dwmac-sun8i 1c30000.ethernet eth0: configuring for phy/mii link mode
# udhcpc
udhcpc: started, v1.32.0
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover

过一会儿后(几十秒到几十分钟不等),kernel 会打印一个 “Link is Up” 的信息,然后这时候运行 udhcpc 立即就能获取到 IP:

[  878.003861] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off

# udhcpc
udhcpc: started, v1.32.0
udhcpc: sending discover
udhcpc: sending select for 192.168.3.190
udhcpc: lease of 192.168.3.190 obtained, lease time 86400
deleting routers
adding dns 192.168.3.1

有些时候这个以太网还会在 Down、Up 之间来回变动:

# udhcpc
udhcpc: started, v1.32.0
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
[  101.283907] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[  102.323796] dwmac-sun8i 1c30000.ethernet eth0: Link is Down
[  110.483599] random: crng init done
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
[  126.243915] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[  127.283790] dwmac-sun8i 1c30000.ethernet eth0: Link is Down
[  132.483944] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
udhcpc: sending discover
udhcpc: sending select for 192.168.3.190
udhcpc: lease of 192.168.3.190 obtained, lease time 86400
deleting routers
adding dns 192.168.3.1
# 

请问有哪位大佬遇到过这个情况吗?荔枝派Zero的以太网是不是还需要什么设备树以外的特别的配置?奇怪的是,如果我在荔枝派上用 USB-Ethernet 转接器,同样的问题就从来没有出现过,udhcpc 也总是立即就可以获取 IP。

多谢指教!

最近编辑记录 unturned3 (2021-05-08 10:00:46)

离线

#2 2021-05-08 10:03:02

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

应该是硬件问题,换交换机,换网线,换电脑,换开发板,换RJ45座子,换固件,排除法试一试。





离线

#3 2021-05-08 21:54:30

microxp
会员
注册时间: 2021-04-27
已发帖子: 76
积分: 124

Re: 荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

网线接触不良?

离线

#4 2021-05-10 10:58:12

xfdr0805
会员
注册时间: 2020-07-23
已发帖子: 312
积分: 350

Re: 荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

碰到一模一样的问题

离线

楼主 #5 2021-05-12 14:35:41

unturned3
会员
注册时间: 2020-07-01
已发帖子: 271
积分: 300

Re: 荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

谢谢各位大佬!貌似还真是网线的问题。换了一根线测试了一下,ifconfig eth0 up 后 Link 马上就 Up 了

离线

#6 2023-02-16 10:28:30

youkebing
会员
注册时间: 2020-04-06
已发帖子: 17
积分: 87

Re: 荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

今天遇到相同的问题,换了网线就好了,测试是软的网线都不行,硬点的网线都正常

离线

#7 2023-02-16 21:48:09

efancier
会员
注册时间: 2020-11-05
已发帖子: 16
积分: 1

Re: 荔枝派 V3s 以太网 Link is Up,Link is Down 奇怪行为

挑网线也可能是PCB板上的差分线阻抗控制不好导致的信号完整性问题

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn