This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Issue with USB File Storage Gadget on windows machine.



Hi,

I am trying to utlize USB as a file storage gadget functionality of DM355 with EVM board.

I am using SD card as the mass storage device.

After inserting "g_file_storage.ko" module I am able to view/access the SD card plugged on EVM board as USB device on a Linux machine(connected the EVM to a Linux machine using a USB cable). The SD card has Fat32 Filesystem. It works fine.

However if I connect EVM to a Windows machine, I do not see the drive. The windows machine identifies that there is some mass storage device connected, but it does not show it as a drive. If I see the properties window of the USB device I see "This device is working properly.".

Are there any settings needed to be done for the "file storage" module so that it gets properly detected and accessible on Windows machine ?

Anyone faced such issue?

 

Thanks,

Snehal

 

 

 

 

  • I believe windows is very picky about the way you format your FAT 32 partition.  I have tried the following a couple of years ago and it appeared to work for me (you would use your SD card device node instead of '/opt/storage')

    dvevm# fdisk /opt/storage

    Note: For 64MB; C/H/S = 1024/16/8 and choose partition type “Win FAT32” so that device can be accessed from Windows Host.

     

    fdisk log:

    Command (m for help): x

     

    Expert command (m for help): s

    Number of sectors (1-63, default 63): 8

    Expert command (m for help): h

    Number of heads (1-256, default 255): 16

     

    Expert command (m for help): c

    Number of cylinders (1-1048576, default 8): 1024

     

    Expert command (m for help): r

    Command (m for help): n

    Command action

       e   extended

       p   primary partition (1-4)

    p

    Partition number (1-4): 1

    First cylinder (1-1024, default 1):

    Using default value 1

    Last cylinder or +size or +sizeM or +sizeK (1-1024, default 1024):

    Using default value 1024

     

    Command (m for help): t

    Selected partition 1

    Hex code (type L to list codes): b

    Changed system type of partition 1 to b (W95 FAT32)

     

     

    Command (m for help): p

     

    Disk /opt/storage: 67 MB, 67108864 bytes

    16 heads, 8 sectors/track, 1024 cylinders

    Units = cylinders of 128 * 512 = 65536 bytes

     

    Device Boot      Start         End      Blocks   Id  System

    /opt/storage1      1        1024       65532    b  W95 FAT32

     

     

    Command (m for help): w

     

  • Hi Juan,

    Thanks for the reply.

    The thing is if I plugin the same SD card to the Windows macine through a card reader(USB card reader). Windows does display a drive. This prompts me to think there is some issue with the settings of the "file storage" module in the kernel.

    Can to give any pointers ?

     

    Thanks,

    Snehal

     

     

  • Snehal,

    What is your command line for inserting the module?

    Thanks,
    Ian

  • Make sure you are inserting the module with:

    modprobe g_file_storage file=/dev/mmcblk0

    and not mmcblk0p1.

    If you just use the partition as the file backing, windows will not see it as a disk properly...although Linux is ok with this.

    If you export the entire card device (no trailing 'p1'), then it can be seen properly by both Windows and Linux.

    This could be your issue.

    -Ian

  • Hi Ian,

    Thanks for the response.

    I used to use "insmod g_file_storage file=/dev/mmcblk0p1"

    Was just exporting a partition.

     

    I tried "insmod g_file_storage file=/dev/mmcblk0" that worked fine for windows.

    Thanks a lot.

     

    Thanks,

    Snehal