Raspberry Pi 4 - USB Bus not detecting any devices

Bug #1848703 reported by Andrew Davis on 2019-10-18
This bug report is a duplicate of:  Bug #1848790: USB not working under arm64 on Pi4. Edit Remove
100
This bug affects 20 people
Affects Status Importance Assigned to Milestone
linux-raspi2 (Ubuntu)
Undecided
Unassigned

Bug Description

Pi 4 new install. System boots up but USB bus is not working.

Tried 3 keyboards no key presses detected, 2 usb memory drives don't show up in lsblk.

output of $lspci
00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2711 (rev 10)
01:00.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)

output of $dmesg on pastebin here http://pastebin.com/h7A3n9xa or attached to this bug report.

Not the only one experiencing bug. Another user created a post on the ubuntu forums:
https://ubuntuforums.org/showthread.php?t=2429396&s=01a0c4b0cb4c05e605cbf9d41f660e08&p=13898142#post13898142

64bit raspberry pi 4&4 image pulled from https://ubuntu.com/download/iot/raspberry-pi page. Specifically http://cdimage.ubuntu.com/releases/19.10/release/ubuntu-19.10-preinstalled-server-arm64+raspi3.img.xz

Andrew Davis (davis-a) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1848703/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed

More discussion and users with same problem here:
https://www.raspberrypi.org/forums/viewtopic.php?p=1553904#p1553904

I can reproduce this on my 4GB Pi4 with the 64bit image.

This does not seem to be an issue with the 32bit image in my quick testing. With the 32 bit image, both the keyboard and external storage are detected and working.

As you can see here with my USB keyboard and thumb drive attached, they are detected when running the 32bit image:

ubuntu@ubuntu:~$ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04d9:0006 Holtek Semiconductor, Inc. USB2.0 Hub
Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 006: ID 0781:5575 SanDisk Corp. Cruzer Glide
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Akshay (akshaynakra) wrote :

I can reproduce this on my 4GB Pi4 with the 64bit image as well. There are no devices detected -

ubuntu@ubuntu:~$ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Ken Howe (leggazoid) wrote :

User on lingon on raspberry pi forum posted the following:

The USB-problem concerning the Raspberry Pi 4GB RAM model might be due to the issue seen earlier that using more RAM than 3072 MB breaks the USB:
https://www.raspberrypi.org/forums/view ... 6&start=25

The issue was solved by a kernel patch:
https://www.raspberrypi.org/forums/view ... 0#p1517839

and the kernel patch was this one:
https://github.com/raspberrypi/linux/is ... -520269280

Ken Howe (leggazoid) wrote :

Fixed links

User on lingon on raspberry pi forum posted the following:

The USB-problem concerning the Raspberry Pi 4GB RAM model might be due to the issue seen earlier that using more RAM than 3072 MB breaks the USB:
https://www.raspberrypi.org/forums/v...46766&start=25

The issue was solved by a kernel patch:
https://www.raspberrypi.org/forums/v...rt=50#p1517839

and the kernel patch was this one:
https://github.com/raspberrypi/linux...ment-520269280

Ken Howe (leggazoid) wrote :

Fixed links
User on lingon on raspberry pi forum posted the following:

The USB-problem concerning the Raspberry Pi 4GB RAM model might be due to the issue seen earlier that using more RAM than 3072 MB breaks the USB:
[url]https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=246766&start=25[/url]

The issue was solved by a kernel patch:
[url]https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=246766&start=50#p1517839[/url]

and the kernel patch was this one:
[url]https://github.com/raspberrypi/linux/issues/3093#issuecomment-520269280[/url]

Andrew Davis (davis-a) on 2019-10-20
affects: ubuntu → linux-raspi2 (Ubuntu)
Adam T (tiermann) wrote :

Setting total_mem=2048 or 3072 in /boot/firmware/usercfg.txt allowed me to boot Pi4 4GB with 19.10 64bit with working USB. Of course I have less RAM now, but working USB.

Likely the above patch will fix it.

Hui Wang (hui.wang) wrote :

Please refer to this bug (the same bug as this one) #1848790

And I will submit the fixing patch to ubuntu kernel.

thx.

Hui Wang (hui.wang) wrote :

I built a testing kernel, not only includes the fix for USB host, but also includes all new patches from https://github.com/raspberrypi/linux.git rpi-5.3.y branch (about 107 patches).

I tested both arm64 and armhf kernels on Pi4 without HDMI monitor, everything works well.

Could anybody help test these two kernels on Pi4 with HDMI monitor, Pi3 and Pi2 if you have any of them?

After verifying the kernel will not introduce regression on Pi4/3/2, I will submit the patches to UBUNTU kernel.

The new kernel could be downloaded: https://people.canonical.com/~hwang4/rpiv2/

To install and test the kernel:
copy arm64 or armhf folders to rootfs of Pi, sudo dpkg -i linux-modules-xxxx.deb; sudo dpkg -i linux-image-xxx.deb;sudo reboot

