U-Boot/USB Mass Storage

= USB Mass Storage (UMS) Gadget = For few years now, starting from v2014.07, U-Boot has contained UMS gadget that allows for easier access to onboard eMMC/SD storage by emulating a simple block device over OTG to the host. Similar to the Linux kernel Mass Storage Gadget.

U-Boot UMS Gadget also provides a simpler alternative to Fastboot based device setup and recovery.

Prerequisites

 * Sunxi device connected to a host over USB OTG port.
 * Sunxi device connected to a host over USB OTG port.
 * Sunxi device connected to a host over USB OTG port.

On my NanoPi NEO Core I also had to enable

Using it
In U-Boot prompt you can use the  command.

=> ums ums - Use the UMS [USB Mass Storage] Usage: ums  [ ]  e.g. ums 0 mmc 0 devtype defaults to mmc

To export internal eMMC storage, just type

=> ums 0 mmc 1

Press  to stop UMS gadget.

Benchmarks
On my NanoPi NEO Core internal eMMC I got around 13MB/s read and 9MB/s write.



= See also =
 * Fastboot
 * https://boundarydevices.com/u-boot-usb-mass-storage-gadget/