USB OTG g_mass_storage with USB 3.0 speed

Hi,
I use ROCK Pi 4B v1.3, with Debian9Desktop from Radxa download. Kernel 4.4.154-90.
I want to use it as external USB storage for my PC.

I connect it via USB OTG to my host PC and starts g_mass_storage.
I noticed that it is running as USB2.0 device instead of USB3.0 device.

The configuration is: ROCK Pi 4 with NVMe disk connected to it.
On the NVMe is created a container file, which is mount as g_mass_storage to USB OTG port.

Transfer rate is quite good for USB2.0 standard - 31MB/s. But is not satisfying for USB3.0 standard.

The PC, I connect the ROCK Pi 4, is running Windows7 system.
As I checked in host PC, the ROCK Pi 4 is recognized as USB2.0 device.

So how to connect the ROCK Pi OTG g_mass_storage as USB3.0 device ?

Below the dmesg:
mount NVMe:

[ 95.472596] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null)
[ 95.595941] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[ 95.607591] ntfs: volume version 3.1.

start g_mass_storage:

[ 147.409421] Mass Storage Function, version: 2009/09/11
[ 147.409899] LUN: removable file: (no medium)
[ 147.410477] LUN: removable read only file: /mnt/nvme/file.img
[ 147.411000] Number of LUNs=1
[ 147.411650] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[ 147.412394] g_mass_storage gadget: g_mass_storage ready
[ 147.784374] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage

1 Like

Some addition to previous post.

The critical line from dmesg showing that my ROCK Pi 4 in OTG mode is connecting as USB2.0 device is:

[ 147.784374] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage

As I saw on Odroid forum for their XU3 SBC topic for USB 3.0 dmesg should return something similar to:

[10985.551513] g_mass_storage gadget: super-speed config #1: Linux File-Backed Storage

So I rise the questions:

  • Is it possible for ROCK Pi 4 to work in OTG as a Device in USB3.0 at all?
  • How to make ROCK Pi 4 to recognize taht is connected to USB3.0 (super-speed) Host instead of USB2.0 (high-speed)?
  • How to enforce (maybe) ROCK Pi 4 to connect as USB3.0 (super-speed) Device to the Host PC?

In advance, thanks for support!

Are you sure you have a USB3 cable? Mine does this: (Connected to macbook)

[ 2258.275049] rockchip-dwc3 usb@fe800000: USB peripheral connected
[ 2325.578187] Mass Storage Function, version: 2009/09/11
[ 2325.578672] LUN: removable file: (no medium)
[ 2325.594636] LUN: file: /media/nuraid/iSCSIdisks/foo.img
[ 2325.595165] Number of LUNs=1
[ 2325.595682] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[ 2325.596308] g_mass_storage gadget: userspace failed to provide iSerialNumber
[ 2325.596936] g_mass_storage gadget: g_mass_storage ready
[ 2327.863807] g_mass_storage gadget: super-speed config #1: Linux File-Backed Storage

Also…

curtis@rockpi:~$ cat /sys/class/udc/fe800000.dwc3/maximum_speed
super-speed
curtis@rockpi:~$ cat /sys/class/udc/fe800000.dwc3/current_speed
super-speed
curtis@rockpi:~$ cat /sys/class/udc/fe800000.dwc3/uevent
DRIVER=g_mass_storage
USB_UDC_NAME=dwc3-gadget
USB_UDC_DRIVER=g_mass_storage

And…

Curtiss-MacBook-Pro:NO NAME curtis$ gdd bs=1024 if=foo.img of=~/Desktop/foo.img status=progress
2245092352 bytes (2.2 GB, 2.1 GiB) copied, 25 s, 89.8 MB/s
2229248+0 records in
2229248+0 records out
2282749952 bytes (2.3 GB, 2.1 GiB) copied, 25.2843 s, 90.3 MB/s

I use the cable from my external USB3.0 disk enclosure fantec 225U3eSATAp (similar to this but w/o -6g).
The enclosure is working with USB 3.0 speed.
The host mode of otg port on ROCK Pi 4 is also working in USB3.0 speed with attached devices.

# lsusb -t
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M

above, the Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M is an enclosure with external SSD connected using my USB A-A cable to ROCK Pi 4 otg port working in host mode.

The same cable I use to connect ROCK Pi 4 in Device mode to my PC.

Next strange thing is that my ROCK Pi 4 in g_mass_storage mode is recognized by Windows Host PC (high-mode), but if connected to Ubuntu Host PC then nothing is happening. Linux doesn’t automatically see the Rock Pi 4 as a mass storage device.