Difference between revisions of "How to use USB mass storage in U-Boot"

[quality revision] [quality revision]
m
m
 
Applicable for STM32MP13x lines, STM32MP15x lines

This page explains how to use the U-Boot command ums to update an a SD card or eMMC e•MMC on the device.

1 ums command[edit]

In U-Boot, you can directly export the available block devices (sd/mmc/usb) such as USB mass storage devices with ums command:

 
 help ums
 ums - Use the UMS [USB Mass Storage]
 
 Usage:
 ums <USB_controller> [<devtype>] <dev[:part]>  e.g. ums 0 mmc 0
     devtype defaults to mmc

This U-Boot command ums is infinite (a loop in USB treatments), and the U-Boot console is blocked until user enters a Ctrl-C.

2 Exporting a block device[edit]

On STMicroelectronics boards, the OTG USB controller device index is 0, SD card = "mmc 0" and, when available, eMMC e•MMC = "mmc 1".
You can check the device connected on an SDMMC with the U-Boot command "mmc info".

You can also export a USB device connected to the USB host controller (USBH) = "usb 0".

Then, execute one of the following commands:

                                
Comments
  ums 0 mmc 0 --> start ums on SD card
 Ctrl-C
                                
Comments
  ums 0 mmc 1 --> start ums on eMMCe•MMC
 Ctrl-C
                                
Comments
  usb start   --> start USB host controller
  ums 0 usb 0 --> start ums on USB device 0 (USB key for example)
 Ctrl-C
  usb stop    --> stop USB host controller

After a delay (of up to 15 seconds), the host sees the exported block device and you can use any command on the PC to access the partitions of the exported memory (dd, mount, cp, rsync). A Ctrl-C is needed to stop the command.

See also How to manually update bootloaders.


<noinclude>{{ApplicableFor
|MPUs list=STM32MP13x, STM32MP15x
|MPUs checklist=STM32MP13x, STM32MP15x
}}</noinclude>

