75XX USB Device Mass Storage
The SBC must be setup prior to connection to a host PC. These steps are outline below.
1.) Create a mount point and then mount the first partition of SD card where the storage element exists.
mkdir /mnt/vfat; mount /dev/nbd1 /mnt/vfat
Install the g_file_storage driver with storage element details
modprobe g_file_storage file=/mnt/vfat/usb_storage_file
After following these steps for preparing the SBC storage element, plug the SBC into the host PC with a A to B USB Cable (ISB Cable). You will see the newly mounted volume and should be able to access it.
When you have completed using the device on the Linux or Windows System, you will need to eject volume using either umount on Linux, or "Safely Remove Hardware" on Windows and then unplug the USB cable.
After transferring data from a host PC to the SBC through the USB Mass Storage Device Linux gadget, you can access the data on the SBC by using the following steps.
1.) Remove the g_file_storage driver allowing local access to storage element
rmmod g_file_storage
2.) Create a mount point and then mount the storage element (assuming "/dev/nbd1" is still mounted to "/mnt/vfat" from steps above)
mkdir /mnt/usbdev
mount -t vfat -o loop=/dev/loop0,offset=4096 /mnt/vfat/usb_storage_file /mnt/usbdev/
The kernel should already have support for loop block devices. If not, you will need to insert the loop.ko module with modprobe or insmod.
You can now locally access /mnt/usbdev.
When finished with the device, or to allow access via the USB Device port, you must un-mount the device using:
umount /mnt/usbdev