USB 2.0 ports not working on the Compute Module 4? Check your overlays!

Out of the box, to conserve power, the new Raspberry Pi Compute Module 4 doesn't enable its built-in USB 2.0 ports.

Compute Module 4 IO Board USB 2.0 ports are disabled by default

You might notice that if you plug something into one of the USB 2 ports on the IO Board and don't see it using lsusb -t. In fact, you see nothing, by default, if you run lsusb -t.

To enable the USB 2.0 ports on the Compute Module 4, you need to edit the boot config file (/boot/config.txt) and add:

dtoverlay=dwc2,dr_mode=host

Then reboot the Pi. Now you should be able to use the built-in USB 2.0 ports!

Comments

Also note this is documented in the CM4 datasheet section 2.4

:)

I rolled my own IO board for the CM4 and was convinced I'd done something wrong when the USB didn't work. I finally stumbled upon the line in the datasheet that mentions this. I kinda feel like this should be on by default....

Doesn't work in the config.txt that's in the NOOBS SD. Works with the Raspbian image though. Probably related to existence of a ...cm4...dtb file in the Raspbian FAT partition.

That was really frustrating for a while there.

Thanks.. I was wondering why I couldn't get my CM4 to USB boot.. Seems that USB needs to be enabled.. Which means the IO board can't boot from USB without having a boot partition on the SD/NVM card.

I've taken a copy of the Ubuntu 20.04 LTE boot partition on the a 500MB SD boot partition and then that boots of the Usb volume labeled writable. However it then gets stuff waiting for dev to complete so show knows what the next problem is..

Once step forwards..

In Ubuntu 20.04 image there is a line to uncoment in /boot/firmware/config.txt as explained by the comment above it.

Hello Sir, Which line I need to uncomment since the file says -> Please DO NOT modify this file; if you need to modify the boot config, the "usercfg.txt" file is the place to include user changes

Just a comment to keep someone else from falling into the same pit I did. I added this line to config.txt by connecting it via J11 and letting boot as a USB storage device. Once I could see it in Windows I edited config.txt. But no matter what the USB mouse and keyboard would never work. Finally I realized I still had power applied to J11 via the microusb cable. I recall from the schematic this flips a switch that re-routes the USB signals from the HUB and instead to J11. Unpluged from J11 and all if FINE! Only 20 minutes lost on this. :-) Not unusual for unfamiliar hardware. Lesson learned. Hope this helps someone else not waste 20 min or more.

Disable USB by default - what a stupid idea...

thanks for enlightening us JG :)

Ditto - Thank you so much I would have spent days figuring that out, assuming something was wrong with the board. Of all things...

I did all this and it still did not work - no matter how many times I unplugged / replugged, unplugged all the other devices in my Mac (and PC and Debian) system, the rpiboot would never recognize the CM4's on-board SSD.

I was using hobby cable jumpers; I switched to the standard PC board jumper plug.
I was using not-so-great microUSB cables, I switched to a high-quality one - eureka - it mounted and I was able to edit the boot config.txt on my Mac, and now USB 2 works.

So if anyone is frustrated after following the above instructions, make sure you have a tight jumper and good quality microUSB cable.

Thanks so much for this guide - now it's time to get to work!

Is there actually a way to boot off an USB MSD connected to the USB ports on the CM4 IO board if the CM4 has eMMC?

I tried changing the boot order in the bootloader but I think I've ending up with a chicken and egg situation where you cant boot off an USB MSD if the USB ports are disabled because it needs to load config.txt to enable the USB ports. The documentation even says you want to be able to do USB MSD boot if the onboard eMMC is corrupted but it doesn't address having to enable the USB ports. I think the only other option would be using a USB card in the PCIe slot.

Mine too i wasted time search for a power or other issue that didn't exist
thanks you for this post

Thankyou!

I was setting this up to run ocotpi with some custom hardware additions.
I was closed to giving up getting the webcam going.

You saved the project.

:-)