thx

The new patch is working fine connected to my HDMI monitor/TV. I also removed the temp patch using only 3GB ram, rebooted and all my memory is now available (Pi4 4GB). Will future updates break the patch or is all good? Thanks you so much!

Anthony Bush (distributedfog) wrote :

I can confirm as well - verified that the new patch from @hui.wang is working correctly on my Pi 4 4GB.

Ricardo (ricardo.zzz) wrote :

I'm a noob, can anyone tell me how to use the petch

Scott van Looy (scottbert) wrote :

It works for me, but no Bluetooth. However, I'm not sure if that's related/caused by this patch or a known issue.

Hui Wang (hui.wang) wrote :

@Ricardo,

just download the deb (https://people.canonical.com/~hwang4/rpiv2/arm64/) to your pi's rootfs

Then run:
sudo dpkg -i linux-modules-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
sudo dpkg -i linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
sudo reboot

Hui Wang (hui.wang) wrote :

@Scott,

We haven't tested the bluetooth both under old kernel and under patched kernel, do you know how to verify the bluetooth on the pi? And we are going to look at bluetooth after fixing the usb host issue.

Hui Wang (hui.wang) wrote :

@Scott,

About the bluetooth, this is a comment from Dave Jones:

And one thing which isn't a bug:

    Bluetooth: we don't support bluetooth out of the box. Ubuntu on Pi is primarily a server distro and thus a stable serial console was prioritized over out-of-the-box Bluetooth support (note: I don't work on Ubuntu MATE; that's something separate).

    Bluetooth can be enabled by installing the "pi-bluetooth" package and switching a line in "syscfg.txt" on the boot partition from "include nobtcfg.txt" to "include "btcfg.txt". A tool to manage the hardware configuration on the Pi (including Bluetooth) is being developed, but I didn't have time to finish it for Eoan.

Ricardo (ricardo.zzz) wrote :

@Hui Wang,
But if I can't use the keyborad by USB, how can I type in those cmd?

Hui Wang (hui.wang) wrote :

@reply #21,

The simplest workaround is to plug the sd card into a cardreader and connect the cardreader to computer, then edit $mount_folder/system-boot/config.txt

Add total_mem=3072 in the section [pi4], just like below:

[pi4]
kernel=uboot_rpi_4.bin
max_framebuffers=2
total_mem=3072

Then reboot, you could you the usb keyboard now, after installing the testing kernel, you could remove total_mem=3072.

And another way to login is to use ssh.

Hui Wang (hui.wang) wrote :

And for me, I run commands through serial console, and if you have the uart->usb converter, you could use serial console too.

Ricardo (ricardo.zzz) wrote :

@Hui Wang,

My pi is all good now, deeply applicate!

Mark Dunn (mdunn-home) wrote :

I have a PI 4 (4GB)

I loaded and installed the arm64 eoan
USB didn't work, ssh did

I set total_mem=1024
USB worked

I set total_mem=3072
USB failed

I set total_mem=1024 and loaded the linux image:
wget https://people.canonical.com/~hwang4/rpiv2/arm64/linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
wget https://people.canonical.com/~hwang4/rpiv2/arm64/linux-modules-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb

sudo dpkg -i linux-modules-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
sudo dpkg -i linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
sudo reboot

USB Worked

I commented out the total_mem=3072
USB failed

I believe the following will help:

In the raspberry pi git (4.19.y)
https://github.com/raspberrypi/linux/issues/3093

hitmoon commented on 12 Aug
    "I've created a trivial patch to add bounce buffers on ARM64 for pcie-bcrmstb.
    pcie-brcmstb-bounce64.patch.zip

    I tried this patch, it works for me!
    All 4G memory is alive now, COOL !! :-)
    Thanks @yaroslavros !

This fixed my linux image for my home rolled 19.04 ubuntu so I hope it fixes yours

Hui Wang (hui.wang) wrote :

reply Mark Dunn,

The kernel you wget and installed already included the patch for 3093, so in theory, after installed the new kernel, the usb should work with 4G ram.

Please verify the kernel you are running is the new kernel, please upload the output of 'uname -a' and dmesg.

Mark Dunn (mdunn-home) wrote :

Sorry, my mistake I missed this:

Ignoring old or unknown version 5.3.0-1008-raspi2 (latest is 5.3.0-1009-raspi2)
/etc/kernel/postinst.d/zz-flash-kernel:

I have proposed in my sources.list so it ignored your older version, I will retry from scratch

Mark Dunn (mdunn-home) wrote :

hmm, not what I expected...

ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.3.0-1008-raspi2 #9-Ubuntu SMP Fri Oct 18 13:26:35 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

total_mem=3072 still fixes it

Hui Wang (hui.wang) wrote :

If you install the modules and kernel in the #26 successfully, the 'uname -a' will show newupdate.

