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.
UsbConfigDevFSG
About this page[edit]
This page describes the Linux kernel config options for usb FileStorage gadget on different kernel versions. Please refer the config option which matches with kernel version of release you are using.
Configuration[edit]
Linux v3.2[edit]
Start the Linux Kernel Configuration tool:
$ make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm menuconfig
Select Device Drivers from the main menu.
... ... Power management options ---> [ ] Networking support ---> Device Drivers ---> File systems ---> Kernel hacking ---> ... ...
Select USB support as shown here
... ... <*> Sound card support ---> [*] HID Devices ---> [*] USB support ---> <*> MMC/SD/SDIO card support ---> ... ...
Go to USB Gadget Support as shown here
... ... < > USB YUREX driver support <*> USB Gadget Support ---> *** OTG and related infrastructure *** < > GPIO based peripheral-only VBUS sensing 'transceiver' ... ...
Select Inventra HDRC USB Peripheral as shown here
... ... (2) Maximum VBUS Power usage (2-500 mA) (2) Number of storage pipeline buffers <*> USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...)) ---> < > USB Gadget Drivers ... ...
Select File-backed Storage Gadget as shown here
... ... <*> USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...)) ---> < > USB Gadget Drivers ... <M> File-backed Storage Gadget (DEPRECATED) [ ] File-backed Storage Gadget testing version ... ...
This is all required for adding USB FileStorage gadget support in kernel.
Testing[edit]
Let us assume that we are interested in exposing /dev/mmcblk0 block device to the file storage gadget device to host (windows/linux). To that effect we need to issue the following command to load the file storage gadget driver. The module parameter buflen can be used to set buffersize of the gadget driver for better performance, please refer to /driver/usb/gadget/file_storage.c for more information on module parameters.
example #insmod <g_file_storage.ko> file=/dev/sda1 buflen=65536 stall=0 removable=1 #insmod <g_file_storage.ko> file=/dev/mmcblk0 stall=0 removable=1