Raspberry Pi 5, NVMe and USB woes
If you have not bought an enclosure/SSD yet, PLEASE make triple sure that what you're buying is compatible between each other and it's not the same cursed enclosure chip I bought. Ideally buy an M.2 hat instead to save yourself some of the issues. You still have to verify compatibility with the SSD if you'll choose a HAT.
After buying a Raspberry Pi 5 8GB, Orico NVMe USB enclosure and ADATA XPG SX8200 Pro 2TB for an SSD, I had an awesome time debugging it for hours, here's some things for you to check to save time.
- Your devices can misbehave due to out of date firmware
- RPi5 will likely ship with an old bootloader firmware which may cause issues
- Update is easy, just boot the official updated Raspberry Pi OS image and reboot.
- Grab an image here, flash it onto an mSD card, boot it, run
sudo apt update && sudo apt upgrade -y && reboot
,sudo rpi-eeprom-update
will show you the current bootloader version, and so will the bootloader screen over HDMI - You can further upgrade again to beta bootloader by means of toggling it in Advanced settings of
sudo rpi-config
, and if that's not going to get you the latest as per the link, you can upgrade to the beta beta firmware viarpi-update
.
- SSD firmware can be out of date, you will not be able to flash it over USB, you have to connect it to actual PCIe, sorry
- USB Enclosure firmware can be out of date
- If you made the same mistake like me and bought an enclosure with an RTL9210 chip, update FW as per here
- RPi5 will likely ship with an old bootloader firmware which may cause issues
- USB Enclosures have a power limit that they're designed for and won't take more
- I have a very weird issue where the enclosure does not like to show up on the Pi, but if I connect it to my PC it loads fine and THEN loads fine in Pi too. I do not think it is connected to how warm the enclosure is as I can do these connections very quickly and it will always work like this.
- Your USB port may not have enough juice for that, RPi5 has total 1.6A amps available for the ports - 5V*1.6A=8W
- If you're using your RPi5 with an unofficial power supply, it is likely you are using the wrong cable and not getting the full 28W and ports are limited further
- The SSD may be designed to take more power than the enclosure can theoretically provide, my enclosure is 796mA*5V=3.98W, and the SSD I use can apparently peak at about 4.1W. Keep in mind the enclosure will take some minimal power for itself. The peak power consumption is on connect, and presumably on maxed out IO, you are not going to max out IO on the Pi, so you can theoretically run a more power hungry SSD fine
- Cable issues can cause this
- You can be using a USB 2.0 cable/adapter, which will limit power to 500mA, verify communicated USB protocol via
lsusb -v
and checkingmaxPower
andbcdUSB
attributes - Your cable can be broken, causing the above
- Your cable can be too long, causing the above, even in-spec cables are at risk
- Just because it works with another device does not mean it will work with the RPi5, which seems to have worse ports than RPi4 where it confusingly might work
- You can be using a USB 2.0 cable/adapter, which will limit power to 500mA, verify communicated USB protocol via
- More compatibility issues
- Enclosure chip and SSD chip may not like each other
- RPi5 and the enclosure chip may not like each other
- Enclosure chip can announce UAS support but not support it. RTL9210 does this, but if you try to use it with the UAS driver it will crash the moment you put any amount of IO into it. It needs to be added to the quirks blacklist by VID:PID (can get it from
lsusb
) in Linux to work. RTL9210 has made it onto the blacklist in Linux by default for this reason. - Enclosure can be set to autosleep, disconnecting the OS drive after X minutes of inactivity. This can be worked around by either modifying the firmware or constantly writing files.
- RPi5 by default resets the power to USB devices on boot. Some enclosures do not seem to like this.
-
USB_MSD_PWR_OFF_TIME=0 - you can also try making it higher from the usual
1000
and you can also try playing with USB_MSD_STARTUP_DELAY=3000 - Not directly related but you can set HDMI_DELAY=0 to not block HDMI output for 5 seconds on boot.
-
USB_MSD_PWR_OFF_TIME=0 - you can also try making it higher from the usual