But I can't find the "newupdate" from the output of yours.

And those patches are not merged to ubuntu kernel yet, so if you install the kernel from ubuntu sources, the usb host issue is not fixed.

Mark Dunn (mdunn-home) wrote :
Download full text (4.9 KiB)

Thanks.

ubuntu@ubuntu:~$ sudo dpkg -i linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
(Reading database ... 97816 files and directories currently installed.)
Preparing to unpack linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb ...
Unpacking linux-image-5.3.0-1008-raspi2 (5.3.0-1008.9+newupdate) over (5.3.0-1008.9+newupdate) ...
Setting up linux-image-5.3.0-1008-raspi2 (5.3.0-1008.9+newupdate) ...
Processing triggers for linux-image-5.3.0-1008-raspi2 (5.3.0-1008.9+newupdate) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.3.0-1008-raspi2
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.3.0-1008-raspi2/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.3.0-1008-raspi2/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
Installing /lib/firmware/5.3.0-1008-raspi2/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.3.0-1008-raspi2/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-flash-kernel:
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.3.0-1008-raspi2/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.3.0-1008-raspi2/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
Installing /lib/firmware/5.3.0-1008-raspi2/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.3.0-1008-raspi2/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel (3.98ubuntu5) ...
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.3.0-1008-raspi2/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.3.0-1008-raspi2/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: installing version 5.3.0-1008-raspi2
Taking backup of vmlinuz.
Installing new vmlinuz.
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
Taking backup of initrd.img.
Installing new initrd.img.
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.

ubuntu@ubuntu:~$ sudo dpkg -i linux-modules-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb
(Reading database ... 97816 files and directories currently installed.)
Preparing to unpack linux-modules-5.3.0-1008-raspi2_5.3.0-1008.9+newupdate_arm64.deb ...
Unpacking linux-modules-5.3.0-1008-raspi2 (5.3.0-1008.9+newupdate) over (5.3.0-1008.9+newupdate) ...
Setting up linux-modules-5.3.0-1008-raspi2 (5.3.0-1008.9+newupdate) ...
Processing triggers for linux-image-5.3.0-1008-raspi2 (5.3.0-1008.9+newupdate) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.3.0-1008-raspi2
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.3.0-1008-raspi2/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.3.0-1008-raspi2/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b....

Read more...

Mark Dunn (mdunn-home) wrote :

OK, with your new "roll up" things are looking quite good, however your config.txt contains
    dtoverlay=vc4-fkms-v3d
I can also see the matching device tree binary object
    vc4-fkms-v3d.dtbo
In
    /boot/firmware/overlays

I can see
    /lib/modules/5.3.0-1008-raspi2/kernel/drivers/gpu/drm/vc4/vc4.ko
But I cannot see
    /lib/modules/5.3.0-1008-raspi2/kernel/drivers/gpu/drm/v3d/v3d.ko

This is crucial for graphical applications (such as ubuntu-desktop :) as it removes the graphical overhead from the cpu to the gpu, making the applications work much faster.

Have I failed to load your linux-modules properly or is it missing?

I think the
    .../linux/arch/arm64/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
is worth checking.

Hui Wang (hui.wang) wrote :

With the newupdate kernel, you could delete or comment out the "dtoverlay=vc4-fkms-v3d" on rpi4/3/2, then the system will use the fb driver of bcm2708_fb, this will not load the vc4 drm driver.

And to install the newupdate kernel,
you should install linux-modules-xxx.deb first
then install linux-images-xxx.deb.

Mark Dunn (mdunn-home) wrote :

Thank you for your help so far...

I want (and I have got)
    dtoverlay=vc4-fkms-v3d
I want (and I have got) the vm4 drm driver
     /lib/modules/5.3.0-1008-raspi2/kernel/drivers/gpu/drm/vc4/vc4.ko

I want (but I do not have)
    /lib/modules/5.3.0-1008-raspi2/kernel/drivers/gpu/drm/v3d/v3d.ko

Please could you ensure this file is included in the
    linux-modules-xxx.deb ?

Hui Wang (hui.wang) wrote :

OK, got it, will enable the module of v3d.ko in the kernel of next release.

Mark Dunn (mdunn-home) wrote :

I have tried the v3d.ko with latest stable version of mesa
    19.2
Which works well. glxinfo is the application to show everything is working and it produces
     ...Accelerated: yes
for a fast graphical interface

However Chromium 78.0.3904.70 snap fails for some reason
I am using a workaround until it is fixed
   chromium -use-gl=egl

The chromium-browser 76.0.3809.100 (from ubuntu 19.04) worked OK

Hui Wang (hui.wang) wrote :

We have a bug to track the enabling of v3d.ko

https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1850876

Adam Mierzwiak (adamvm) wrote :

When will be available fix in packages from regular distribution - applied with apt update/upgrade?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.