This page explains how to use the [[U-Boot_overview#Commands|U-Boot command]] <code>ums</code> to update ana SD card or eMMC''e''•MMC on the device.

== ums command ==

In U-Boot, you can directly export the available block devices (sd/mmc/usb) such as USB mass storage devices with ums command:

  {{U-Boot$}} help ums
  ums - Use the UMS [USB Mass Storage]

  Usage:
  ums <USB_controller> [<devtype>] <dev[:part]>  e.g. ums 0 mmc 0
      devtype defaults to mmc

This [[U-Boot_overview#Commands|U-Boot command]] <code>ums</code> is infinite (a loop in USB treatments), and the U-Boot console is blocked until user enters a Ctrl-C.

== Exporting a block device ==

On STMicroelectronics boards, [[OTG_internal_peripheral| the OTG USB controller]] device index is 0, SD card = "mmc 0" and, when available, eMMC''e''•MMC = "mmc 1".<br/>You can check the device connected on an [[SDMMC_internal_peripheral|SDMMC]] with the [[U-Boot_overview#Commands|U-Boot command]] "mmc info".<br/>


You can also export a USB device connected to the [[USBH_internal_peripheral|USB host controller  (USBH)]] = "usb 0".

Then, execute one of the following commands:

                                 {{Highlight|Comments}}
  {{U-Boot$}} ums 0 mmc 0 {{Highlight|--> start ums on SD card}}
  Ctrl-C

                                 {{Highlight|Comments}}
  {{U-Boot$}} ums 0 mmc 1 {{Highlight|--> start ums on eMMC''e''•MMC}}
  Ctrl-C

                                 {{Highlight|Comments}}
  {{U-Boot$}} usb start   {{Highlight|--> start USB host controller}}
  {{U-Boot$}} ums 0 usb 0 {{Highlight|--> start ums on USB device 0 (USB key for example)}}
  Ctrl-C
  {{U-Boot$}} usb stop    {{Highlight|--> stop USB host controller}}

After a delay (of up to 15 seconds), the host sees the exported block device and you can use any command on the PC to access the partitions of the exported memory (dd, mount, cp, rsync). A Ctrl-C is needed to stop the command.

See also [[How to manually update bootloaders]].
<noinclude>

[[Category:How_to_run_use_cases]]{{PublicationRequestId | 24668 | 2022-09-26}}</noinclude>
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<noinclude>{{ApplicableFor
 
<noinclude>{{ApplicableFor
 
|MPUs list=STM32MP13x, STM32MP15x
 
|MPUs list=STM32MP13x, STM32MP15x
|MPUs checklist=STM32MP13x,STM32MP15x
+
|MPUs checklist=STM32MP13x, STM32MP15x
 
}}</noinclude>
 
}}</noinclude>
This page explains how to use the [[U-Boot_overview#Commands|U-Boot command]] <code>ums</code> to update an SD card or eMMC on the device.
+
This page explains how to use the [[U-Boot_overview#Commands|U-Boot command]] <code>ums</code> to update a SD card or ''e''•MMC on the device.
   
 
== ums command ==
 
== ums command ==
   
In U-Boot, you can directly export the available block devices (sd/mmc/usb) as USB mass storage devices with ums command:
+
In U-Boot, you can directly export the available block devices (sd/mmc/usb) such as USB mass storage devices with ums command:
   
 
   {{U-Boot$}} help ums
 
   {{U-Boot$}} help ums
Line 20: Line 20:
 
== Exporting a block device ==
 
== Exporting a block device ==
   
On STMicroelectronics boards, [[OTG_internal_peripheral| the OTG USB controller]] device index is 0, SD card = "mmc 0" and, when available, eMMC = "mmc 1".
+
On STMicroelectronics boards, [[OTG_internal_peripheral| the OTG USB controller]] device index is 0, SD card = "mmc 0" and, when available, ''e''•MMC = "mmc 1".
 
<br/>You can check the device connected on an [[SDMMC_internal_peripheral|SDMMC]] with the [[U-Boot_overview#Commands|U-Boot command]] "mmc info".<br/>
 
<br/>You can check the device connected on an [[SDMMC_internal_peripheral|SDMMC]] with the [[U-Boot_overview#Commands|U-Boot command]] "mmc info".<br/>
   
 
You can also export a USB device connected to the [[USBH_internal_peripheral|USB host controller  (USBH)]] = "usb 0".
 
You can also export a USB device connected to the [[USBH_internal_peripheral|USB host controller  (USBH)]] = "usb 0".
   
Then execute one of the following commands:
+
Then, execute one of the following commands:
   
 
                                 {{Highlight|Comments}}
 
                                 {{Highlight|Comments}}
Line 32: Line 32:
   
 
                                 {{Highlight|Comments}}
 
                                 {{Highlight|Comments}}
   {{U-Boot$}} ums 0 mmc 1 {{Highlight|--> start ums on eMMC}}
+
   {{U-Boot$}} ums 0 mmc 1 {{Highlight|--> start ums on ''e''•MMC}}
 
   Ctrl-C
 
   Ctrl-C
   
Line 41: Line 41:
 
   {{U-Boot$}} usb stop    {{Highlight|--> stop USB host controller}}
 
   {{U-Boot$}} usb stop    {{Highlight|--> stop USB host controller}}
   
After a delay (of up to 15 seconds), the host sees the exported block device and you can use any command on the PC to access the partitions of the exported memory (dd, mount, cp, rsync). A Ctrl-C is needed to stop the command.
+
After a delay (up to 15 seconds), the host sees the exported block device and you can use any command on the PC to access the partitions of the exported memory (dd, mount, cp, rsync). A Ctrl-C is needed to stop the command.
   
 
See also [[How to manually update bootloaders]].
 
See also [[How to manually update bootloaders]].
Line 47: Line 47:
 
<noinclude>
 
<noinclude>
 
[[Category:How_to_run_use_cases]]
 
[[Category:How_to_run_use_cases]]
  +
{{PublicationRequestId | 24668 | 2022-09-26}}
 
</noinclude>
 
</noinclude>