野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 113|回复: 4

移植st官方内核到野火mp157开发板上网口无法自动获取ip

[复制链接]
发表于 2024-6-7 17:51:58 | 显示全部楼层 |阅读模式
移植st官方的en.SOURCES-stm32mp1-openstlinux-5-4-dunfell-mp1-20-06-24.tar到开发板上,设备树参考野火的设备树进行修改,通过网线将网口直接连接电脑使用静态ip设置能够ping通,然后将网口接到路由器,使用dhcpc命令获取动态ip无法获取ip,请问有知道怎么解决吗?
回复

使用道具 举报

 楼主| 发表于 2024-6-11 16:50:37 | 显示全部楼层
开关eth0会报如下错误:
root@lubancat:~# ifconfig eth0 down
[   91.649324] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   91.656553] stm32-dwmac 5800a000.ethernet eth0: Link is Down
[   91.672475] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
root@lubancat:~# ifconfig eth0 up
[  108.589301] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[  108.597533] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[  108.620796] dwmac4: Master AXI performs any burst length
[  108.624688] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[  108.632229] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[  108.641048] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[  108.646857] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[  108.660790] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
root@lubancat:~# [  111.772307] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[  111.779364] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing

动态获取ip一直是这样:
root@lubancat:~# udhcpc -i eth0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover

使用静态IP ping电脑是没问题的
root@lubancat:~# ifconfig
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.10.2  netmask 255.255.255.0  broadcast 192.168.10.255
        ether 3e:ab:3b:fb:f4:91  txqueuelen 1000  (Ethernet)
        RX packets 291  bytes 29201 (28.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 5532 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 45  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 140  bytes 9672 (9.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 140  bytes 9672 (9.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
root@lubancat:~# ping 192.168.10.10
PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.
64 bytes from 192.168.10.10: icmp_seq=1 ttl=128 time=0.777 ms
64 bytes from 192.168.10.10: icmp_seq=2 ttl=128 time=0.462 ms
64 bytes from 192.168.10.10: icmp_seq=3 ttl=128 time=0.327 ms
^C
--- 192.168.10.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 31ms
rtt min/avg/max/mdev = 0.327/0.522/0.777/0.188 ms
root@lubancat:~#

感觉像设备树还是驱动没移植成功

回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-6-12 11:18:05 | 显示全部楼层
连上wifi执行udhcpc命令是能动态获取ip的,证明动态获取ip相关配置应该是没问题的
[root@star-mp157]:~$ ifconfig
lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 94:A1:A2:69:C4:50  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:254 (254.0 B)  TX bytes:248 (248.0 B)

[root@star-mp157]:~$ udhcpc -i wlan0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.137.83
udhcpc: lease of 192.168.137.83 obtained, lease time 604800
deleting routers
adding dns 192.168.137.1
[root@star-mp157]:~$

但获取eth0的动态ip就是不成功,是设备还是驱动需要修改?有大佬知道吗?
[root@star-mp157]:~$ udhcpc -i eth0
udhcpc: started, v1.31.1
[   49.832857] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   49.840959] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[   49.860348] dwmac4: Master AXI performs any burst length
[   49.864234] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[   49.872056] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   49.880558] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[   49.886381] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[   49.895610] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   49.902976] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   49.912397] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   49.919453] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
^C
[root@star-mp157]:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 5E:65:81:5C:65:AB  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1026 (1.0 KiB)
          Interrupt:45

lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[root@star-mp157]:~$
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-6-14 11:25:45 | 显示全部楼层
[root@star-mp157]:~$ ifconfig eth0 up
[   48.193921] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   48.201977] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[   48.221835] dwmac4: Master AXI performs any burst length
[   48.225722] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[   48.233230] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   48.241952] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[   48.247857] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[   48.257055] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   48.264728] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[root@star-mp157]:~$ [   52.412118] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   52.419342] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing

[root@star-mp157]:~$ udhcpc -i eth0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.22.76
udhcpc: lease of 192.168.22.76 obtained, lease time 7200
deleting routers
adding dns 192.168.25.2
adding dns 202.96.128.166


修改设备树将千兆改成百兆之后能够成功获取ip,感觉是配置千兆的时候哪里出问题了
回复 支持 反对

使用道具 举报

 楼主| 发表于 昨天 11:30 | 显示全部楼层
修改uboot的eth0相关的设备树,改相关引脚为开发板的引脚,然后将uboot的网口调试好能dhcp后千兆也能成功获取ip了,不是很清楚为什么uboot会影响内核的千兆动态获取ip但不影响百兆动态获取ip,但也算解决了,不管了
回复 支持 反对

使用道具 举报

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

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-6-25 15:45 , Processed in 0.132427 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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