6/22/2012

How to mount the FAT partition as a Mass Storage device in 7x30 Android build?

For 7x30 eMMC builds, the partition.xml defines the partition layout. And some partition can be formatted as FAT partition.
In some use cases, it is needed for some FAT partition to be mounted as Mass Storage device, some users can drag-and-drop files to and from PC the eMMC 's FAT partition.

The following steps are guidelines for how to do it:

1. In Android UI, go to "Qualcomm Setting --> USB Mass Storage" and click for yes.
2. In Android UI, go to "Qualcomm Setting --> USB Composition " and click on "DIAG+MODEM+NMA+MSC"
3. Adb Shell in to Android, and go to "/dev/block/" and do a list to show all partitions on eMMC. You should see "mmcblk0pN", where N is the order of partitions on eMMC. Then identify the designated partition which is FAT format, as an example we assume partition 0 is the FAT partition we need to mount as Mass Storage device.

4. # mkdir /data/fat
5. # mount -t vfat -r -w /dev/block/mmcblk0p1 /data/fat
6. # echo "/dev/block/mmcblk0p1" > /sys/devices/platform/msm_hsusb/gadget/lun0/file

7. Then unplug and re-plug the device to PC, and you should see eMMC FAT partition from PC

No comments:

Post a Comment