您尚未登录。

楼主 # 2024-05-20 09:51:11

gerryqd
会员
注册时间: 2021-11-22
已发帖子: 12
积分: 7

UBOOT 下的 RNDIS 功能工作异常

(如下 log 获取自 orangepi_one, 基于H61X 的 orangepi zero3, zero2w 也有一样的问题)
我在最新的uboot 上,尝试使用 RNDIS 功能,
uboot 中做了如下设置,

setenv ethact usb_ether
setenv ipaddr 192.168.2.100
setenv serverip 192.168.2.1

然后尝试使用 tftpboot zImage 来获取文件, 工作正常

=> tftpboot zImage
sun8i_emac_eth_start: Timeout
musb-hdrc: peripheral reset irq lost!
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
Using usb_ether device
TFTP from server 192.168.2.1; our IP address is 192.168.2.100
Filename 'zImage'.
Load address: 0x42000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ########################################################
         7.5 MiB/s
done
Bytes transferred = 4624880 (4691f0 hex)

相应的 host 上的 kernel log 如下,

May 19 18:43:07 home-hp kernel: [165318.600356] usb 1-4.4: new high-speed USB device number 96 using xhci_hcd 
May 19 18:43:07 home-hp kernel: [165318.800933] usb 1-4.4: config 1 has 0 interfaces, different from the descriptor's value: 1
May 19 18:43:07 home-hp kernel: [165318.801104] usb 1-4.4: New USB device found, idVendor=1f3a, idProduct=1010, bcdDevice= 3.15
May 19 18:43:07 home-hp kernel: [165318.801113] usb 1-4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 19 18:43:07 home-hp kernel: [165318.801118] usb 1-4.4: Product: RNDIS/Ethernet Gadget
May 19 18:43:07 home-hp kernel: [165318.801123] usb 1-4.4: Manufacturer: Allwinner Technology
May 19 18:43:07 home-hp kernel: [165318.808655] rndis_host 1-4.4:2.0 eth0: register 'rndis_host' at usb-0000:00:14.0-4.4, RNDIS device, f8:dc:7a:00:00:01  

但是, 如果我再一次尝试下载文件, 就会出现如下问题,

=> tftpboot zImage
The remote end did not respond in time.sun8i_emac_eth_start: Timeout
=>

相应的 host 上的 kernel log 如下,

May 19 18:43:14 home-hp kernel: [165326.024807] usb 1-4.4: new high-speed USB device number 97 using xhci_hcd
May 19 18:43:14 home-hp kernel: [165326.205127] usb 1-4.4: device descriptor read/64, error -71
May 19 18:43:15 home-hp kernel: [165326.493131] usb 1-4.4: device descriptor read/64, error -71
May 19 18:43:15 home-hp kernel: [165326.780864] usb 1-4.4: new high-speed USB device number 98 using xhci_hcd
May 19 18:43:15 home-hp kernel: [165326.961192] usb 1-4.4: device descriptor read/64, error -71
May 19 18:43:15 home-hp kernel: [165327.248946] usb 1-4.4: device descriptor read/64, error -71
May 19 18:43:15 home-hp kernel: [165327.357290] usb 1-4-port4: attempt power cycle
May 19 18:43:16 home-hp kernel: [165328.061235] usb 1-4.4: new high-speed USB device number 99 using xhci_hcd
May 19 18:43:16 home-hp kernel: [165328.061391] usb 1-4.4: Device not responding to setup address.
May 19 18:43:16 home-hp kernel: [165328.269369] usb 1-4.4: Device not responding to setup address.
May 19 18:43:17 home-hp kernel: [165328.477045] usb 1-4.4: device not accepting address 99, error -71

以后再次尝试也无法恢复, 除非重启

在网上找了很久,没有线索,是不是和 auto suspend 有关?
各位有遇到这种情况的吗?
------------------------
先发到了 https://bbs.aw-ol.com/topic/5413/uboot-%E4%B8%8B%E7%9A%84-rndis-%E5%8A%9F%E8%83%BD%E5%B7%A5%E4%BD%9C%E5%BC%82%E5%B8%B8, 借一下这里的人气:)

离线

楼主 #1 2024-05-21 14:59:59

gerryqd
会员
注册时间: 2021-11-22
已发帖子: 12
积分: 7

Re: UBOOT 下的 RNDIS 功能工作异常

host 端的一段更详细的log 如下,

