Using the Neo as an USB Mass storage device

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(How to setup the FR as reported on the ML)
 
 
(18 intermediate revisions by 7 users not shown)
Line 1: Line 1:
The following script can be used to make the Neo FreeRunner act as a mass storage device (memory stick, USB key, portable drive...)
+
==Make the Neo FreeRunner act as a mass storage device==
  
  #!/bin/sh                                                                                                                                                                  
+
To access the microSD card in the Freerunner from the host computer as if it were a USB key or memory stick, the following script can be used:
  /etc/init.d/networking stop
+
 
 +
  #!/bin/sh
 +
  ifdown usb0
 +
umount /media/card
 
  rmmod g_ether
 
  rmmod g_ether
  modprobe g_file_storage file=/dev/mmcblk0p1
+
  modprobe g_file_storage file=/dev/mmcblk0 stall=0
 +
Reference: [http://lists.openmoko.org/pipermail/community/2008-September/029261.html Petr Vanek's "usb mass media storage" message on the community mailing list], updated by [[User:Mmontour|Mmontour]] 16:25, 21 March 2009 (UTC). The "stall=0" parameter is required on at least some systems to prevent timeouts and errors.
 +
 
 +
The card is not accessible from the Freerunner in this mode. Sometimes, however, the message displayed may be "interface usb0 already configured" and no device would be detected by the OS FreeRunner is connected to. This issue needs to be addressed properly.
 +
 
 +
==Make the Neo FreeRunner revert to USB networking==
 +
 
 +
Be sure to properly unmount on the host computer first, just as you would with any other USB storage.
 +
 
 +
The following script can be used:
 +
 
 +
#!/bin/sh
 +
rmmod g_file_storage
 +
mount /dev/mmcblk0p1 /media/card
 +
modprobe g_ether
 +
ifup usb0
 +
 
 +
==Is it possible to pretend to be a USB hub, providing both g_ether and g_file_storage?==
 +
 
 +
Not yet. At the moment it's one gadget driver at a time, but there is a project under way to allow use of multiple gadget drivers together. See [http://blog.felipebalbi.com/?p=44 this blog posting called 'USB Composite Gadget Framework'] or [http://www.linux-usb.org/gadget/ Linux-USB Gadget API Framework]
  
Reference: Petr Vanek "usb mass media storage" on the community mailing list, 2/9/08
+
==See also==
 +
* [http://www.linux-usb.org/gadget/file_storage.html Backing Storage for the File-backed Storage Gadget]
  
 
[[Category:USB]]
 
[[Category:USB]]
 +
[[Category:USB software]]

Latest revision as of 12:58, 5 May 2010

Contents

[edit] Make the Neo FreeRunner act as a mass storage device

To access the microSD card in the Freerunner from the host computer as if it were a USB key or memory stick, the following script can be used:

#!/bin/sh
ifdown usb0
umount /media/card
rmmod g_ether
modprobe g_file_storage file=/dev/mmcblk0 stall=0

Reference: Petr Vanek's "usb mass media storage" message on the community mailing list, updated by Mmontour 16:25, 21 March 2009 (UTC). The "stall=0" parameter is required on at least some systems to prevent timeouts and errors.

The card is not accessible from the Freerunner in this mode. Sometimes, however, the message displayed may be "interface usb0 already configured" and no device would be detected by the OS FreeRunner is connected to. This issue needs to be addressed properly.

[edit] Make the Neo FreeRunner revert to USB networking

Be sure to properly unmount on the host computer first, just as you would with any other USB storage.

The following script can be used:

#!/bin/sh
rmmod g_file_storage
mount /dev/mmcblk0p1 /media/card
modprobe g_ether
ifup usb0

[edit] Is it possible to pretend to be a USB hub, providing both g_ether and g_file_storage?

Not yet. At the moment it's one gadget driver at a time, but there is a project under way to allow use of multiple gadget drivers together. See this blog posting called 'USB Composite Gadget Framework' or Linux-USB Gadget API Framework

[edit] See also

Personal tools

The following script can be used to make the Neo FreeRunner act as a mass storage device (memory stick, USB key, portable drive...)

#!/bin/sh                                                                                                                                                                   
/etc/init.d/networking stop
rmmod g_ether
modprobe g_file_storage file=/dev/mmcblk0p1

Reference: Petr Vanek "usb mass media storage" on the community mailing list, 2/9/08