NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-evbarm/60404: Beaglebone Black: nonfunctional usb wifi
>Number: 60404
>Category: port-evbarm
>Synopsis: Beaglebone Black: nonfunctional usb wifi
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: port-evbarm-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jul 04 17:50:00 +0000 2026
>Originator: Brook Milligan
>Release: NetBSD-current (2026-06-27) + pkgsrc-current (2026-06-27)
>Organization:
>Environment:
NetBSD armv7 11.99.6 NetBSD 11.99.6 (GENERIC) #0: Thu Jul 2 17:56:49 UTC 2026 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm
>Description:
NetBSD currently does not detect a usb wifi adapter (D-Link DWA-131,
RTL8192EU, supported by urtwn(4)) on the Beaglebone Black (BBB). More
specifically, NetBSD-current + the sysutils/u-boot-beagleboneblack
package (i.e., u-boot v2022.04) does not detect this usb wifi device.
Further, that combination does not even probe the usb bus for devices.
The same is true for NetBSD-current and u-boot versions 2020.04 and
2024.10.
In contrast, the combination of NetBSD-current + u-boot v2018.11 does
detect a usb wifi device with the urtwn(4) driver. However, the wifi
device is nonfunctional, and the kernel panics both during some boots
and when the wifi adapter is inserted.
This has been tested using four different system images described
below.
Debian: confirm hardware operation
----------------------------------
The BBB Debian image, based upon u-boot v2022.04, works correctly; the
adapter is detected, can be configured, and can communicate on the
network. A portion of dmesg is below:
[ 52.082790] usb 1-1: This Realtek USB WiFi dongle (0x2001:0x3319) is untested!
[ 52.177405] usb 1-1: Please report results to Jes.Sorensen%gmail.com@localhost
[ 52.910788] usb 1-1: Dumping efuse for RTL8192EU (0x200 bytes):
< 32 lines deleted >
[ 53.337856] usb 1-1: RTL8192EU rev B (SMIC) romver 0, 2T2R, TX queues 3, WiFi=1, BT=0, GPS=0, HI PA=0
[ 53.350459] usb 1-1: RTL8192EU MAC: a4:2a:95:46:ae:d1
[ 53.358582] usb 1-1: rtl8xxxu: Loading firmware rtlwifi/rtl8192eu_nic.bin
[ 53.409350] usb 1-1: Firmware revision 35.7 (signature 0x92e1)
[ 54.397817] usbcore: registered new interface driver rtl8xxxu
[ 54.999550] wlan0: authenticate with f4:52:46:6b:ce:b9 (local address=a4:2a:95:46:ae:d1)
[ 55.025466] wlan0: send auth to f4:52:46:6b:ce:b9 (try 1/3)
[ 55.052055] wlan0: authenticated
[ 55.069415] wlan0: associate with f4:52:46:6b:ce:b9 (try 1/3)
[ 55.097549] wlan0: RX AssocResp from f4:52:46:6b:ce:b9 (capab=0x1431 status=0 aid=3)
[ 55.127139] usb 1-1: rtl8xxxu_bss_info_changed: HT supported
[ 55.154676] wlan0: associated
[ 55.168787] wlan0: Limiting TX power to 30 (30 - 0) dBm as advertised by f4:52:46:6b:ce:b9
[ 57.206081] warning: `iwconfig' uses wireless extensions which will stop working for Wi-Fi 7 hardware; use nl80211
Note that this dmesg output was from a boot after the network
interface had been configured. The authenticated/associated messages
indicate that the wifi was active on the network.
ArmBSD: confirm driver failure
------------------------------
Booting an ArmBSD image,
NetBSD-HEAD-earmv7hf-20260702175649Z-bone-black.img, does not detect
the wifi adapter. The only usb-related (grep for "usb|uhub|motg")
parts in the dmesg output are the following:
[ 1.000000] NetBSD 11.99.6 (GENERIC) #0: Thu Jul 2 17:56:49 UTC 2026
[ 1.000000] mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC
[ 1.000000] tigateclk7 at am3prcm0: TI gate clock (usbotg_fck@47c)
[ 1.000000] tps65217pmic0: power sources USB max 1800 mA, [AC] max 2500 mA
[ 1.000000] tiotg0 at simplebus1: TI dual-port USB controller: version v1.0.0.13
[ 1.000004] /ocp/usb@47400000/control@44e10620 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401300 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/dma-controller@2000 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401b00 at tiotg0 not configured
[ 1.000004] motg0 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg0: interrupting on INTC irq 18
[ 1.000004] motg0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb0 at motg0: USB revision 2.0
[ 1.000004] motg1 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg1: interrupting on INTC irq 19
[ 1.000004] motg1: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb1 at motg1: USB revision 2.0
[ 1.683068] uhub0 at usb0: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.694313] uhub0: 1 port with 1 removable, self powered
[ 1.694313] uhub1 at usb1: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.704144] uhub1: 1 port with 1 removable, self powered
[ 1.000000] tigateclk7 at am3prcm0: TI gate clock (usbotg_fck@47c)
[ 1.000000] tps65217pmic0: power sources USB max 1800 mA, [AC] max 2500 mA
[ 1.000000] tiotg0 at simplebus1: TI dual-port USB controller: version v1.0.0.13
[ 1.000004] /ocp/usb@47400000/control@44e10620 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401300 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/dma-controller@2000 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401b00 at tiotg0 not configured
[ 1.000004] motg0 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg0: interrupting on INTC irq 18
[ 1.000004] motg0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb0 at motg0: USB revision 2.0
[ 1.000004] motg1 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg1: interrupting on INTC irq 19
[ 1.000004] motg1: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb1 at motg1: USB revision 2.0
[ 1.683068] uhub0 at usb0: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.694313] uhub0: 1 port with 1 removable, self powered
[ 1.694313] uhub1 at usb1: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.704144] uhub1: 1 port with 1 removable, self powered
Further, there are no console messages when the wifi adapter is removed/inserted.
NetBSD u-boot + custom kernel
-----------------------------
Booting a custom-built NetBSD-current image with u-boot v2022.04
responded the same as the ArmBSD image, i.e., it did not detect the
wifi adapter and no console messages appeared when the wifi adapter is
removed/inserted. The only usb-related (grep for "usb|uhub|motg")
parts in the dmesg output are the following:
[ 1.000000] NetBSD 11.99.6 (GENERIC) #0: Fri Jun 12 20:23:15 MDT 2026
[ 1.000000] root%src.cgri.net@localhost:/usr/src/netbsd-current/evbarm-earmv7hf/obj/usr/src/netbsd-current/src/sys/arch/evbarm/compile/GENERIC
[ 1.000000] tigateclk7 at am3prcm0: TI gate clock (usbotg_fck@47c)
[ 1.000000] tps65217pmic0: power sources USB max 1800 mA, [AC] max 2500 mA
[ 1.000000] tiotg0 at simplebus1: TI dual-port USB controller: version v1.0.0.13
[ 1.000004] /ocp/usb@47400000/control@44e10620 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401300 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/dma-controller@2000 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401b00 at tiotg0 not configured
[ 1.000004] motg0 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg0: interrupting on INTC irq 18
[ 1.000004] motg0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb0 at motg0: USB revision 2.0
[ 1.000004] motg1 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg1: interrupting on INTC irq 19
[ 1.000004] motg1: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb1 at motg1: USB revision 2.0
[ 1.683089] uhub0 at usb0: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.695494] uhub0: 1 port with 1 removable, self powered
[ 1.695494] uhub1 at usb1: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.705386] uhub1: 1 port with 1 removable, self powered
Dtrace tracking of uhub bus scanning:
# cat /etc/modules.conf
dtrace_fbt
dtrace_sdt
dtrace_syscall
# dtrace -n "usb:hub:explore:portstat { printf(\"dev=%d portno=%d status=0x %x change=0x%x reattach=%d\", arg0, arg1, arg2, arg3, arg4) }" -o /tmp/dtrace-drvctl-1.out
# drvctl -r uhub1
# cat /tmp/dtrace-drvctl-1.out
CPU ID FUNCTION:NAME
0 77 explore:portstat dev=2430797056 portno=0 status=0x 0 change=0x0 reattach=0
0 77 explore:portstat dev=2430797056 portno=1 status=0x 100 change=0x0 reattach=0
Rescanning uhub0 produced the same dtrace output, except the kernel address (dev=) was different.
NetBSD custom u-boot + custom kernel
------------------------------------
Booting a custom-built NetBSD-current image with u-boot v2018.11 _did_
detect the wifi adapter, but see below for a kernel panic. The only
usb-related (grep for "usb|uhub|motg|urtwn") parts in the dmesg output
are the following:
[ 1.000000] NetBSD 11.99.6 (GENERIC) #1: Wed Jun 17 14:48:24 MDT 2026
[ 1.000000] root%src.cgri.net@localhost:/usr/src/netbsd-current/evbarm-earmv7hf/obj/usr/src/netbsd-current/src/sys/arch/evbarm/compile/GENERIC
[ 1.000000] tigateclk5 at am3prcm0: TI gate clock (usbotg_fck)
[ 1.000000] tps65217pmic0: power sources USB max 1800 mA, [AC] max 2500 mA
[ 1.000000] tiotg0 at simplebus1: TI dual-port USB controller: version v1.0.0.13
[ 1.000004] /ocp/usb@47400000/control@44e10620 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401300 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/dma-controller@47402000 at tiotg0 not configured
[ 1.000004] /ocp/usb@47400000/usb-phy@47401b00 at tiotg0 not configured
[ 1.000004] motg0 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg0: interrupting on INTC irq 18
[ 1.000004] motg0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb0 at motg0: USB revision 2.0
[ 1.000004] motg1 at tiotg0: 0x4ea20800 version v0.0.0
[ 1.000004] motg1: interrupting on INTC irq 19
[ 1.000004] motg1: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM
[ 1.000004] usb1 at motg1: USB revision 2.0
[ 1.357324] uhub0 at usb0: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.368264] uhub0: 1 port with 1 removable, self powered
[ 1.377341] uhub1 at usb1: NetBSD (0x0000) MOTG root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.388703] uhub1: 1 port with 1 removable, self powered
[ 2.067330] urtwn0 at uhub1 port 1
[ 2.067330] urtwn0: Realtek (0x2001) Wireless N Nano USB Adapter (0x3319), rev 2.10/2.00, addr 2
[ 2.157325] urtwn0: MAC/BB RTL8192EU, RF 6052 2T2R, address a4:2a:95:46:ae:d1
[ 2.171598] urtwn0: 1 rx pipe, 3 tx pipes
Note the attachment of the urtwn(4) driver.
Dtrace tracking of the uhub bus scanning:
# cat /etc/modules.conf
dtrace_fbt
dtrace_sdt
dtrace_syscall
# dtrace -n "usb:hub:explore:portstat { printf(\"dev=%d portno=%d status=0x %x change=0x%x reattach=%d\", arg0, arg1, arg2, arg3, arg4) }" -o /tmp/dtrace-drvctl-1.out
# drvctl -r uhub1
# cat /tmp/dtrace-drvctl-1.out
CPU ID FUNCTION:NAME
0 77 explore:portstat dev=2430530304 portno=1 status=0x 503 change=0x0 reattach=0
Rescanning uhub0 produced the same dtrace output as with other kernels
(i.e., no success), except the kernel address (dev=) was different.
This is expected, because the wifi device is on uhub1 not uhub0.
# cat /etc/wpa_supplicant.conf
# $NetBSD: wpa_supplicant.conf,v 1.1 2019/01/12 16:51:54 roy Exp $
# Allow wpa_cli(8) to configure wpa_supplicant
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
network={
ssid="XXX"
scan_ssid=1
key_mgmt=WPA-PSK
psk="XXX"
}
# /etc/rc.d/wpa_supplicant onestart
Starting wpa_supplicant.
Jun 17 21:05:34 armv7 wpa_supplicant[1375]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
Jun 17 21:05:34 armv7 wpa_supplicant[1375]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
Jun 17 21:05:34 armv7 wpa_supplicant[1375]: ioctl[SIOCS80211, op=23, val=0, arg_len=0]: Invalid argument
armv7# ifconfig urtwn0
urtwn0: flags=0x8803<UP,BROADCAST,SIMPLEX,MULTICAST> mtu 1500
ssid "" nwkey 65536:"","","",""
powersave off
address: a4:2a:95:46:ae:d1
media: IEEE802.11 autoselect
status: no network
Console messages: removing the wifi adapter
[ 39.2973298] urtwn0: detached
[ 39.2973298] urtwn0: at uhub1 port 1 (addr 2) disconnected
Console messages: reinserting the wifi adapter -> kernel panic
[ 43.6973401] panic: kernel diagnostic assertion "ep->phase == IDLE" failed: file "/usr/src/netbsd-current/src/sys/dev/usb/motg.c", line 1355
[ 43.7100040] cpu0: Begin traceback...
[ 43.7100040] 0xa8295d0c: netbsd:db_panic+0x14
[ 43.7173345] 0xa8295d2c: netbsd:vpanic+0x10c
[ 43.7173345] 0xa8295d44: netbsd:kern_assert+0x40
[ 43.7290060] 0xa8295d7c: netbsd:motg_device_ctrl_start1+0x30c
[ 43.7377827] 0xa8295dac: netbsd:usbd_transfer+0xc0
[ 43.7473303] 0xa8295df4: netbsd:usbd_do_request_len+0xec
[ 43.7583854] 0xa8295e14: netbsd:usbd_do_request_flags+0x38
[ 43.7583854] 0xa8295e84: netbsd:usbd_get_initial_ddesc+0x44
[ 43.7688572] 0xa8295eec: netbsd:usbd_new_device+0x22c
[ 43.7773317] 0xa8295f4c: netbsd:uhub_explore+0x40c
[ 43.7873330] 0xa8295f7c: netbsd:usb_discover+0x5c
[ 43.7973327] 0xa8295fac: netbsd:usb_event_thread+0x8c
[ 43.8073337] cpu0: End traceback...
[ 43.8073337] dump to dev 92,1 not possible
[ 43.8176264] rebooting...
Kernel panic on second boot:
On the first boot, the filesystem is enlarged to fill the root device;
then the kernel reboots. This gets to the point of running /etc/rc,
but eventually panics at the same location as above with the
following:
[ 30.8273254] panic: kernel diagnostic assertion "ep->phase == IDLE" failed: file "/usr/src/netbsd-current/src/sys/dev/usb/motg.c", line 1355
[ 30.8400050] cpu0: Begin traceback...
[ 30.8400050] 0xa7a85d04: netbsd:db_panic+0x14
[ 30.8473285] 0xa7a85d24: netbsd:vpanic+0x10c
[ 30.8473285] 0xa7a85d3c: netbsd:kern_assert+0x40
[ 30.8586737] 0xa7a85d74: netbsd:motg_device_ctrl_start1+0x30c
[ 30.8673260] 0xa7a85da4: netbsd:usbd_transfer+0xc0
[ 30.8773317] 0xa7a85dec: netbsd:usbd_do_request_len+0xec
[ 30.8874058] 0xa7a85e0c: netbsd:usbd_do_request+0x2c
[ 30.8874058] 0xa7a85e3c: netbsd:urtwn_write_region_1+0x60
[ 30.8973325] 0xa7a85ec4: netbsd:urtwn_set_chan.constprop.0+0x2a8
[ 30.9073305] 0xa7a85f24: netbsd:urtwn_newstate_cb+0x2e0
[ 30.9173312] 0xa7a85f6c: netbsd:urtwn_task+0x9c
[ 30.9273348] 0xa7a85fac: netbsd:usb_task_thread+0xc8
[ 30.9373334] cpu0: End traceback...
[ 30.9373334] dump to dev 92,1 not possible
[ 30.9512689] rebooting...
>How-To-Repeat:
Insert a supported USB-A wifi adapter. I used a D-Link DWA-131 which
has an RTL8192EU chip and is supported by the urtwn(4) dirver.
The following describes booting four different images, which (i)
confirm functioning hardware using an official Debian image, (ii)
confirm non-functioning driver using a stock ArmBSD image, (iii)
replicate the previous but with an image compiled using only build.sh,
i.e., to test custom kernels, and (iv) boot an image with both a
custom u-boot and a custom kernel, i.e., to test the combinations.
Debian: confirm functioning hardware
------------------------------------
Boot the BBB Debian image from
https://www.beagleboard.org/distros/beaglebone-black-debian-13-5-2026-05-19-iot-v6-18-x.
Note that the web page indicates the Linux and u-boot versions, etc.
Specifically, this is based upon u-boot v2022.04, which is the same
version as in the sysutils/u-boot-beagleboneblack package.
Configure the wireless network, perhaps as follows:
# iwctl station wlan0 connect "SSID"
# iwctl --passphrase PASSPHRASE station wlan0 connect "SSID"
Confirm that the wifi adapter communicates as expected.
ArmBSD: confirm nonfunctioning driver
-------------------------------------
Boot a BBB ArmBSD image from
https://nycdn.netbsd.org/pub/arm/
I have used the following, but expect any version from the last
several years to have the same problem.
NetBSD-HEAD-earmv7hf-20260702175649Z-bone-black.img.gz
Note that the wifi adapter is not detected nor are any console
messages generated when the adaptor is removed/inserted.
NetBSD u-boot + custom kernel
-----------------------------
The ArmBSD images are helpful for quick testing, but not necessarily
for debugging, which likely requires a custom kernel. For
completeness, a system equivalent to an ArmBSD image may be created as
follows.
Compile and install the sysutils/u-boot-beagleboneblack package.
Build a NetBSD release using build.sh with the following make variable
defined:
INSTALLBOOT_BOARDS=ti,am335x-bone-black
Note that if packages are installed in an unusual location, the
environment variable INSTALLBOOT_UBOOT_PATHS may need to be defined as
well.
In this way, build.sh will create a bootable disk image that is
identical to the equivalent ArmBSD image, but that allows local
modification of the kernel (or anything else):
release/binary/gzimg/armv7-ti,am335x-bone-black.img.gz
Boot this image and observe the same problems as for the ArmBSD image.
NetBSD custom u-boot + custom kernel
------------------------------------
For debugging, i.e., exploring combinations of u-boot + kernel, the
prior setup can be used to build images with alternate u-boot versions
(as well as modified NetBSD system code, of course). The following
describes how I tested u-boot v2018.11 with NetBSD-current, but can be
easily adapted for other u-boot versions. I have tried u-boot
versions 2018.11, 2020.04, 2022.04, and 2024.10; only the first
dectects the wifi adapter as illustrated above.
Copy the sysutils/u-boot-beagleboneblack package to a new location:
sysutils/u-boot-beagleboneblack-2018.11
Modify the UBOOT_VERSION variable in the package Makefile. Build and
install the package. Although changing the UBOOT_VERSION was
sufficient for the last three u-boot versions tested, for u-boot
v2018.11 I needed to patch an additional file. The complete
differences are the following:
--- sysutils/u-boot-beagleboneblack/Makefile 2026-06-16 18:45:40.448960684 -0600
+++ sysutils/u-boot-beagleboneblack-2018.11/Makefile 2026-07-04 08:33:00.884374990 -0600
@@ -7,10 +7,10 @@
UBOOT_INSTALLBOOT_PLIST= installboot.plist
-UBOOT_VERSION= 2022.04
+UBOOT_VERSION= 2018.11
-PKGREVISION= 1
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Darwin"
-- /dev/null 2026-07-04 05:30:32.844521483 -0600
+++ sysutils/u-boot-beagleboneblack-2018.11/patches/patch-tools_imx__cntr__image.sh 2026-06-17 11:40:37.576874663 -0600
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- tools/imx_cntr_image.sh.orig 2026-06-17 11:56:05.331108242 +0000
++++ tools/imx_cntr_image.sh
+@@ -10,7 +10,7 @@ file=$1
+ blobs=`awk '/^APPEND/ {print $2} /^IMAGE/ || /^DATA/ {print $3}' $file`
+ for f in $blobs; do
+ tmp=$srctree/$f
+- if [ $f == "u-boot-dtb.bin" ]; then
++ if [ $f = "u-boot-dtb.bin" ]; then
+ continue
+ fi
+
Once the custom u-boot package is installed, build a NetBSD release
using build.sh as above with the following make variable defined:
INSTALLBOOT_BOARDS=ti,am335x-bone-black
and optionally with INSTALLBOOT_UBOOT_PATHS defined. Boot the
resulting image
release/binary/gzimg/armv7-ti,am335x-bone-black.img.gz
>Fix:
Home |
Main Index |
Thread Index |
Old Index