May 17 12:47:47 officehp kernel: usb 1-10.3: USB disconnect, device number 65
May 17 12:47:50 officehp kernel: usb 1-10.2: USB disconnect, device number 64
May 17 12:48:51 officehp kernel: usb 1-10.2: new high-speed USB device number 66 using xhci_hcd
May 17 12:48:51 officehp kernel: usb 1-10.2: config 1 has 0 interfaces, different from the descriptor's value: 1
May 17 12:48:51 officehp kernel: usb 1-10.2: New USB device found, idVendor=1f3a, idProduct=1010, bcdDevice= 3.15
May 17 12:48:51 officehp kernel: usb 1-10.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 17 12:48:51 officehp kernel: usb 1-10.2: Product: RNDIS/Ethernet Gadget
May 17 12:48:51 officehp kernel: usb 1-10.2: Manufacturer: Allwinner Technology
May 17 12:48:51 officehp networkd-dispatcher[673]: WARNING:Unknown index 18 seen, reloading interface list
May 17 12:48:51 officehp kernel: rndis_host 1-10.2:2.0 usb0: register 'rndis_host' at usb-0000:00:14.0-10.2, RNDIS device, de:ad:be:ef:00:00
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.4973] manager: (usb0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/18)
May 17 12:48:51 officehp mtp-probe[56505]: checking bus 1, device 66: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10.2"
May 17 12:48:51 officehp mtp-probe[56505]: bus: 1, device: 66 was not an MTP device
May 17 12:48:51 officehp systemd-udevd[56503]: Using default interface naming scheme 'v249'.
May 17 12:48:51 officehp kernel: rndis_host 1-10.2:2.0 enxdeadbeef0000: renamed from usb0
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5153] device (usb0): interface index 18 renamed iface from 'usb0' to 'enxdeadbeef0000'
May 17 12:48:51 officehp systemd-networkd[585]: usb0: Interface name change detected, renamed to enxdeadbeef0000.
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5246] device (enxdeadbeef0000): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5251] device (enxdeadbeef0000): carrier: link connected
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5261] settings: (enxdeadbeef0000): created default wired connection 'Wired connection 2'
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5264] device (enxdeadbeef0000): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
May 17 12:48:51 officehp systemd-networkd[585]: enxdeadbeef0000: Link UP
May 17 12:48:51 officehp systemd-networkd[585]: enxdeadbeef0000: Gained carrier
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5280] policy: auto-activating connection 'Wired connection 2' (7f021469-60a3-30b2-86e3-778fadf57401)
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5307] device (enxdeadbeef0000): Activation: starting connection 'Wired connection 2' (7f021469-60a3-30b2-86e3-778fadf57401)
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5308] device (enxdeadbeef0000): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5311] device (enxdeadbeef0000): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5314] device (enxdeadbeef0000): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
May 17 12:48:51 officehp mtp-probe[56519]: checking bus 1, device 66: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10.2"
May 17 12:48:51 officehp mtp-probe[56519]: bus: 1, device: 66 was not an MTP device
May 17 12:48:51 officehp NetworkManager[663]: <info>  [1715921331.5365] dhcp4 (enxdeadbeef0000): activation: beginning transaction (timeout in 45 seconds)
May 17 12:48:51 officehp avahi-daemon[660]: Joining mDNS multicast group on interface enxdeadbeef0000.IPv6 with address fe80::b649:fe99:87af:133a.
May 17 12:48:51 officehp avahi-daemon[660]: New relevant interface enxdeadbeef0000.IPv6 for mDNS.
May 17 12:48:51 officehp avahi-daemon[660]: Registering new address record for fe80::b649:fe99:87af:133a on enxdeadbeef0000.*.
May 17 12:48:51 officehp systemd-udevd[56507]: Using default interface naming scheme 'v249'.
May 17 12:48:52 officehp systemd-networkd[585]: enxdeadbeef0000: Gained IPv6LL
May 17 12:48:54 officehp ModemManager[866]: <info>  [base-manager] couldn't check support for device '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10.2': not supported by any plugin
May 17 12:49:11 officehp systemd-networkd[585]: enxdeadbeef0000: Link DOWN
May 17 12:49:11 officehp avahi-daemon[660]: Interface enxdeadbeef0000.IPv6 no longer relevant for mDNS.
May 17 12:49:11 officehp systemd-networkd[585]: enxdeadbeef0000: Lost carrier
May 17 12:49:11 officehp kernel: usb 1-10.2: USB disconnect, device number 66
May 17 12:49:11 officehp kernel: rndis_host 1-10.2:2.0 enxdeadbeef0000: unregister 'rndis_host' usb-0000:00:14.0-10.2, RNDIS device
May 17 12:49:11 officehp avahi-daemon[660]: Leaving mDNS multicast group on interface enxdeadbeef0000.IPv6 with address fe80::b649:fe99:87af:133a.
May 17 12:49:11 officehp avahi-daemon[660]: Withdrawing address record for fe80::b649:fe99:87af:133a on enxdeadbeef0000.
May 17 12:49:11 officehp NetworkManager[663]: <info>  [1715921351.7017] device (enxdeadbeef0000): state change: ip-config -> unmanaged (reason 'removed', sys-iface-state: 'removed')
May 17 12:49:11 officehp NetworkManager[663]: <info>  [1715921351.7189] dhcp4 (enxdeadbeef0000): canceled DHCP transaction
May 17 12:49:23 officehp kernel: usb 1-10.2: new high-speed USB device number 67 using xhci_hcd
May 17 12:49:23 officehp kernel: usb 1-10.2: device descriptor read/64, error -71
May 17 12:49:24 officehp kernel: usb 1-10.2: device descriptor read/64, error -71
May 17 12:49:24 officehp kernel: usb 1-10.2: new high-speed USB device number 68 using xhci_hcd
May 17 12:49:24 officehp kernel: usb 1-10.2: device descriptor read/64, error -71
May 17 12:49:24 officehp kernel: usb 1-10.2: device descriptor read/64, error -71
May 17 12:49:24 officehp kernel: usb 1-10-port2: attempt power cycle
May 17 12:49:25 officehp kernel: usb 1-10.2: new high-speed USB device number 69 using xhci_hcd

感觉行为如下:

开始使用 -> 接口 UP --> 使用 --> 接口 down --> 再次尝试使用,尝试 up 接口 失败。

----------

各位没有用过这个功能吗?

用 sunxi-fel 比用 usb 网络这个要慢。

离线

页脚

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

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