NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

USB File Storage Gadget

From Texas Instruments Wiki
Jump to: navigation, search

Davinci Linux can run in the host, or in the peripheral mode. This document covers how to configure Linux kernel for a USB peripheral device (DVEVM in this case). Document chooses File-backed Storage Gadget (FSG) module on USB peripheral device. The FSG acts as a USB mass storage disk drive. As its storage repository it can use a regular file or a block device (in much the same way as the "loop" device driver), specified as a module parameter.

  Host
  --------------------------------------
 | Host-Side | Generic USB | USB Host   |
 | Operating | Storage     | Controller |   
 | System    | Driver      | Driver     |<-------
 |           |             | and        |        |  
 |           |             | USB Stack  |        | 
  --------------------------------------         |
                                                 |  
                                                 | USB Cable ( Male-Male)
                                                 |
  DVEVM                                          |
  --------------------------------------         |
 |             |           | USB Periph.|        |
 | Device-Side | USB Gadget| Controller |        |
 | Operating   | File      | Driver     |<-------
 | System      | Storage   | and        |
 | (Linux)     | Driver    | USB Stack  |
  --------------------------------------


Rebuilding Kernel[edit]

This section of document covers the kernel configuration needed for DVEVM. Launch kernel menuconfig and enable the following options in sequence.

 Device  Driver ->  USB Support -> USB Gadget ->
                                  <*>  Support for USB Gadget
 Device  Driver ->  USB Support -> Driver Mode ->
                                  <*> Gadget Stack
 Device  Driver ->  USB Support -> USB Gadget -> 
                                   USB peripheral controller
                                      <*> Inverntra (M) USB peripheral 
                                   <M> USB Gadget driver
                                   <M> File-backed Storage gadget

Note: Make sure USB DMA is enabled.


Configuring backing storage device[edit]

Refer Backing Storage for the File-backed Storage Gadget for creating temporary FSG device.

In this artical we will use Compact Flash as a FSG device. Make sure that CF support is enabled in Davinci Kernel (System types and features -> TI Implementation -> <*> CF Support)

Putting it all together[edit]

1. Insert CF card on DVEVM

2. Set J7 jumper to enable USB slave mode

3. Boot DVEVM with kernel built in previous steps

4. Run "insmod g_file_storage.ko file=/dev/hda1" command to install FSG module.

5. Connect DVEVM with Host machine using USB male-male cable.


On success, host machine will detect a USB mass storage device. In case of Windows Host, you will see a new drive letter in your Explorer window.

Enjoy!

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article USB File Storage Gadget here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article USB File Storage Gadget here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article USB File Storage Gadget here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article USB File Storage Gadget here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article USB File Storage Gadget here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article USB File Storage Gadget here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article USB File Storage Gadget here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article USB File Storage Gadget here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article USB File Storage Gadget here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity