2

I have a Raspberry Pi Zero 2W, which I purchased because it is 64-bit and small.

When I run a 32-bit OS like Raspbian on it, everything works.

When I run a 64-bit OS like Ubuntu 22.04 Server arm64, it starts, displays to HDMI, and can connect to WiFi etc, but nothing on the USB line works.

lsusb lists only:

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg doesn't show any errrors.

I read somewhere that late last year people were running Ubuntu 20.04 (previous LTS release) Server arm64 with the Raspberry Pi 3B+ device tree. However, the RPi0-2 has been listed as supported by the current Ubuntu 22.04 Server arm64 in the Raspberry Pi Imager.

I'm using the same USB cable and devices in both situations so unless there's something special about the USB cable and 64-bit OSs, I don't think that's a problem. I suppose is possible it's a driver issue with not pulling up the right pin because of a miscalculation...maybe, but I'm really clutching at straws here.

The output of lsmod looks like this:

$ lsmod
Module                  Size  Used by
cmac                   16384  3
algif_hash             24576  1
algif_skcipher         20480  1
af_alg                 32768  6 algif_hash,algif_skcipher
bnep                   32768  2
hci_uart              155648  1
btqca                  24576  1 hci_uart
btrtl                  24576  1 hci_uart
btbcm                  28672  1 hci_uart
btintel                45056  1 hci_uart
bluetooth             716800  29 btrtl,btqca,btintel,hci_uart,btbcm,bnep
ecdh_generic           16384  2 bluetooth
ecc                    36864  1 ecdh_generic
brcmfmac              421888  0
brcmutil               28672  1 brcmfmac
cfg80211              970752  1 brcmfmac
bcm2835_isp            36864  0
bcm2835_v4l2           49152  0
bcm2835_codec          53248  0
bcm2835_mmal_vchiq     40960  3 bcm2835_codec,bcm2835_v4l2,bcm2835_isp
v4l2_mem2mem           45056  1 bcm2835_codec
videobuf2_vmalloc      20480  1 bcm2835_v4l2
videobuf2_dma_contig    24576  2 bcm2835_codec,bcm2835_isp
videobuf2_memops       20480  2 videobuf2_vmalloc,videobuf2_dma_contig
raspberrypi_hwmon      16384  0
videobuf2_v4l2         32768  4 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,bcm2835_isp
videobuf2_common       81920  8 bcm2835_codec,videobuf2_vmalloc,videobuf2_dma_contig,videobuf2_v4l2,bcm2835_v4l2,v4l2_mem2mem,videobuf2_memops,bcm2835_isp
snd_bcm2835            36864  0
snd_pcm               163840  1 snd_bcm2835
videodev              286720  6 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,videobuf2_common,v4l2_mem2mem,bcm2835_isp
snd_timer              45056  1 snd_pcm
snd                   126976  3 snd_bcm2835,snd_timer,snd_pcm
mc                     73728  6 videodev,bcm2835_codec,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem,bcm2835_isp
bcm2835_gpiomem        16384  0
vc_sm_cma              45056  2 bcm2835_mmal_vchiq,bcm2835_isp
uio_pdrv_genirq        20480  0
uio                    24576  1 uio_pdrv_genirq
sch_fq_codel           24576  2
dm_multipath           40960  0
ramoops                32768  0
pstore_blk             16384  0
reed_solomon           28672  1 ramoops
pstore_zone            28672  1 pstore_blk
drm                   651264  0
ip_tables              36864  0
x_tables               61440  1 ip_tables
autofs4                49152  2
btrfs                1622016  0
blake2b_generic        24576  0
zstd_compress         229376  1 btrfs
raid10                 73728  0
raid456               196608  0
async_raid6_recov      24576  1 raid456
async_memcpy           20480  2 raid456,async_raid6_recov
async_pq               20480  2 raid456,async_raid6_recov
async_xor              20480  3 async_pq,raid456,async_raid6_recov
async_tx               20480  5 async_pq,async_memcpy,async_xor,raid456,async_raid6_recov
xor                    20480  2 async_xor,btrfs
xor_neon               16384  1 xor
raid6_pq              114688  4 async_pq,btrfs,raid456,async_raid6_recov
libcrc32c              16384  2 btrfs,raid456
raid1                  57344  0
raid0                  24576  0
multipath              24576  0
linear                 20480  0
spidev                 24576  0
crct10dif_ce           20480  1
dwc2                  315392  0
roles                  20480  1 dwc2
udc_core               73728  1 dwc2
i2c_bcm2835            20480  0
spi_bcm2835            28672  0
phy_generic            20480  1
aes_arm64              16384  3

Here is the output of dmesg | grep usb:

$ sudo dmesg | grep usb
[    0.219739] usbcore: registered new interface driver usbfs
[    0.219834] usbcore: registered new interface driver hub
[    0.219920] usbcore: registered new device driver usb
[    0.694717] usbcore: registered new interface driver lan78xx
[    0.694828] usbcore: registered new interface driver smsc95xx
[    2.667847] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    2.668816] usb_phy_generic phy: dummy supplies not allowed for exclusive requests
[    3.312961] dwc2 3f980000.usb: supply vusb_d not found, using dummy regulator
[    3.313508] dwc2 3f980000.usb: supply vusb_a not found, using dummy regulator
[    3.525310] dwc2 3f980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[    3.525758] dwc2 3f980000.usb: DWC OTG Controller
[    3.525804] dwc2 3f980000.usb: new USB bus registered, assigned bus number 1
[    3.525871] dwc2 3f980000.usb: irq 51, io mem 0x3f980000
[    3.526390] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.526415] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.526435] usb usb1: Product: DWC OTG Controller
[    3.526453] usb usb1: Manufacturer: Linux 5.15.0-1013-raspi dwc2_hsotg
[    3.526470] usb usb1: SerialNumber: 3f980000.usb
[   16.846667] usbcore: registered new interface driver brcmfmac

Is this still a device tree problem? If not, how else do I make the USB work under 64-bit Ubuntu 22.04?

4
  • Bit of a long shot but check the output from lsmod; if you get nothing, that is a problem.
    – goldilocks
    Aug 12, 2022 at 13:41
  • @goldilocks Thanks for the suggestion. lsmod does output a lot. I've included the output in the question. Aug 13, 2022 at 12:13
  • Just wanted to make sure something was loaded (using the default kernel, it's possible to boot with no corresponding /lib/modules directory, which can happen if the kernel gets updated while the boot partition is unmounted). But this is fortuitous anyway: Looks like the problem is it is configured to boot in USB gadget mode (ie., where it can act as a slave network or mass storage device). That's what the dwc2 module is for (plus I would guess the raid stuff, which would be pretty weird if all you had was the SD card).
    – goldilocks
    Aug 13, 2022 at 12:42
  • If you follow up on that, please post an answer of your own as it would seem Ubuntu is default configured to do this on a Zero or something. It should not be hard to undo (just look up how it is enabled in the first place, there are some settings in /boot/config.txt).
    – goldilocks
    Aug 13, 2022 at 12:44

1 Answer 1

1

As @goldilocks suggested, the default for Ubuntu 22.04 arm64 seems to be that dwc2 is in gadget "peripheral" mode by default.

/boot/firmware/config.txt contains the lines:

dtoverlay=dwc2

[cm4]
# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into
# such a board)
dtoverlay=dwc2,dr_mode=host

This means that dr_mode is forced into host mode for a RPi4, but not for an RPi0.

So either comment out:

#    [cm4]

or change the earlier line to:

dtoverlay=dwc2,dr_mode=host

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.