USB 3.0 power for external storage

I would like to attach an external SSD/NVMe drive to a ROC-RK3328-CC USB 3.0 connector to take advantage of for better storage speeds than uSD and the limited write cycles of most uSD cards. My Renegades are DIN-rail mounted and I attached one of the popular Orico M2PV-C3 (Realtek RTL9210 - see tools) enclosures to the mounting board and connected it to the USB3.0 port. The Renegade saw the enclosure and drive (shows up properly in lsusb -tv and lsblk showed the partitions), but there were numerous IO errors and the drive could not be mounted or partitioned.

However, when I attach the same drive enclosure to a powered USB 2.0 hub connected to the Renegade, all is well; the drive is recognized and I can partition and format it. This suggests that either the USB 3.0 port on the Renegade can’t provide sufficient power for the drive or there’s a problem with the USB3.0 comms (I suspect it’s a power limitation and will try to find a USB 3.0 hub to confirm). So two questions:

  1. Is there a specification for how much current the Renegade can source over the USB 3.0 port?
  2. Is there a better way to supply power to the board than via the micro-USB connector? (soldering is fine).

Thanks!

MicroUSB is designed to power the board and minor peripherals. Spinning hard drives and SSDs are major peripherals that consume more than 5W (5V 1A) and are not supported without external power or a powered USB hub. USB 3.0 on Renegade is limited to 1A (USB 3.0 Type A spec is 0.9A without additional signaling). You can try to limit the SSD to PS1 (4W) or PS2 (3W) but PS0 (8W) is much too high for MicroUSB to power both the board and the device. Spinning hard drives can use even more on startup.

Thank you @librecomputer the power specs for the ports were exactly what I was looking for. For anyone else looking, 900mA is indeed the 3.0 power specification, so this is not a limitation of the Renegade, it is simply performing to the USB spec. I asked only because some 3.0 ports are designed to meet the battery charging spec and can source more current, but that is not a required element of 3.0.

I’ve already ordered powered USB 3.0 hubs that can source more current and will also try a Y-cable to allow the drive to draw additional power from one of the USB 2.0 ports to see which solves my NVME drive power problems; I’ll report results back here.

The other question was about alternate ways to deliver power to the Renegade. Although admittedly the micro-USB port has been doing fine, when I use RPis in DIN-rail applications, I solder heavier gauge wire to the power entry points (ground and the PTC) and use pluggable screw terminals for compatibility with the 5V power distribution rail. From the Renegade schematic (sheet 16), it looks like testpoint (VBUS50) is perfect; hopefully it’s labeled on the silkscreen and I assume there is a good ground testpoint somewhere too. As a suggestion, for industrial applications, 1x2 0.100 spaced pads for adding a (polarized, latching) power connection header would be a great addition to a future layout if you have space for it.

Thanks again for a great product!

We do not recommend this. SSDs can use 8W (1.65A) while the best MicroUSB can push through the 5V pin is around 2.0-2.5A without a huge voltage drop.

Per the schematics, VCC_SYS is exposed as on the 40-pin J1 header on pin 2 and 4. You can directly power the board there with a sufficient gauge wire.

Thanks again; my intent is to power the board directly from a quiet, low-impedance supply using appropriate gauge wire and avoid the microUSB connector. I was hoping to supply power via the USB1 side of F1 to preserve the over-current and ESD protection, but if I can’t find a good point to tap in, I will feed VCC_SYS via J1 (pins 2,4 and 8,9) and fuse it externally as you suggest.

Being able to use an NVMe drive with the ROC-RK3328-CC would add a lot of utility (and speed and reliability); doing it without a separate external hub would be much simpler and more compact. I’ll look for low-power NVMe modules and will measure peak current to see if using the power from both the 3.0 and a 2.0 USB port will be sufficient (I have a Joulescope which is handier than an o’scope for monitoring and logging peak and average current over a wide dynamic range as well as monitoring the voltage drop at peak current).

Thanks again for the responses and the great products!

NVMe is designed with different power modes (PS0 to PS3) although maybe needs to be set at initialization in software. The bridge control must support the commands.

In case anyone is following this, it looks like the dual-cable approach (1xUSB3.0 port + 1x USB2.0 port) is working. FYI, I’m using this cable: Amazon.com and an Orico M2PV drive enclosure (Amazon.com). Power to the Renegade is a 5V/3A supply and a short USB-C cable with heavier-than-normal gauge wires.

I’ll do more testing including checking how low the voltage drops on the 5V rail and follow up on this. HOWEVER, I also did not see the performance gains I expected with an NVMe drive:

dalbert@renegade:~ $ sudo hdparm -Tt /dev/mmcblk1p2

/dev/mmcblk1p2:
 Timing cached reads:   1900 MB in  2.00 seconds = 950.25 MB/sec
 Timing buffered disk reads: 194 MB in  3.03 seconds =  63.96 MB/sec
dalbert@renegade:~ $ sudo hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads:   1836 MB in  2.00 seconds = 917.99 MB/sec
 Timing buffered disk reads: 102 MB in  3.00 seconds =  33.98 MB/sec

So this may not be a useful exercise (although the NVMe drive may still be a better storage medium for things that do a lot of disk writes (e.g. databases, logs).

As @librecomputer had noted, the NVMe drive supports several power modes and I’m going to look into how to disable mode 0:

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     9.00W       -        -    0  0  0  0        5       5
 1 +     4.60W       -        -    1  1  1  1       30      30
 2 +     3.80W       -        -    2  2  2  2       30      30
 3 -   0.0700W       -        -    3  3  3  3    10000     300
 4 -   0.0050W       -        -    4  4  4  4     2000   10000

That looks like you are only using USB 2.0 speeds. USB 3.0 should yield a few hundred MB/s.

librecomputer

That looks like you are only using USB 2.0 speeds. USB 3.0 should yield a few hundred MB/s.

It’s definitely using USB 2.0 (see output of lsusb below). I haven’t had time to look into why. The data connector of the cable is plugged into the USB 3.0 port. Most likely is what you suggested: insufficient power (see the following thread). I’ll try it with a powered USB 3.0 hub tomorrow.

Realtek RTL9210 chipset (NVMe to USB) initialized but seems doesn’t work correctly on PRI 4 · Issue #4130 · raspberrypi/linux · GitHub

dalbert@pitest:~ $ lsusb -v -d 0bda:9210

Bus 002 Device 002: ID 0bda:9210 Realtek Semiconductor Corp. RTL9210 M.2 NVME Adapter
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x9210 RTL9210 M.2 NVME Adapter
  bcdDevice           20.01
  iManufacturer           1 Realtek
  iProduct                2 RTL9210
  iSerial                 3 012345678904
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0020
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

The SSD’s 9W power consumption is twice that of our board. The enclosure should have a method or a cable that lets you use an external power supply to feed power to the SSD and avoid having the board power it.