Google
  Web www.spinics.net

Making flash appear as USB device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi All,

   I have i.MX21 based kit and it has a USB device port. I want the
kit's flash to be seen as a USB storage device when I connect it to my
PC though the USB device port. As the kit has a NOR flash only, I
plugged in a flash drive into the kit (sda1) - hoping to access it
though the device port from my PC.

  So I compiled the 2.6.22 kernel with USB_GADGET and
USB_FILE_STORAGE. The config file is as follows:

#
# USB Gadget Support
#
CONFIG_USB_GADGET=m
# CONFIG_USB_GADGET_DEBUG_FILES is not set
CONFIG_USB_GADGET_SELECTED=y
# CONFIG_USB_GADGET_FSL_USB2 is not set
# CONFIG_USB_GADGET_NET2280 is not set
# CONFIG_USB_GADGET_PXA2XX is not set
# CONFIG_USB_GADGET_GOKU is not set
# CONFIG_USB_GADGET_LH7A40X is not set
# CONFIG_USB_GADGET_OMAP is not set
# CONFIG_USB_GADGET_AT91 is not set
CONFIG_USB_GADGET_DUMMY_HCD=y
CONFIG_USB_DUMMY_HCD=m
CONFIG_USB_GADGET_DUALSPEED=y
# CONFIG_USB_ZERO is not set
# CONFIG_USB_ETH is not set
# CONFIG_USB_GADGETFS is not set
CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_FILE_STORAGE_TEST=y
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set

  After booting I do a modprobe and the results are as follows:

/ # modprobe g_file_storage file=/dev/sda1
dummy_hcd dummy_hcd: USB Host+Gadget Emulator, driver 02 May 2005
dummy_hcd dummy_hcd: Dummy host controller
dummy_hcd dummy_hcd: new USB bus registered, assigned bus number 2
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
g_file_storage gadget: File-backed Storage Gadget, version: 28 November 2005
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=0, file: /dev/sda1
/ # High speed Hub
usb 2-1: new high speed USB device using dummy_hcd and address 2
High speed Hub
usb 2-1: configuration #1 chosen from 1 choice
g_file_storage gadget: high speed config #1
scsi1 : SCSI emulation for USB Mass Storage devices

/ # scsi 1:0:0:0: Direct-Access     Linux    File-Stor Gadget 0302 PQ: 0 ANSI: 2
sd 1:0:0:0: [sdb] 4020160 512-byte hardware sectors (2058 MB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] 4020160 512-byte hardware sectors (2058 MB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Assuming drive cache: write through
 sdb:<7>usb-storage: queuecommand called
 unknown partition table
sd 1:0:0:0: [sdb] Attached SCSI disk

 Now when I plug in the kit to my PC, my PC does not detect it. What
is it that is going  wrong or am I missing something?

  Please help.

Thanks,
Midhun.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux