no IP address on USB on BBB with custom image

I have an image build script largely duplicating the console image that I haven’t run for a few months. When I build the image now and boot it up it doesn’t have the usb0/usb1 networks set up properly. Normally, they have 192.168.7.2 and 192.168.6.2 IP addresses assigned, but not now. Has anything changed recently in how that is done? What might be the cause of the usb not being assigned an IP address on my image?

Here’s the output from /opt/scripts/tools/version.sh:

git:/opt/scripts/:[674bb55e34e94e3837f4f55790c7d1a52c9e149f]
eeprom:[A335BNLT000C1826BBBG0761]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[Pocket NC Debian Buster Image 2022-08-25]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-UIO-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.bb.org-overlays]
kernel:[4.19.94-ti-rt-r57]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-customizations]:[1.20220802.0-0~buster+20220802]
pkg:[bb-usb-gadgets]:[1.20220816.0-0~buster+20220816]
pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~buster+20211222]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet ostree=/ostree/boot.1/kinetic/6f8b2f41a31ac23974280fcc69a5e23ae86855b521a7b493e410cf6c4a80c74c/0]
dmesg | grep remote
[   61.017077] remoteproc remoteproc0: wkup_m3 is available
[   61.048537] remoteproc remoteproc0: powering up wkup_m3
[   61.048568] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[   61.048884] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[    1.305070] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    1.323697] gpio-of-helper ocp:cape-universal: ready
END

Hi @pocketnc_john with Buster nothing should have changed…

For Debian Bullseye and Ubuntu Focal, i’ve moved from this older usb0/usb1 configuration to something that is more reliable… This new feature is locked around the rfs_use_systemdnetworkd="enable" option… (and relies on a newer systemd feature for gadget devices…)

For buster, what does:

journalctl | grep am335x

show?

PS, feel free to do a pull request and get your config added to: omap-image-builder/configs at master · RobertCNelson/omap-image-builder · GitHub i can add it to the ci/etc… to help migrate any things that break…

Regards,

Feb 14 10:11:59 pocketnc kernel: am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
Feb 14 10:11:59 pocketnc kernel: am335x-phy-driver 47401300.usb-phy: Linked as a consumer to regulator.0
Feb 14 10:11:59 pocketnc kernel: am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
Feb 14 10:11:59 pocketnc kernel: am335x-phy-driver 47401b00.usb-phy: Linked as a consumer to regulator.0
Aug 25 21:12:37 pocketnc sh[738]: generic-board-startup: [startup script=/opt/scripts/boot/am335x_evm.sh]
Aug 25 21:12:38 pocketnc sh[738]: am335x_evm: usb_image_file=[/var/local/usb_mass_storage.img]
Aug 25 21:12:38 pocketnc sh[738]: am335x_evm: cpsw: ethernet@4a100000/slave@4a100200/mac-address
Aug 25 21:12:39 pocketnc sh[738]: am335x_evm: cpsw: C8:DF:84:DA:1A:9F
Aug 25 21:12:39 pocketnc sh[738]: am335x_evm: cpsw: [C8:DF:84:DA:1A:9F] [C8:DF:84:DA:1A] [9F]
Aug 25 21:12:42 pocketnc sh[738]: am335x_evm: use_libcomposite
Aug 25 21:12:43 pocketnc sh[738]: am335x_evm: FIXME: no valid drive to share over usb
Aug 25 21:12:43 pocketnc sh[738]: am335x_evm: Looking for libcomposite
Aug 25 21:12:43 pocketnc sh[738]: am335x_evm: FIXME: need to bring down g_multi first, before running a second time.
Aug 25 21:12:43 pocketnc sh[738]: am335x_evm: dnsmasq: setting up for usb0/usb1
Aug 25 21:12:48 pocketnc kernel: remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
Aug 26 01:21:22 pocketnc sudo[4883]: pocketnc : TTY=pts/2 ; PWD=/usr/opt/scripts/boot ; USER=root ; COMMAND=./am335x_evm.sh

that is new… for some reason it already got loaded… something changed…

Regards,

Yeah, I just checked the latest buster console image I could find and it behaves the same way:
https://rcn-ee.com/rootfs/bb.org/testing/2022-08-23/buster-console-armhf/bone-debian-10.12-console-armhf-2022-08-23-1gb.img.xz

It looks like there is a bb-usb-gadgets.service that is starting the bb-start-usb-gadgets script, which is creating g_multi. Does that mean anything to you?

thanks @pocketnc_john you nailed it… that service file needs to be under the rfs_use_systemdnetworkd enablement…

Sorry about that!

Hi @pocketnc_john quick test build:

https://rcn-ee.net/rootfs/bb.org/testing/2022-08-26/buster-console-armhf/

( just a test, this will be rolled into the regularly monthly builds on the 1st )

looks good…

root@beaglebone:~# journalctl | grep am335x
Feb 14 10:12:02 beaglebone kernel: am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
Feb 14 10:12:02 beaglebone kernel: am335x-phy-driver 47401300.usb-phy: Linked as a consumer to regulator.0
Feb 14 10:12:02 beaglebone kernel: am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
Feb 14 10:12:02 beaglebone kernel: am335x-phy-driver 47401b00.usb-phy: Linked as a consumer to regulator.0
Aug 26 16:06:04 beaglebone kernel: remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
Aug 26 16:53:10 beaglebone sh[640]: generic-board-startup: [startup script=/opt/scripts/boot/am335x_evm.sh]
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: usb_image_file=[/var/local/usb_mass_storage.img]
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: cpsw: ethernet@4a100000/slave@4a100200/mac-address
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: cpsw: 34:03:DE:A2:C0:C1
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: cpsw: [34:03:DE:A2:C0:C1] [34:03:DE:A2:C0] [C1]
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: use_libcomposite
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: FIXME: no valid drive to share over usb
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: Looking for libcomposite
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: modprobe libcomposite
Aug 26 16:53:10 beaglebone sh[640]: am335x_evm: Creating g_multi
Aug 26 16:53:11 beaglebone sh[640]: /opt/scripts/boot/am335x_evm.sh: 468: echo: echo: I/O error
Aug 26 16:53:11 beaglebone sh[640]: am335x_evm: g_multi Created
Aug 26 16:53:11 beaglebone sh[640]: am335x_evm: Starting usb0 network
Aug 26 16:53:11 beaglebone sh[640]: am335x_evm: Starting usb1 network
Aug 26 16:53:11 beaglebone sh[640]: am335x_evm: dnsmasq: setting up for usb0/usb1
Aug 26 16:53:15 beaglebone sh[640]: am335x_evm: systemctl: disable bb-bbai-tether.service
Aug 26 16:53:17 beaglebone sh[640]: am335x_evm: systemctl: bb-wl18xx-bluetooth.service
Aug 26 16:53:20 beaglebone sh[640]: am335x_evm: systemctl: bb-wl18xx-wlan0.service
root@beaglebone:~# ifconfig -a
can0: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 42  

can1: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 43  

eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.3.124  netmask 255.255.252.0  broadcast 192.168.3.255
        inet6 fe80::3603:deff:fea2:c0c1  prefixlen 64  scopeid 0x20<link>
        ether 34:03:de:a2:c0:c1  txqueuelen 1000  (Ethernet)
        RX packets 6923  bytes 1137561 (1.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 102  bytes 10138 (9.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 55  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 84  bytes 7004 (6.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 84  bytes 7004 (6.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255
        ether 34:03:de:a2:c0:c3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.6.2  netmask 255.255.255.0  broadcast 192.168.6.255
        ether 34:03:de:a2:c0:c7  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Regards,

That fixed my image as well. Thanks Robert!