This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/BEAGLEBN: Unable to obtain IP address via g_ether / RNDIS usb0 interface

Part Number: BEAGLEBN
Other Parts Discussed in Thread: AM3352, TPS65217

Tool/software: Linux

Hi,

I have configured the kernel for g_ether/RNDIS built-in support.

However, the BBB keeps sending DHCP requests on eth0 interface. While I expect that the DHCP request be sent on usb0 interface.

On the host side, I configured my DHCP for usb0 interface. In fact, I am able to find the link when i ifconfig on the host.

Pasted below in an except form target boo log:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.32-gadde2ca9f8 (vishnu@vishnuavula) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #2 PREEM
PT Thu Sep 14 00:47:52 CEST 2017
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: TI AM335x BeagleBone Black
[    0.000000] cma: Reserved 48 MiB at 0x9d000000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon )
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/nfs nfsroot=192.168.7.1:/home/vishnu/ti-processor-sdk-linux-am3
35x-evm-03.02.00.05/targetNFS,nolock,v3,tcp,rsize=4096,wsize=4096 rw ip=dhcp

....

[    1.075424] libphy: 4a101000.mdio: probed
[    1.079462] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.089373] cpsw 4a100000.ethernet: Detected MACID = 68:9e:19:b4:f2:22
[    1.096139] cpsw 4a100000.ethernet: cpts: overflow check period 850
[    1.105302] 47401300.usb-phy supply vcc not found, using dummy regulator
[    1.135555] 47401b00.usb-phy supply vcc not found, using dummy regulator
[    1.179954] using random self ethernet address
[    1.184527] using random host ethernet address
[    1.189548] usb0: HOST MAC 82:5a:f7:ec:61:05
[    1.193974] usb0: MAC c2:f0:5d:18:f4:84
[    1.197861] using random self ethernet address
[    1.202345] using random host ethernet address
[    1.206893] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    1.213594] g_ether gadget: g_ether ready
[    1.218107] mousedev: PS/2 mouse device common for all mice
[    1.224305] i2c /dev entries driver
[    1.228816] cpuidle: enable-method property 'ti,am3352' found operations
[    1.236406] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.313617] ledtrig-cpu: registered to indicate activity on CPUs
[    1.326356] NET: Registered protocol family 10
[    1.332533] sit: IPv6 over IPv4 tunneling driver
[    1.338062] NET: Registered protocol family 17
[    1.344031] Key type dns_resolver registered
[    1.350547] omap_voltage_late_init: Voltage driver support not added
[    1.379605] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.385280] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.392276] mmc1: MAN_BKOPS_EN bit is not set
[    1.405800] mmc1: new high speed MMC card at address 0001
[    1.411839] mmcblk0: mmc1:0001 S10004 3.56 GiB
[    1.416725] mmcblk0boot0: mmc1:0001 S10004 partition 1 4.00 MiB
[    1.422933] mmcblk0boot1: mmc1:0001 S10004 partition 2 4.00 MiB
[    1.429888]  mmcblk0: p1
[    1.514504] tda998x 0-0070: found TDA19988
[    1.519918] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops)
[    1.526011] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.532734] [drm] No driver support for vblank timestamp query.
[    1.539002] tilcdc 4830e000.lcdc: No connectors reported connected with modes
[    1.546206] [drm] Cannot find any crtc or sizes - going 1024x768
[    1.560398] Console: switching to colour frame buffer device 128x48
[    1.571673] tilcdc 4830e000.lcdc: fb0:  frame buffer device
[    1.602272] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
[    1.608296] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.615294] at24 2-0054: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.622488] at24 2-0055: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.629552] at24 2-0056: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.636729] at24 2-0057: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.643688] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    1.649743] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
[    1.658049] hctosys: unable to open rtc device (rtc0)
[    1.680119] net eth0: initializing cpsw version 1.12 (0)
[    1.685564] net eth0: initialized cpsw ale version 1.4
[    1.690724] net eth0: ALE Table size 1024
[    1.697236] net eth0: phy found : id is : 0x7c0f1
[    1.702017] libphy: PHY 4a101000.mdio:01 not found
[    1.706859] net eth0: phy "4a101000.mdio:01" not found on slave 1, err -19
[    1.719501] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    1.742333] Sending DHCP requests ......
[   77.712261] random: nonblocking pool is initialized
[   87.602220]  timed out!
[   87.638756] IP-Config: Retrying forever (NFS root)...
[   87.644125] net eth0: initializing cpsw version 1.12 (0)
[   87.649488] net eth0: initialized cpsw ale version 1.4
[   87.654771] net eth0: ALE Table size 1024
[   87.661890] net eth0: phy found : id is : 0x7c0f1
[   87.666880] libphy: PHY 4a101000.mdio:01 not found
[   87.671721] net eth0: phy "4a101000.mdio:01" not found on slave 1, err -19
[   87.685369] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   87.702458] Sending DHCP requests ...... timed out!
[  175.293695] IP-Config: Retrying forever (NFS root)...

Requesting your guidance to resolve this issue. Thank you!

Best regards,

