summaryrefslogtreecommitdiff
path: root/doc/usage/cmd/ums.rst
blob: e96222785f2ffb98b653f610e9556ab53485b453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.. SPDX-License-Identifier: GPL-2.0+

.. index::
   single: ums (command)

ums command
===========

Synopsis
--------

::

    ums <dev> [<interface>] <devnum[:partnum]>

Description
-----------

Use the USB Mass Storage class (also known as UMS) to make accessible an U-Boot
block device (fully or with :ref:`U-Boot's partition syntax <partitions>`)
to a USB host and to enable file transfers. U-Boot, the USB device, acts as a
simple external hard drive plugged on the host USB port.

This command "ums" stays in the USB's treatment loop until user enters Ctrl-C.

dev
    USB gadget device number

interface
    interface for accessing the block device (mmc, sata, scsi, usb, ....)
    defaults is "mmc"

devnum
    device number for selected interface

partnum
    partition number or 0 to expose all partitions, defaults to 0

Example
-------

::

    => ums 0 mmc 0
    => ums 0 usb 1:2

Configuration
-------------

The ums command is only available if CONFIG_CMD_USB_MASS_STORAGE=y
which depends on CONFIG_USB_GADGET_DOWNLOAD and CONFIG_BLK.

Return value
------------

The return value $? is set to 0 (true) when the USB stack was successfully
started and interrupted, with Ctrl-C or after USB cable issue (detection
timeout or cable removal).

If an error occurs, the return value $? is set to 1 (false).