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/BEAGLEBK: USB Gadget fails to start

Part Number: BEAGLEBK

Tool/software: Linux

Hi,

I am unable to connect  through SSH to Beaglebone Black booted from SD card with the am335x-evm-linux-04.01.00.06 image. I have noticed this error message during the booting process:

[FAILED] Failed to start Start USB gadget.

See 'systemctl status gadget-init.service' for details.

The result of the "systemctl status gadget-init.service" is the following:

[[0;1;31m●[[0m gadget-init.service - Start USB gadget
   Loaded: loaded (/lib/systemd/system/gadget-init.service; enabled; vendor preset: enabled)
   Active: [[0;1;31mfailed[[0m (Result: exit-code) since Tue 2017-09-26 21:31:46 UTC; 59s ago
  Process: 573 ExecStart=/usr/bin/gadget-init.sh [[0;1;31m(code=exited, status=1/FAILURE)[[0m
 Main PID: 573 (code=exited, status=1/FAILURE)

Sep 26 21:31:44 am335x-evm systemd[1]: Starting Start USB gadget...
Sep 26 21:31:44 am335x-evm gadget-init.sh[573]: SERIAL_NUMBER = 2016BBBK0C83
Sep 26 21:31:44 am335x-evm gadget-init.sh[573]: PRODUCT = BeagleBoneBlack
Sep 26 21:31:44 am335x-evm gadget-init.sh[573]: host_addr = 88:C2:55:4C:2C:DB
Sep 26 21:31:46 am335x-evm gadget-init.sh[573]: ifconfig: SIOCGIFFLAGS: No such device
Sep 26 21:31:46 am335x-evm gadget-init.sh[573]: ifconfig: SIOCSIFADDR: No such device
Sep 26 21:31:46 am335x-evm systemd[1]: [[0;1;39mgadget-init.service: Main process exited, code=exited, status=1/FAILURE[[0m
Sep 26 21:31:46 am335x-evm systemd[1]: [[0;1;31mFailed to start Start USB gadget.[[0m
Sep 26 21:31:46 am335x-evm systemd[1]: [[0;1;39mgadget-init.service: Unit entered failed state.[[0m
Sep 26 21:31:46 am335x-evm systemd[1]: [[0;1;39mgadget-init.service: Failed with result 'exit-code'.[[0m

I also include below the later messages from the boot, in case they can shed more light.

I am using Windows 10.

Thank you and regards

Adam

[FAILED] Failed to start Start USB gadget.

See 'systemctl status gadget-init.service' for details.
[   25.879576] 47401300.usb-phy supply vcc not found, using dummy regulator
[   25.985904] usbcore: registered new interface driver usbfs
[   25.985967] usbcore: registered new interface driver hub
[   25.986083] usbcore: registered new device driver usb
[   26.391188] using random self ethernet address
[   26.412558] using random host ethernet address
[   26.417082] using host ethernet address: 88:C2:55:4C:2C:DB[   26.515110] usin                  g random self ethernet address
[   26.577386] using random host ethernet address
[   26.628137] using host ethernet address: 88:C2:55:4C:2C:DB[   26.688222] usb0                  : HOST MAC 88:c2:55:4c:2c:db
[   26.749153] usb0: MAC 22:0c:05:e9:1d:09
[   26.906892] Mass Storage Function, version: 2009/09/11
[   26.912078] LUN: removable file: (no medium)
[   26.987692] LUN: removable read only file: /dev/mmcblk0p1
[   27.026340] Number of LUNs=1
[   27.069773] g_multi gadget: Multifunction Composite Gadget
[   27.121656] g_multi gadget: g_multi ready
[   27.168175] 47401b00.usb-phy supply vcc not found, using dummy regulator
[   27.294194] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[   27.299592] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus numbe                  r 1
[   27.420549] g_multi gadget: high-speed config #1: Multifunction with RNDIS
[   27.511557] ti-pruss 4a300000.pruss: creating PRU cores and other child platf                  orm devices
[   27.547155] irq: no irq domain found for /ocp/pruss_soc_bus@4a326000/pruss@4a                  300000/intc@4a320000 !
[   27.554258] irq: no irq domain found for /ocp/pruss_soc_bus@4a326000/pruss@4a                  300000/intc@4a320000 !
[   27.843504] hub 1-0:1.0: USB hub found
[   27.886456] hub 1-0:1.0: 1 port detected

  • The software team have been notified. They will respond here.
  • When you SSH to Beaglebone Black, do you connect to the ethernet port on Beaglebone Black or usb-ethernet port?
    When the SSH connection failed, what error message do you get on the host?
    Have you tried to SSH from a Linux PC?
  • Sorry for the delay, I was away from my office and could not check the messages.
    I SSH to Beaglebone Black through the usb-ethernet port. I used putty. The error message is a simple timeout. Pinging 192.168.7.2 also results in the timeout.
    I have just installed Ubuntu 16.04.3 LTS under VM Workstation Player 12 (I do not have a native Linux PC). Pinging 192.168.7.2 timeouts too.
    We use Windows in the computer rooms so this is why I insist on that OS. Thank you!
    Best regards,
    Adam
  • Do you have to use g_multi driver? If not please do the following steps after the board boots up.

    # modprobe -r g_multi
    # modprobe g_ether

    g_ether generates usb0 network interface on both the board and PC, then do your network settings.
  • Bin,

    Thank you very much. It worked partially.

    With this configuration (copied from the Debian):

    iface usb0 inet static
        address 192.168.7.2
        netmask 255.255.255.252
        network 192.168.7.0
        gateway 192.168.7.1

    I can not connect. The ping to 192.168.7.2 times out.

    However I discovered that the IP of the BBB is:

    ~# ip addr show usb0
    5: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
        link/ether ea:d1:22:af:ba:55 brd ff:ff:ff:ff:ff:ff
        inet6 fe80::e8d1:22ff:feaf:ba55/64 scope link
           valid_lft forever preferred_lft forever

    and I manage to connect using ipv6. The ipv6 address of the BBB changes with every reboot.

    How can I make the ipv6 address static?

    What should I do to make ipv4 working?

    Thank you!

  • Adam Podhorski said:

    With this configuration (copied from the Debian):

    iface usb0 inet static
        address 192.168.7.2
        netmask 255.255.255.252
        network 192.168.7.0
        gateway 192.168.7.1

    I assume you set this on the BBB. When you connect the BBB to host PC, the usb-ethernet gadget also creates a USB0 network interface on the host, you have to set a IP address for the host side USB0 interface as well, onto the same 192.168.7.0 subnet, then you should be able to talk to BBB via usb-ethernet gadget.

    Adam Podhorski said:
    How can I make the ipv6 address static?

    Sorry, I don't know much about ipv6.