Vishnu

  • We're looking into this. Feedback will be posted here.

    Best Regards,
    Yordan
  • Hi Vishnu,

    Could you install Wireshard program on your host PC and make a capture on the USB interface.
    www.wireshark.org/download.html
    As I seeing in the booting log:
    [ 87.702458] Sending DHCP requests ...... timed out!
    the board sending DHCP request. I would like to see what happens with DHCP communication.

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    Here is my finding so far:

    Description of setup:
    DHCP server on HOST is UP and running on USB0 at 192.168.7.1
    U-boot connected to taget via IPoverUSB. BBB target is assigned an ip=dhcp address in uboot and fetches zImage and .dtb files.
    Booting progresses on target --> DHCPServer goes down on HOST--> Target unable to request IP and runs into a loop.


    Snippet from /var/log/syslog [HOST side]
    ...
    Sep 18 22:07:09 vishnuavula systemd[1]: Started ifup for usb0.
    Sep 18 22:07:09 vishnuavula systemd[1]: Starting ifup for usb0...
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> (usb0): created default wired connection 'Wired connection 1'
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> devices added (path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/net/usb0, iface: usb0)
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> locking wired connection setting
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> get unmanaged devices count: 1
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> (usb0): device state change: unavailable -> unmanaged (reason 'unmanaged') [20 10 3]
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> (usb0): link disconnected
    Sep 18 22:07:09 vishnuavula kernel: [191508.346762] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
    Sep 18 22:07:09 vishnuavula avahi-daemon[699]: Joining mDNS multicast group on interface usb0.IPv4 with address 192.168.7.1.
    Sep 18 22:07:09 vishnuavula avahi-daemon[699]: IP_ADD_MEMBERSHIP failed: No buffer space available
    Sep 18 22:07:09 vishnuavula avahi-daemon[699]: Registering new address record for 192.168.7.1 on usb0.IPv4.
    Sep 18 22:07:09 vishnuavula NetworkManager[676]: <info> (usb0): link connected
    Sep 18 22:07:09 vishnuavula kernel: [191508.357890] cdc_ether 1-1:1.0 usb0: kevent 12 may have been dropped
    Sep 18 22:07:09 vishnuavula kernel: [191508.357947] cdc_ether 1-1:1.0 usb0: kevent 12 may have been dropped
    Sep 18 22:07:09 vishnuavula systemd[1]: start request repeated too quickly for isc-dhcp-server.service
    Sep 18 22:07:09 vishnuavula systemd[1]: Failed to start ISC DHCP IPv4 server.
    Sep 18 22:07:09 vishnuavula systemd[1]: isc-dhcp-server.service failed.
    ...


    isc-dhcp-server status [HOST side]
    ● isc-dhcp-server.service - ISC DHCP IPv4 server
    Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
    Active: failed (Result: start-limit) since ma. 2017-09-18 22:07:05 CEST; 22min ago
    Docs: man:dhcpd(8)
    Process: 906 ExecStart=/bin/sh -ec CONFIG_FILE=/etc/dhcp/dhcpd.conf; if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi; [ -e /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases; chown root:root /var/lib/dhcp /var/lib/dhcp/dhcpd.leases*; exec dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf $CONFIG_FILE $INTERFACES (code=killed, signal=TERM)
    Process: 903 ExecStartPre=/bin/chown dhcpd:dhcpd /run/dhcp-server (code=exited, status=0/SUCCESS)
    Main PID: 906 (code=killed, signal=TERM)

    sep. 18 22:07:05 vishnuavula sh[906]: Wrote 0 new dynamic host decls to leases file.
    sep. 18 22:07:05 vishnuavula sh[906]: Wrote 1 leases to leases file.
    sep. 18 22:07:05 vishnuavula systemd[1]: Stopping ISC DHCP IPv4 server...
    sep. 18 22:07:05 vishnuavula systemd[1]: start request repeated too quickly for isc-dhcp-server.service
    sep. 18 22:07:05 vishnuavula systemd[1]: Failed to start ISC DHCP IPv4 server.
    sep. 18 22:07:05 vishnuavula systemd[1]: Unit isc-dhcp-server.service entered failed state.
    sep. 18 22:07:05 vishnuavula systemd[1]: isc-dhcp-server.service failed.
    sep. 18 22:07:09 vishnuavula systemd[1]: start request repeated too quickly for isc-dhcp-server.service
    sep. 18 22:07:09 vishnuavula systemd[1]: Failed to start ISC DHCP IPv4 server.
    sep. 18 22:07:09 vishnuavula systemd[1]: isc-dhcp-server.service failed.


    Wireshark capture on USB0 [HOST side]
    DHCP request packets from the client were indeed captured

  • Hi,

    The usb0 interface is unpredictable. Sometimes, it listed on the host side (while BBB target is in Uboot shell) and sometimes I need to manually ifup usb0. Even so, the dhcp server binds to the usb0 interface only randomly.

    This is clearly the reason why the target is not assigned an IP and the uImage is not loaded and even if it loads, the booting fails waiting for DHCP at kernel stage.

    Kindly help!

    Best regards,

    Vishnu